KTH framework for Nek5000 toolboxes; testing version
0.0.1
|
Multistep checkpointing for DNS, MHD and linear simulations. More...
Files | |
file | chkptms.f |
Set of multi-file checkpoint routines for DNS, MHD and perturbation simulations. | |
Functions | |
subroutine | chkpts_register () |
Register multi step checkpointing module. More... | |
subroutine | chkpts_init |
Initialise multi-file checkpoint routines. More... | |
logical function | chkpts_is_initialised () |
Check if module was initialised. More... | |
subroutine | chkpts_write () |
Write full file restart set. More... | |
subroutine | chkpts_read () |
Read full file restart set. More... | |
subroutine | chkptms_dt_get |
Get old simulation time steps and pressure mesh marker. More... | |
subroutine | chkptms_set_name (fname, fnum, nset, ifile) |
Generate set of restart file names in snapshot. More... | |
subroutine | chkpt_fname (fname, prefix, nset, ifile, ierr) |
Generate single restart file name. More... | |
subroutine | chkptms_restart_write (fname, fnum, ifcoord) |
Write checkpoint snapshot. More... | |
subroutine | chkptms_restart_read (fname, fnum) |
Read checkpoint snapshot. More... | |
subroutine | chkptms_mfo (fname, chktype, ipert) |
Write field to the file. More... | |
subroutine | chkptms_mfi (fname, chktype, ipert) |
Read field to the file. More... | |
subroutine | chkptms_map_gll (xf, yf, nxr, nzr, nel) |
Interpolate input on velocity mesh. More... | |
subroutine | chkptms_map_gl (xf, yf, nxr, nzr, nel) |
Interpolate pressure input. More... | |
subroutine | chkptms_axis_interp_ic () |
Map loaded variables from velocity to axisymmetric mesh. More... | |
Multistep checkpointing for DNS, MHD and linear simulations.
In the case of multistep restart one needs data from NBDINP timestep, where NBDINP is time integration order. I adapt full_restart and full_restart_save subroutines for DNS, MHD and perturbation simulations. There are three possible sets of restart files generated by this module:
where X is equal to 2*NBDINP and gives a max number of restart files. Only NBDINP files is requiered for restart and there are two file sets to avoid overwritting. Checkpoints are saved in double precission in binary ###.f format.
The possible combinations of files are:
In the perturbation mode only the first perturbation is written to the checkpoint file. To save disc space the mesh data is written only to the 'rsX...' file. For not moving boundaries (IFMVBD=FALSE) only the first 'rsX...' file in the set contains mehs data. In the similar way in the perturbation mode with fixed base flow (IFBASE=FALSE) only single 'rsX...' file is generated.
Notice for multistep checkpointing runtime parameter chkpFnumber gives the fiel set number, so it can be equal 1 or 2 only.
subroutine chkpt_fname | ( | character*132 | fname, |
character*3 | prefix, | ||
integer | nset, | ||
integer | ifile, | ||
integer | ierr | ||
) |
Generate single restart file name.
[out] | fname | restart file name |
[in] | prefix | prefix |
[in] | nset | set number |
[in] | ifile | snupshot numer |
[out] | ierr | error mark |
Definition at line 461 of file chkptms.f.
References io_mfo_fname(), and mntr_error().
subroutine chkptms_axis_interp_ic |
Map loaded variables from velocity to axisymmetric mesh.
Definition at line 1342 of file chkptms.f.
References copy(), invmt(), and mxm().
subroutine chkptms_dt_get |
Get old simulation time steps and pressure mesh marker.
Definition at line 300 of file chkptms.f.
References addfid(), bcast(), blank(), byte_close, byte_open, byte_read, chkpt_fname(), io_init(), and mntr_check_abort().
subroutine chkptms_map_gl | ( | real, dimension(lx2,ly2,lz2,nel) | xf, |
real, dimension(nxr,nxr,nzr,nel) | yf, | ||
integer | nxr, | ||
integer | nzr, | ||
integer | nel | ||
) |
Interpolate pressure input.
This is version of mapab modified to work with pressure mesh. It iterpolates fields defined on GL points. Like the orginal routine I assume NXR=NYR=NZR, or NXR=NYR, NZR=1
[out] | xf | output field on pressure mesh |
[in] | yf | input field on pressure mesh |
[in] | nxr,nzr | array sizes |
[in] | nel | element number |
Definition at line 1278 of file chkptms.f.
References copy(), iglm(), mxm(), and zwgl().
subroutine chkptms_map_gll | ( | real, dimension(lx1,ly1,lz1,nel) | xf, |
real, dimension(nxr,nxr,nzr,nel) | yf, | ||
integer | nxr, | ||
integer | nzr, | ||
integer | nel | ||
) |
Interpolate input on velocity mesh.
This is version of mapab with corrected array sizes. It iterpolates fields defined on GLL points. Like the orginal routine I assume NXR=NYR=NZR, or NXR=NYR, NZR=1
[out] | xf | output field on velocity mesh |
[in] | yf | input field on velocity mesh |
[in] | nxr,nzr | array sizes |
[in] | nel | element number |
Definition at line 1209 of file chkptms.f.
References copy(), igllm(), mxm(), and zwgll().
subroutine chkptms_mfi | ( | character*132 | fname, |
integer | chktype, | ||
integer | ipert | ||
) |
Read field to the file.
This routine is based on mfi but supports perturbation as well. It is optimised for chekpoint reading.
[in] | fname | file name |
[in] | chktype | data type to read (DNS, MHD, preturbation) |
[in] | ipert | index of perturbation field |
Definition at line 834 of file chkptms.f.
References chkptms_axis_interp_ic(), chkptms_map_gl(), chkptms_map_gll(), copy(), io_mbyte_close(), io_mfis(), io_mfiv(), map12(), map21t(), mfi_prepare(), mntr_check_abort(), mntr_log(), mntr_logi(), and mntr_logr().
subroutine chkptms_mfo | ( | character*132 | fname, |
integer | chktype, | ||
integer | ipert | ||
) |
Write field to the file.
This routine is based on mfo_outfld but does not assume any file numbering. It is optimised for chekpoint writing.
[in] | fname | file name |
[in] | chktype | data type to write (DNS, MHD, perturbation) |
[in] | ipert | index of perturbation field |
Definition at line 669 of file chkptms.f.
References copy(), io_mbyte_close(), io_mbyte_open(), io_mfos(), io_mfov(), mfo_write_hdr(), mntr_check_abort(), mntr_log(), mntr_logi(), mntr_logr(), and rzero().
subroutine chkptms_restart_read | ( | character*132, dimension(chkptms_fmax) | fname, |
integer | fnum | ||
) |
Read checkpoint snapshot.
[out] | fname | restart file name |
[in] | fnum | number of files in snapshot |
Definition at line 603 of file chkptms.f.
References chkptms_mfi(), mntr_abort(), and sioflag().
subroutine chkptms_restart_write | ( | character*132, dimension(chkptms_fmax) | fname, |
integer | fnum, | ||
logical | ifcoord | ||
) |
Write checkpoint snapshot.
[out] | fname | restart file name |
[in] | fnum | number of files in snapshot |
[in] | ifcoord | do we save coordinates |
Definition at line 511 of file chkptms.f.
References chkptms_mfo(), and mntr_abort().
subroutine chkptms_set_name | ( | character*132, dimension(chkptms_fmax) | fname, |
integer | fnum, | ||
integer | nset, | ||
integer | ifile | ||
) |
Generate set of restart file names in snapshot.
[out] | fname | restart file names |
[out] | fnum | number of files in snapshot |
[in] | nset | set number |
[in] | ifile | snupshot numer |
Definition at line 383 of file chkptms.f.
References chkpt_fname(), and mntr_check_abort().
subroutine chkpts_init |
Initialise multi-file checkpoint routines.
Definition at line 56 of file chkptms.f.
References mntr_abort(), and mntr_warn().
logical function chkpts_is_initialised |
Check if module was initialised.
Definition at line 94 of file chkptms.f.
References chkpts_is_initialised().
subroutine chkpts_read |
Read full file restart set.
Definition at line 209 of file chkptms.f.
References chcopy(), chkptms_dt_get(), chkptms_restart_read(), chkptms_set_name(), io_init(), mntr_tmr_add(), and mntr_warn().
subroutine chkpts_register |
Register multi step checkpointing module.
Definition at line 8 of file chkptms.f.
References mntr_abort(), mntr_mod_is_name_reg(), mntr_mod_reg(), mntr_set_step_delay(), mntr_tmr_is_name_reg(), mntr_tmr_reg(), and mntr_warn().
subroutine chkpts_write |
Write full file restart set.
Definition at line 109 of file chkptms.f.
References chcopy(), chkptms_restart_write(), chkptms_set_name(), io_init(), mntr_log(), and mntr_tmr_add().