Reading and storing check points (restart files)¶
readCheckPoints.f90
¶
Description
This module contains the functions that can help reading and mapping of the restart files
Quick access
- Variables:
bytes_allocated
,finish_start_fields
,getlm2lmo
,l_axi_old
,lreadr
,lreads
,lreadxi
,mapdatahydro
,mapdatamag
,mapdatar
,maponefield
,maponefield_mpi
,n_start_file
,ratio1
,ratio1_old
,ratio2
,ratio2_old
,read_map_one_field
,read_map_one_field_mpi
,read_map_one_scalar
,read_map_one_scalar_mpi
- Routines:
readstartfields()
,readstartfields_mpi()
,readstartfields_old()
Needed modules
iso_fortran_env
(output_unit()
)precision_mod
: This module controls the precision used in MagICparallel_mod
: This module contains the blocking informationcommunications
(scatter_from_rank0_to_lo()
,lo2r_one()
): This module contains the different MPI communicators used in MagIC.fields
(dw_lmloc()
,ddw_lmloc()
,ds_lmloc()
,dp_lmloc()
,dz_lmloc()
,dxi_lmloc()
,db_lmloc()
,ddb_lmloc()
,dj_lmloc()
,ddj_lmloc()
,db_ic_lmloc()
,ddb_ic_lmloc()
,dj_ic_lmloc()
,ddj_ic_lmloc()
): This module contains all the fields used in MagIC in the hybrid (LM,r) space as well as their radial derivatives. It defines both the LM-distributed arrays and the R-distributed arrays….truncation
(n_r_max()
,lm_max()
,n_r_maxmag()
,lm_maxmag()
,n_r_ic_max()
,n_r_ic_maxmag()
,nalias()
,n_phi_tot()
,l_max()
,m_max()
,minc()
,lmagmem()
,fd_stretch()
,fd_ratio()
,m_min()
): This module defines the grid points and the truncationlogic
(l_rot_ma()
,l_rot_ic()
,l_sric()
,l_srma()
,l_cond_ic()
,l_heat()
,l_mag()
,l_mag_lf()
,l_chemical_conv()
,l_ab1()
,l_bridge_step()
,l_double_curl()
,l_z10mat()
,l_single_matrix()
,l_parallel_solve()
,l_mag_par_solve()
,l_phase_field()
): Module containing the logicals that control the runblocking
(lo_map()
,lm2l()
,lm2m()
,lm_balance()
,llm()
,ulm()
,llmmag()
,ulmmag()
,st_map()
): Module containing blocking informationinit_fields
(start_file()
,inform()
,tomega_ic1()
,tomega_ic2()
,tomega_ma1()
,tomega_ma2()
,omega_ic1()
,omegaosz_ic1()
,omega_ic2()
,omegaosz_ic2()
,omega_ma1()
,omegaosz_ma1()
,omega_ma2()
,omegaosz_ma2()
,tshift_ic1()
,tshift_ic2()
,tshift_ma1()
,tshift_ma2()
,tipdipole()
,scale_b()
,scale_v()
,scale_s()
,scale_xi()
): This module is used to construct the initial solution.radial_functions
(rscheme_oc()
,chebt_ic()
,cheb_norm_ic()
,r()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)num_param
(alph1()
,alph2()
,alpha()
): Module containing numerical and control parametersradial_data
(n_r_icb()
,n_r_cmb()
): This module defines the MPI decomposition in the radial direction.physical_parameters
(ra()
,ek()
,pr()
,prmag()
,radratio()
,sigma_ratio()
,kbotv()
,ktopv()
,sc()
,raxi()
,lffac()
): Module containing the physical parametersconstants
(c_z10_omega_ic()
,c_z10_omega_ma()
,pi()
,zero()
,two()
,one()
,c_lorentz_ma()
,c_lorentz_ic()
,c_moi_ic()
,c_moi_ma()
): module containing constants and parameters used in the code.radial_scheme
(type_rscheme()
): This is an abstract type that defines the radial scheme used in MagICfinite_differences
(type_fd()
): This module is used to calculate the radial grid when finite differences are requestedcosine_transform_odd
(costf_odd_t()
): This module contains the built-in type I discrete Cosine Transforms. This implementation is based on Numerical Recipes and FFTPACK. This only works forn_r_max-1 = 2**a 3**b 5**c
, with a,b,c integers….useful
(polynomial_interpolation()
,abortrun()
): This module contains several useful routines.updatewp_mod
(get_pol_rhs_imp()
): This module handles the time advance of the poloidal potential w and the pressure p. It contains the computation of the implicit terms and the linear solves.updatez_mod
(get_tor_rhs_imp()
): This module handles the time advance of the toroidal potential z It contains the computation of the implicit terms and the linear solves….updates_mod
(get_entropy_rhs_imp()
): This module handles the time advance of the entropy s. It contains the computation of the implicit terms and the linear solves….updatexi_mod
(get_comp_rhs_imp()
): This module handles the time advance of the chemical composition xi. It contains the computation of the implicit terms and the linear solves….updateb_mod
(get_mag_rhs_imp()
,get_mag_ic_rhs_imp()
): This module handles the time advance of the magnetic field potentials b and aj as well as the inner core counterparts b_ic and aj_ic. It contains the computation of the implicit terms and the linearupdatewps_mod
(get_single_rhs_imp()
): This module handles the time advance of the poloidal potential w, the pressure p and the entropy s in one single matrix per degree. It contains the computation of the implicit terms and the lineartime_schemes
(type_tscheme()
): This module defines an abstract class type_tscheme which is employed for the time advance of the code.time_array
(type_tarray()
,type_tscalar()
): This module defines two types that are defined to store the implicit/explicit terms at the different sub-stage/step.
Variables
- readcheckpoints/bytes_allocated [integer,private/optional/default=0]¶
- readcheckpoints/finish_start_fields [private]¶
- readcheckpoints/getlm2lmo [private]¶
- readcheckpoints/l_axi_old [logical,private]¶
- readcheckpoints/lreadr [logical,private]¶
- readcheckpoints/lreads [logical,private]¶
- readcheckpoints/lreadxi [logical,private]¶
- readcheckpoints/mapdatahydro [private]¶
- readcheckpoints/mapdatamag [private]¶
- readcheckpoints/mapdatar [private]¶
- readcheckpoints/maponefield [private]¶
- readcheckpoints/maponefield_mpi [private]¶
- readcheckpoints/n_start_file [integer,private]¶
- readcheckpoints/print_info [private]¶
- readcheckpoints/ratio1 [real,private]¶
- readcheckpoints/ratio1_old [real,private]¶
- readcheckpoints/ratio2 [real,private]¶
- readcheckpoints/ratio2_old [real,private]¶
- readcheckpoints/read_map_one_field [private]¶
- readcheckpoints/read_map_one_field_mpi [private]¶
- readcheckpoints/read_map_one_scalar [private]¶
- readcheckpoints/read_map_one_scalar_mpi [private]¶
Subroutines and functions
- subroutine readcheckpoints/readstartfields_old(w, dwdt, z, dzdt, p, dpdt, s, dsdt, xi, dxidt, phi, dphidt, b, dbdt, aj, djdt, b_ic, dbdt_ic, aj_ic, djdt_ic, omega_ic, omega_ma, domega_ic_dt, domega_ma_dt, time, tscheme, n_time_step)¶
This subroutine is used to read the old restart files produced by MagIC. This is now deprecated with the change of the file format. This is still needed to read old files.
- Parameters:
dwdt [type_tarray ,inout]
dzdt [type_tarray ,inout]
dpdt [type_tarray ,inout]
dsdt [type_tarray ,inout]
dxidt [type_tarray ,inout]
dphidt [type_tarray ,inout]
b (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
dbdt [type_tarray ,inout]
aj (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
djdt [type_tarray ,inout]
b_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,out]
dbdt_ic [type_tarray ,inout]
aj_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,out]
djdt_ic [type_tarray ,inout]
omega_ic [real ,out]
omega_ma [real ,out]
domega_ic_dt [type_tscalar ,inout]
domega_ma_dt [type_tscalar ,inout]
time [real ,out]
tscheme [real ]
n_time_step [integer ,out]
- Called from:
- Call to:
abortrun()
,scatter_from_rank0_to_lo()
,get_single_rhs_imp()
,get_pol_rhs_imp()
,get_entropy_rhs_imp()
,get_tor_rhs_imp()
,get_comp_rhs_imp()
,get_mag_rhs_imp()
,get_mag_ic_rhs_imp()
- subroutine readcheckpoints/readstartfields(w, dwdt, z, dzdt, p, dpdt, s, dsdt, xi, dxidt, phi, dphidt, b, dbdt, aj, djdt, b_ic, dbdt_ic, aj_ic, djdt_ic, omega_ic, omega_ma, domega_ic_dt, domega_ma_dt, time, tscheme, n_time_step)¶
This subroutine is used to read the restart files produced by MagIC.
- Parameters:
dwdt [type_tarray ,inout]
dzdt [type_tarray ,inout]
dpdt [type_tarray ,inout]
dsdt [type_tarray ,inout]
dxidt [type_tarray ,inout]
dphidt [type_tarray ,inout]
b (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
dbdt [type_tarray ,inout]
aj (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
djdt [type_tarray ,inout]
b_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,out]
dbdt_ic [type_tarray ,inout]
aj_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,out]
djdt_ic [type_tarray ,inout]
omega_ic [real ,out]
omega_ma [real ,out]
domega_ic_dt [type_tscalar ,inout]
domega_ma_dt [type_tscalar ,inout]
time [real ,out]
tscheme [real ]
n_time_step [integer ,out]
- Called from:
- Call to:
abortrun()
,scatter_from_rank0_to_lo()
,get_single_rhs_imp()
,get_pol_rhs_imp()
,get_entropy_rhs_imp()
,get_tor_rhs_imp()
,get_comp_rhs_imp()
,get_mag_rhs_imp()
,get_mag_ic_rhs_imp()
- subroutine readcheckpoints/readstartfields_mpi(w, dwdt, z, dzdt, p, dpdt, s, dsdt, xi, dxidt, phi, dphidt, b, dbdt, aj, djdt, b_ic, dbdt_ic, aj_ic, djdt_ic, omega_ic, omega_ma, domega_ic_dt, domega_ma_dt, time, tscheme, n_time_step)¶
This subroutine is used to read the restart files produced by MagIC using MPI-IO
- Parameters:
dwdt [type_tarray ,inout]
dzdt [type_tarray ,inout]
dpdt [type_tarray ,inout]
dsdt [type_tarray ,inout]
dxidt [type_tarray ,inout]
dphidt [type_tarray ,inout]
b (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
dbdt [type_tarray ,inout]
aj (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
djdt [type_tarray ,inout]
b_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,out]
dbdt_ic [type_tarray ,inout]
aj_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,out]
djdt_ic [type_tarray ,inout]
omega_ic [real ,out]
omega_ma [real ,out]
domega_ic_dt [type_tscalar ,inout]
domega_ma_dt [type_tscalar ,inout]
time [real ,out]
tscheme [real ]
n_time_step [integer ,out]
- Called from:
- Call to:
mpiio_setup()
,abortrun()
,readstartfields()
,getblocks()
,scatter_from_rank0_to_lo()
,get_single_rhs_imp()
,get_pol_rhs_imp()
,get_entropy_rhs_imp()
,get_tor_rhs_imp()
,get_comp_rhs_imp()
,get_mag_rhs_imp()
,get_mag_ic_rhs_imp()
storeCheckPoints.f90
¶
Description
This module contains several subroutines that can be used to store the checkpoint_#.tag files
Quick access
- Variables:
- Routines:
Needed modules
iso_fortran_env
(output_unit()
)precision_mod
: This module controls the precision used in MagICparallel_mod
: This module contains the blocking informationcommunications
(gt_oc()
,gt_ic()
,gather_from_lo_to_rank0()
,gather_all_from_lo_to_rank0()
,lo2r_one()
): This module contains the different MPI communicators used in MagIC.truncation
(n_r_max()
,n_r_ic_max()
,minc()
,nalias()
,n_theta_max()
,n_phi_tot()
,lm_max()
,lm_maxmag()
,n_r_maxmag()
,m_max()
,n_r_ic_maxmag()
,l_max()
,fd_stretch()
,fd_ratio()
,m_min()
): This module defines the grid points and the truncationradial_functions
(rscheme_oc()
,r()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(ra()
,pr()
,prmag()
,radratio()
,ek()
,sigma_ratio()
,raxi()
,sc()
,stef()
): Module containing the physical parametersblocking
(llm()
,ulm()
,llmmag()
,ulmmag()
): Module containing blocking informationradial_data
(nrstart()
,nrstop()
,nrstartmag()
,nrstopmag()
): This module defines the MPI decomposition in the radial direction.num_param
(tscale()
,alph1()
,alph2()
): Module containing numerical and control parametersinit_fields
(inform()
,omega_ic1()
,omegaosz_ic1()
,tomega_ic1()
,omega_ic2()
,omegaosz_ic2()
,tomega_ic2()
,omega_ma1()
,omegaosz_ma1()
,tomega_ma1()
,omega_ma2()
,omegaosz_ma2()
,tomega_ma2()
): This module is used to construct the initial solution.logic
(l_heat()
,l_mag()
,l_cond_ic()
,l_chemical_conv()
,l_save_out()
,l_double_curl()
,l_parallel_solve()
,l_mag_par_solve()
,l_phase_field()
): Module containing the logicals that control the runoutput_data
(tag()
,log_file()
,n_log_file()
): This module contains the parameters for output controlcharmanip
(dble2str()
): This module contains several useful routines to manipule character stringstime_schemes
(type_tscheme()
): This module defines an abstract class type_tscheme which is employed for the time advance of the code.time_array
(type_tarray()
,type_tscalar()
): This module defines two types that are defined to store the implicit/explicit terms at the different sub-stage/step.
Variables
Subroutines and functions
- subroutine storecheckpoints/store(time, tscheme, n_time_step, l_stop_time, l_new_rst_file, l_ave_file, w, z, p, s, xi, phi, b, aj, b_ic, aj_ic, dwdt, dzdt, dpdt, dsdt, dxidt, dphidt, dbdt, djdt, dbdt_ic, djdt_ic, domega_ma_dt, domega_ic_dt)¶
This subroutine stores the results in a checkpoint file. In addition to the magnetic field and velocity potentials we also store the time derivative terms djdt(lm,nR),dbdt(lm,nR), … to allow to restart with 2nd order Adams-Bashforth scheme. To minimize the memory imprint, a gather/write strategy has been adopted here. This implies that only one global array dimension(lm_max,n_r_max) is required.
- Parameters:
time [real ,in]
tscheme [real ]
n_time_step [integer ,in]
l_stop_time [logical ,in]
l_new_rst_file [logical ,in]
l_ave_file [logical ,in]
b (1 - llmmag + ulmmag,n_r_maxmag) [complex ,in]
aj (1 - llmmag + ulmmag,n_r_maxmag) [complex ,in]
b_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,in]
aj_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,in]
dwdt [type_tarray ,in]
dzdt [type_tarray ,in]
dpdt [type_tarray ,in]
dsdt [type_tarray ,in]
dxidt [type_tarray ,in]
dphidt [type_tarray ,in]
dbdt [type_tarray ,in]
djdt [type_tarray ,in]
dbdt_ic [type_tarray ,in]
djdt_ic [type_tarray ,in]
domega_ma_dt [type_tscalar ,in]
domega_ic_dt [type_tscalar ,in]
- Call to:
- subroutine storecheckpoints/store_mpi(time, tscheme, n_time_step, l_stop_time, l_new_rst_file, l_ave_file, w, z, p, s, xi, phi, b, aj, b_ic, aj_ic, dwdt, dzdt, dpdt, dsdt, dxidt, dphidt, dbdt, djdt, dbdt_ic, djdt_ic, domega_ma_dt, domega_ic_dt)¶
This subroutine stores the results in a checkpoint file. In addition to the magnetic field and velocity potentials we also store the time derivative terms djdt(lm,nR),dbdt(lm,nR), … to allow to restart with 2nd order Adams-Bashforth scheme. To minimize the memory imprint, a gather/write strategy has been adopted here. This implies that only one global array dimension(lm_max,n_r_max) is required.
- Parameters:
time [real ,in]
tscheme [real ]
n_time_step [integer ,in]
l_stop_time [logical ,in]
l_new_rst_file [logical ,in]
l_ave_file [logical ,in]
b (lm_maxmag,1 - nrstartmag + nrstopmag) [complex ,in]
aj (lm_maxmag,1 - nrstartmag + nrstopmag) [complex ,in]
b_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,in]
aj_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,in]
dwdt [type_tarray ,in]
dzdt [type_tarray ,in]
dpdt [type_tarray ,in]
dsdt [type_tarray ,in]
dxidt [type_tarray ,in]
dphidt [type_tarray ,in]
dbdt [type_tarray ,in]
djdt [type_tarray ,in]
dbdt_ic [type_tarray ,in]
djdt_ic [type_tarray ,in]
domega_ma_dt [type_tscalar ,in]
domega_ic_dt [type_tscalar ,in]
- Called from:
- Call to: