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

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, lorentz_torque_ic_dt, lorentz_torque_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:
  • w (1 - llm + ulm,n_r_max) [complex ,out]

  • dwdt [type_tarray ,inout]

  • z (1 - llm + ulm,n_r_max) [complex ,out]

  • dzdt [type_tarray ,inout]

  • p (1 - llm + ulm,n_r_max) [complex ,out]

  • dpdt [type_tarray ,inout]

  • s (1 - llm + ulm,n_r_max) [complex ,out]

  • dsdt [type_tarray ,inout]

  • xi (1 - llm + ulm,n_r_max) [complex ,out]

  • dxidt [type_tarray ,inout]

  • phi (1 - llm + ulm,n_r_max) [complex ,out]

  • 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]

  • lorentz_torque_ic_dt [type_tscalar ,inout]

  • lorentz_torque_ma_dt [type_tscalar ,inout]

  • time [real ,out]

  • tscheme [real ]

  • n_time_step [integer ,out]

Called from:

getstartfields()

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, lorentz_torque_ic_dt, lorentz_torque_ma_dt, time, tscheme, n_time_step)

This subroutine is used to read the restart files produced by MagIC.

Parameters:
  • w (1 - llm + ulm,n_r_max) [complex ,out]

  • dwdt [type_tarray ,inout]

  • z (1 - llm + ulm,n_r_max) [complex ,out]

  • dzdt [type_tarray ,inout]

  • p (1 - llm + ulm,n_r_max) [complex ,out]

  • dpdt [type_tarray ,inout]

  • s (1 - llm + ulm,n_r_max) [complex ,out]

  • dsdt [type_tarray ,inout]

  • xi (1 - llm + ulm,n_r_max) [complex ,out]

  • dxidt [type_tarray ,inout]

  • phi (1 - llm + ulm,n_r_max) [complex ,out]

  • 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]

  • lorentz_torque_ic_dt [type_tscalar ,inout]

  • lorentz_torque_ma_dt [type_tscalar ,inout]

  • time [real ,out]

  • tscheme [real ]

  • n_time_step [integer ,out]

Called from:

readstartfields_mpi()

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, lorentz_torque_ic_dt, lorentz_torque_ma_dt, time, tscheme, n_time_step)

This subroutine is used to read the restart files produced by MagIC using MPI-IO

Parameters:
  • w (1 - llm + ulm,n_r_max) [complex ,out]

  • dwdt [type_tarray ,inout]

  • z (1 - llm + ulm,n_r_max) [complex ,out]

  • dzdt [type_tarray ,inout]

  • p (1 - llm + ulm,n_r_max) [complex ,out]

  • dpdt [type_tarray ,inout]

  • s (1 - llm + ulm,n_r_max) [complex ,out]

  • dsdt [type_tarray ,inout]

  • xi (1 - llm + ulm,n_r_max) [complex ,out]

  • dxidt [type_tarray ,inout]

  • phi (1 - llm + ulm,n_r_max) [complex ,out]

  • 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]

  • lorentz_torque_ic_dt [type_tscalar ,inout]

  • lorentz_torque_ma_dt [type_tscalar ,inout]

  • time [real ,out]

  • tscheme [real ]

  • n_time_step [integer ,out]

Called from:

getstartfields()

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:

write_one_field, write_one_field_mpi

Routines:

store(), store_mpi()

Needed modules

Variables

  • storecheckpoints/write_one_field [private]
  • storecheckpoints/write_one_field_mpi [private]

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, lorentz_torque_ma_dt, lorentz_torque_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]

  • w (1 - llm + ulm,n_r_max) [complex ,in]

  • z (1 - llm + ulm,n_r_max) [complex ,in]

  • p (1 - llm + ulm,n_r_max) [complex ,in]

  • s (1 - llm + ulm,n_r_max) [complex ,in]

  • xi (1 - llm + ulm,n_r_max) [complex ,in]

  • phi (1 - llm + ulm,n_r_max) [complex ,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]

  • lorentz_torque_ma_dt [type_tscalar ,in]

  • lorentz_torque_ic_dt [type_tscalar ,in]

Call to:

dble2str(), gather_all_from_lo_to_rank0()

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, lorentz_torque_ma_dt, lorentz_torque_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:
Called from:

fields_average(), output()

Call to:

dble2str(), mpiio_setup(), gather_from_lo_to_rank0()