Linear calculation part of the time stepping (LMLoop)

LMLoop.f90

Quick access

Variables:

array_of_requests, block_sze, n_penta, n_requests, n_tri, nblocks, parallel_solve, parallel_solve_phase, set_block_number, time_lm_loop

Routines:

assemble_stage(), assemble_stage_rdist(), finalize_lmloop(), finish_explicit_assembly(), finish_explicit_assembly_rdist(), initialize_lmloop(), lmloop(), lmloop_rdist(), test_lmloop()

Needed modules

Variables

  • lmloop_mod/array_of_requests (*) [integer,private/allocatable]
  • lmloop_mod/block_sze [integer,private]

    Size ot the LM blocks

  • lmloop_mod/find_faster_block [private]
  • lmloop_mod/n_penta [integer,private]

    Number of tridiagonal and pentadiagonal solvers

  • lmloop_mod/n_requests [integer,private]
  • lmloop_mod/n_tri [integer,private]
  • lmloop_mod/nblocks [integer,private]

    Max number of MPI request per block

  • lmloop_mod/parallel_solve [private]
  • lmloop_mod/parallel_solve_phase [private]
  • lmloop_mod/set_block_number [private]

    Maximum number of blocks

  • lmloop_mod/time_lm_loop [private]

Subroutines and functions

subroutine  lmloop_mod/initialize_lmloop(tscheme)

This subroutine handles the memory allocation of the matrices needed in the time advance of MagIC

Parameters:

tscheme [real ] :: time scheme

Called from:

magic

Call to:

initialize_updatewps(), initialize_updates(), initialize_updatewp(), initialize_updatexi(), initialize_updatephi(), initialize_updatez(), initialize_updateb(), memwrite()

subroutine  lmloop_mod/test_lmloop(tscheme)

This subroutine is used to solve dummy linear problem to estimate the best blocking size. This is done once at the initialisation stage of MagIC.

Parameters:

tscheme [real ] :: time scheme

Called from:

magic

Call to:

prepares_fd(), preparexi_fd(), preparez_fd(), preparew_fd(), prepareb_fd()

subroutine  lmloop_mod/finalize_lmloop(tscheme)

This subroutine deallocates the matrices involved in the time advance of MagIC.

Parameters:

tscheme [real ] :: time scheme

Called from:

magic

Call to:

finalize_updatewps(), finalize_updates(), finalize_updatewp(), finalize_updatez(), finalize_updatexi(), finalize_updatephi(), finalize_updateb()

subroutine  lmloop_mod/lmloop(time, timenext, tscheme, lmat, lrmsnext, lpressnext, dsdt, dwdt, dzdt, dpdt, dxidt, dphidt, dbdt, djdt, dbdt_ic, djdt_ic, domega_ma_dt, domega_ic_dt, b_nl_cmb, aj_nl_cmb, aj_nl_icb)

This subroutine performs the actual time-stepping. It calls succesively the update routines of the various fields.

Parameters:
  • time [real ,in]

  • timenext [real ,in]

  • tscheme [real ]

  • lmat [logical ,in]

  • lrmsnext [logical ,in]

  • lpressnext [logical ,in]

  • dsdt [type_tarray ,inout]

  • dwdt [type_tarray ,inout]

  • dzdt [type_tarray ,inout]

  • dpdt [type_tarray ,inout]

  • dxidt [type_tarray ,inout]

  • dphidt [type_tarray ,inout]

  • dbdt [type_tarray ,inout]

  • djdt [type_tarray ,inout]

  • dbdt_ic [type_tarray ,inout]

  • djdt_ic [type_tarray ,inout]

  • domega_ma_dt [type_tscalar ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • b_nl_cmb (lm_max) [complex ,in] :: nonlinear bc for b at CMB

  • aj_nl_cmb (lm_max) [complex ,in] :: nonlinear bc for aj at CMB

  • aj_nl_icb (lm_max) [complex ,in] :: nonlinear bc for dr aj at ICB

Called from:

step_time()

Call to:

updatephi(), updates(), updatexi(), updatez(), updatewps(), updatewp(), updateb()

subroutine  lmloop_mod/lmloop_rdist(time, timenext, tscheme, lmat, lrmsnext, lpressnext, lp00next, dsdt, dwdt, dzdt, dpdt, dxidt, dphidt, dbdt, djdt, dbdt_ic, djdt_ic, domega_ma_dt, domega_ic_dt, b_nl_cmb, aj_nl_cmb, aj_nl_icb)

This subroutine performs the actual time-stepping. It calls succesively the update routines of the various fields. This is used with the parallel finite difference solver.

Parameters:
  • time [real ,in]

  • timenext [real ,in]

  • tscheme [real ]

  • lmat [logical ,in]

  • lrmsnext [logical ,in]

  • lpressnext [logical ,in]

  • lp00next [logical ,in] :: Do wee need p00 pressure on next log

  • dsdt [type_tarray ,inout]

  • dwdt [type_tarray ,inout]

  • dzdt [type_tarray ,inout]

  • dpdt [type_tarray ,inout]

  • dxidt [type_tarray ,inout]

  • dphidt [type_tarray ,inout]

  • dbdt [type_tarray ,inout]

  • djdt [type_tarray ,inout]

  • dbdt_ic [type_tarray ,inout]

  • djdt_ic [type_tarray ,inout]

  • domega_ma_dt [type_tscalar ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • b_nl_cmb (lm_max) [complex ,in] :: nonlinear bc for b at CMB

  • aj_nl_cmb (lm_max) [complex ,in] :: nonlinear bc for aj at CMB

  • aj_nl_icb (lm_max) [complex ,in] :: nonlinear bc for dr aj at ICB

Called from:

step_time()

Call to:

preparephase_fd(), fill_ghosts_phi(), updatephase_fd(), prepares_fd(), preparexi_fd(), preparez_fd(), preparew_fd(), prepareb_fd(), fill_ghosts_s(), fill_ghosts_xi(), fill_ghosts_z(), fill_ghosts_w(), fill_ghosts_b(), updates_fd(), updatexi_fd(), updatez_fd(), updatew_fd(), updateb_fd(), updateb()

subroutine  lmloop_mod/finish_explicit_assembly(omega_ma, omega_ic, w, b_ic, aj_ic, dvsr_lmloc, dvxir_lmloc, dvxvh_lmloc, dvxbh_lmloc, lorentz_torque_ma, lorentz_torque_ic, dsdt, dxidt, dwdt, djdt, dbdt_ic, djdt_ic, domega_ma_dt, domega_ic_dt, tscheme)

This subroutine is used to finish the computation of the explicit terms. This is only possible in a LM-distributed space since it mainly involves computation of radial derivatives.

Parameters:
  • omega_ma [real ,in]

  • omega_ic [real ,in]

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

  • b_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,in]

  • aj_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,in]

  • dvsr_lmloc (1 - llm + ulm,n_r_max) [complex ,inout]

  • dvxir_lmloc (1 - llm + ulm,n_r_max) [complex ,inout]

  • dvxvh_lmloc (1 - llm + ulm,n_r_max) [complex ,inout]

  • dvxbh_lmloc (1 - llmmag + ulmmag,n_r_maxmag) [complex ,inout]

  • lorentz_torque_ma [real ,in]

  • lorentz_torque_ic [real ,in]

  • dsdt [type_tarray ,inout]

  • dxidt [type_tarray ,inout]

  • dwdt [type_tarray ,inout]

  • djdt [type_tarray ,inout]

  • dbdt_ic [type_tarray ,inout]

  • djdt_ic [type_tarray ,inout]

  • domega_ma_dt [type_tscalar ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • tscheme [real ]

Called from:

step_time()

Call to:

finish_exp_comp(), finish_exp_smat(), finish_exp_entropy(), finish_exp_pol(), finish_exp_tor(), finish_exp_mag(), finish_exp_mag_ic()

subroutine  lmloop_mod/finish_explicit_assembly_rdist(omega_ma, omega_ic, w, b_ic, aj_ic, dvsr_rloc, dvxir_rloc, dvxvh_rloc, dvxbh_rloc, lorentz_torque_ma, lorentz_torque_ic, dsdt_rloc, dxidt_rloc, dwdt_rloc, djdt_rloc, dbdt_ic, djdt_ic, domega_ma_dt, domega_ic_dt, tscheme)

This subroutine is used to finish the computation of the explicit terms. This is the version that handles R-distributed arrays used when FD are employed.

Parameters:
Called from:

step_time()

Call to:

finish_exp_comp_rdist(), finish_exp_smat_rdist(), finish_exp_entropy_rdist(), finish_exp_pol_rdist(), finish_exp_tor(), finish_exp_mag_rdist(), finish_exp_mag_ic()

subroutine  lmloop_mod/assemble_stage(time, omega_ic, omega_ic1, omega_ma, omega_ma1, dwdt, dzdt, dpdt, dsdt, dxidt, dphidt, dbdt, djdt, dbdt_ic, djdt_ic, domega_ic_dt, domega_ma_dt, lpressnext, lrmsnext, tscheme)

This routine is used to call the different assembly stage of the different equations. This is only used for a special subset of IMEX-RK schemes that have tscheme%l_assembly=.true.

Parameters:
  • time [real ,in]

  • omega_ic [real ,inout]

  • omega_ic1 [real ,inout]

  • omega_ma [real ,inout]

  • omega_ma1 [real ,inout]

  • dwdt [type_tarray ,inout]

  • dzdt [type_tarray ,inout]

  • dpdt [type_tarray ,inout]

  • dsdt [type_tarray ,inout]

  • dxidt [type_tarray ,inout]

  • dphidt [type_tarray ,inout]

  • dbdt [type_tarray ,inout]

  • djdt [type_tarray ,inout]

  • dbdt_ic [type_tarray ,inout]

  • djdt_ic [type_tarray ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • domega_ma_dt [type_tscalar ,inout]

  • lpressnext [logical ,in]

  • lrmsnext [logical ,in]

  • tscheme [real ]

Called from:

step_time()

Call to:

assemble_comp(), assemble_phase(), assemble_single(), assemble_entropy(), assemble_pol(), assemble_tor(), assemble_mag()

subroutine  lmloop_mod/assemble_stage_rdist(time, omega_ic, omega_ic1, omega_ma, omega_ma1, dwdt, dzdt, dpdt, dsdt, dxidt, dphidt, dbdt, djdt, dbdt_ic, djdt_ic, domega_ic_dt, domega_ma_dt, lpressnext, lrmsnext, tscheme)

This routine is used to call the different assembly stage of the different equations. This is only used for a special subset of IMEX-RK schemes that have tscheme%l_assembly=.true.

Parameters:
  • time [real ,in]

  • omega_ic [real ,inout]

  • omega_ic1 [real ,inout]

  • omega_ma [real ,inout]

  • omega_ma1 [real ,inout]

  • dwdt [type_tarray ,inout]

  • dzdt [type_tarray ,inout]

  • dpdt [type_tarray ,inout]

  • dsdt [type_tarray ,inout]

  • dxidt [type_tarray ,inout]

  • dphidt [type_tarray ,inout]

  • dbdt [type_tarray ,inout]

  • djdt [type_tarray ,inout]

  • dbdt_ic [type_tarray ,inout]

  • djdt_ic [type_tarray ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • domega_ma_dt [type_tscalar ,inout]

  • lpressnext [logical ,in]

  • lrmsnext [logical ,in]

  • tscheme [real ]

Called from:

step_time()

Call to:

assemble_phase_rloc(), assemble_comp_rloc(), assemble_entropy_rloc(), assemble_pol_rloc(), assemble_tor_rloc(), assemble_mag_rloc(), assemble_mag()

updateWPS.f90

Description

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 linear solves.

Quick access

Variables:

cor00_fac, get_ps0mat, get_wpsmat, lwpsmat, ps0mat, ps0mat_fac, ps0pivot, workb, workc, wpsmat, wpsmat_fac, wpspivot

Routines:

assemble_single(), finalize_updatewps(), finish_exp_smat(), finish_exp_smat_rdist(), get_single_rhs_imp(), initialize_updatewps(), updatewps()

Needed modules

Variables

  • updatewps_mod/cor00_fac [real,private]
  • updatewps_mod/get_ps0mat [private]
  • updatewps_mod/get_wpsmat [private]
  • updatewps_mod/lwpsmat (*) [logical,allocatable/public]
  • updatewps_mod/maxthreads [integer,private]
  • updatewps_mod/ps0mat (*,*) [real,private/allocatable]

    ‘)

  • updatewps_mod/ps0mat_fac (*,*) [real,private/allocatable]
  • updatewps_mod/ps0pivot (*) [integer,private/allocatable]
  • updatewps_mod/rhs1 (*,*,*) [real,private/allocatable]
  • updatewps_mod/workb (*,*) [complex,private/allocatable]
  • updatewps_mod/workc (*,*) [complex,private/allocatable]
  • updatewps_mod/wpsmat (*,*,*) [real,private/allocatable]

    ‘)

  • updatewps_mod/wpsmat_fac (*,*,*) [real,private/allocatable]
  • updatewps_mod/wpspivot (*,*) [integer,private/allocatable]

Subroutines and functions

subroutine  updatewps_mod/initialize_updatewps()
Called from:

initialize_lmloop()

subroutine  updatewps_mod/finalize_updatewps()
Called from:

finalize_lmloop()

subroutine  updatewps_mod/updatewps(time, w, dw, ddw, z10, dwdt, p, dp, dpdt, s, ds, dsdt, tscheme, lrmsnext)

updates the poloidal velocity potential w, the pressure p, the entropy and their radial derivatives.

Parameters:
Called from:

lmloop()

Call to:

get_single_rhs_imp()

subroutine  updatewps_mod/finish_exp_smat(dvsrlm, ds_exp_last)
Parameters:
Called from:

finish_explicit_assembly()

Call to:

get_openmp_blocks()

subroutine  updatewps_mod/finish_exp_smat_rdist(dvsrlm, ds_exp_last)
Parameters:
Called from:

finish_explicit_assembly_rdist()

Call to:

get_dr_rloc(), get_openmp_blocks()

subroutine  updatewps_mod/assemble_single(s, ds, w, dw, ddw, dsdt, dwdt, dpdt, tscheme, lrmsnext)

This routine is used to assemble the solution in case IMEX RK with an assembly stage are used

Parameters:
  • s (1 - llm + ulm,n_r_max) [complex ,inout]

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

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

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

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

  • dsdt [type_tarray ,inout]

  • dwdt [type_tarray ,inout]

  • dpdt [type_tarray ,inout]

  • tscheme [real ]

  • lrmsnext [logical ,in]

Called from:

assemble_stage()

Call to:

abortrun(), get_openmp_blocks(), get_ddr(), cc2real()

subroutine  updatewps_mod/get_single_rhs_imp(s, ds, w, dw, ddw, p, dp, dsdt, dwdt, dpdt, tscheme, istage, l_calc_lin, lrmsnext[, l_in_cheb_space])

– Input variables

Parameters:
  • s (1 - llm + ulm,n_r_max) [complex ,inout]

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

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

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

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

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

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

  • dsdt [type_tarray ,inout]

  • dwdt [type_tarray ,inout]

  • dpdt [type_tarray ,inout]

  • tscheme [real ]

  • istage [integer ,in]

  • l_calc_lin [logical ,in]

  • lrmsnext [logical ,in]

Options:

l_in_cheb_space [logical ,in,]

Called from:

readstartfields_old(), readstartfields(), readstartfields_mpi(), getstartfields(), updatewps()

Call to:

get_openmp_blocks(), get_ddr(), get_dddr(), cc2real()

updateWP.f90

Description

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.

Quick access

Variables:

ddddw, dwold, ellmat_fd, get_elliptic_mat, get_elliptic_mat_rdist, get_p0mat, get_p0mat_rdist, get_pol, get_wmat, get_wmat_rdist, get_wpmat, l_ellmat, lwpmat, p0_ghost, p0mat_fd, rhs0, size_rhs1, w_ghost, wmat_fd, work, wpmat_fac

Routines:

assemble_pol(), assemble_pol_rloc(), fill_ghosts_w(), finalize_updatewp(), finish_exp_pol(), finish_exp_pol_rdist(), get_pol_rhs_imp(), get_pol_rhs_imp_ghost(), initialize_updatewp(), preparew_fd(), updatew_fd(), updatewp()

Needed modules

Variables

  • updatewp_mod/ddddw (*,*) [complex,private/allocatable]
  • updatewp_mod/dwold (*,*) [complex,private/allocatable]
  • updatewp_mod/ellmat_fd [type_tri_par,public]
  • updatewp_mod/get_elliptic_mat [private]
  • updatewp_mod/get_elliptic_mat_rdist [private]
  • updatewp_mod/get_p0mat [private]
  • updatewp_mod/get_p0mat_rdist [private]
  • updatewp_mod/get_pol [private]
  • updatewp_mod/get_wmat [private]
  • updatewp_mod/get_wmat_rdist [private]
  • updatewp_mod/get_wpmat [private]
  • updatewp_mod/l_ellmat (*) [logical,private/allocatable]
  • updatewp_mod/lwpmat (*) [logical,allocatable/public]
  • updatewp_mod/maxthreads [integer,private]
  • updatewp_mod/p0_ghost (*) [complex,allocatable/public]
  • updatewp_mod/p0mat_fd [type_tri_par,public]
  • updatewp_mod/rhs (*) [real,private/allocatable]
  • updatewp_mod/rhs0 (*,*,*) [real,private/allocatable]
  • updatewp_mod/rhs1 (*,*,*) [real,private/allocatable]
  • updatewp_mod/size_rhs1 [integer,private]
  • updatewp_mod/w_ghost (*,*) [complex,allocatable/public]
  • updatewp_mod/wmat_fd [type_penta_par,public]
  • updatewp_mod/work (*) [real,private/allocatable]
  • updatewp_mod/wpmat_fac (*,*,*) [real,private/allocatable]

Subroutines and functions

subroutine  updatewp_mod/initialize_updatewp(tscheme)

Purpose of this subroutine is to allocate the matrices needed to time advance the poloidal/pressure equations. Depending on the radial scheme, it can be either full or band matrices.

Parameters:

tscheme [real ] :: time scheme

Called from:

initialize_lmloop()

subroutine  updatewp_mod/finalize_updatewp(tscheme)

Deallocation of the matrices used to time-advance the poloidal/pressure equations.

Parameters:

tscheme [real ] :: time scheme

Called from:

finalize_lmloop()

subroutine  updatewp_mod/updatewp(time, s, xi, w, dw, ddw, dwdt, p, dp, dpdt, tscheme, lrmsnext, lpressnext)

updates the poloidal velocity potential w, the pressure p, and their radial derivatives.

Parameters:
Called from:

lmloop()

Call to:

rint_r(), get_pol_rhs_imp()

subroutine  updatewp_mod/preparew_fd(time, tscheme, dwdt, lpressnext)
Parameters:
  • time [real ,in]

  • tscheme [real ]

  • dwdt [type_tarray ,inout]

  • lpressnext [logical ,in]

Called from:

test_lmloop(), lmloop_rdist()

Call to:

get_openmp_blocks()

subroutine  updatewp_mod/fill_ghosts_w(wg, p0g, lpressnext)

This subroutine is used to fill the ghost zones.

Parameters:
Called from:

lmloop_rdist(), getstartfields(), assemble_pol_rloc()

Call to:

get_openmp_blocks()

subroutine  updatewp_mod/updatew_fd(w, dw, ddw, dwdt, p, dp, dpdt, tscheme, lrmsnext, lpressnext, lp00next)

– Input of variables:

Parameters:
  • w (lm_max,1 - nrstart + nrstop) [complex ,inout] :: Poloidal potential

  • dw (lm_max,1 - nrstart + nrstop) [complex ,inout] :: Radial derivative of w

  • ddw (lm_max,1 - nrstart + nrstop) [complex ,out] :: Radial derivative of dw

  • dwdt [type_tarray ,inout]

  • p (lm_max,1 - nrstart + nrstop) [complex ,inout] :: Pressure

  • dp (lm_max,1 - nrstart + nrstop) [complex ,out] :: Radial derivative of p

  • dpdt [type_tarray ,in]

  • tscheme [real ]

  • lrmsnext [logical ,in]

  • lpressnext [logical ,in]

  • lp00next [logical ,in]

Called from:

lmloop_rdist()

Call to:

get_pol_rhs_imp_ghost(), get_openmp_blocks()

subroutine  updatewp_mod/finish_exp_pol(dvxvhlm, dw_exp_last)
Parameters:
Called from:

finish_explicit_assembly()

Call to:

get_openmp_blocks()

subroutine  updatewp_mod/finish_exp_pol_rdist(dvxvhlm, dw_exp_last)
Parameters:
Called from:

finish_explicit_assembly_rdist()

Call to:

get_dr_rloc(), get_openmp_blocks()

subroutine  updatewp_mod/get_pol_rhs_imp(s, xi, w, dw, ddw, p, dp, dwdt, dpdt, tscheme, istage, l_calc_lin, lpressnext, lrmsnext, dp_expl[, l_in_cheb_space])

This subroutine computes the derivatives of w and p and assemble the implicit stage if needed.

Parameters:
Options:

l_in_cheb_space [logical ,in,]

Called from:

readstartfields_old(), readstartfields(), readstartfields_mpi(), getstartfields(), updatewp()

Call to:

get_openmp_blocks(), get_ddr(), get_dddr(), cc2real()

subroutine  updatewp_mod/get_pol_rhs_imp_ghost(wg, dw, ddw, p, dp, dwdt, tscheme, istage, l_calc_lin, lpressnext, lrmsnext, dp_expl)

This subroutine computes the derivatives of w and p and assemble the implicit stage if needed.

Parameters:
Called from:

getstartfields(), updatew_fd(), assemble_pol_rloc()

Call to:

get_openmp_blocks(), get_ddddr_ghost(), get_dr_rloc(), cc2real()

subroutine  updatewp_mod/assemble_pol(s, xi, w, dw, ddw, p, dp, dwdt, dpdt, dp_expl, tscheme, lpressnext, lrmsnext)

This subroutine is used to assemble w and dw/dr when IMEX RK time schemes which necessitate an assembly stage are employed. Robin-type boundary conditions are enforced using Canuto (1986) approach.

Parameters:
Called from:

assemble_stage()

Call to:

get_openmp_blocks(), get_ddr(), cc2real()

subroutine  updatewp_mod/assemble_pol_rloc(block_sze, nblocks, w, dw, ddw, p, dp, dwdt, dp_expl, tscheme, lpressnext, lrmsnext)

This subroutine is used to assemble w and dw/dr when IMEX RK time schemes which necessitate an assembly stage are employed. Robin-type boundary conditions are enforced using Canuto (1986) approach.

Parameters:
Called from:

assemble_stage_rdist()

Call to:

get_openmp_blocks(), bulk_to_ghost(), abortrun(), exch_ghosts(), fill_ghosts_w(), get_pol_rhs_imp_ghost()

updateZ.f90

Description

This module handles the time advance of the toroidal potential z It contains the computation of the implicit terms and the linear solves.

Quick access

Variables:

get_z10mat, get_z10mat_rdist, get_zmat, get_zmat_rdist, lz10mat, lzmat, maxthreads, rhs, rhs1, update_rot_rates, update_rot_rates_rloc, z10_ghost, z10mat_fac, z10mat_fd, z_ghost, zmat_fac, zmat_fd

Routines:

assemble_tor(), assemble_tor_rloc(), fill_ghosts_z(), finalize_updatez(), finish_exp_tor(), get_tor_rhs_imp(), get_tor_rhs_imp_ghost(), initialize_updatez(), preparez_fd(), updatez(), updatez_fd()

Needed modules

Variables

  • updatez_mod/get_z10mat [private]

    ‘)

  • updatez_mod/get_z10mat_rdist [private]
  • updatez_mod/get_zmat [private]
  • updatez_mod/get_zmat_rdist [private]
  • updatez_mod/lz10mat [logical,public]
  • updatez_mod/lzmat (*) [logical,allocatable/public]
  • updatez_mod/maxthreads [integer,private]
  • updatez_mod/rhs (*) [complex,private/allocatable]

    rhs for l=1, m=0

  • updatez_mod/rhs1 (*,*,*) [real,private/allocatable]

    RHS for other modes

  • updatez_mod/update_rot_rates [private]
  • updatez_mod/update_rot_rates_rloc [private]
  • updatez_mod/z10_ghost (*) [complex,allocatable/public]
  • updatez_mod/z10mat_fac (*) [real,private/allocatable]
  • updatez_mod/z10mat_fd [type_tri_par,public]
  • updatez_mod/z_ghost (*,*) [complex,allocatable/public]
  • updatez_mod/zmat_fac (*,*) [real,private/allocatable]

    Inverse of max(zMat) for the inversion

  • updatez_mod/zmat_fd [type_tri_par,public]

Subroutines and functions

subroutine  updatez_mod/initialize_updatez()

This subroutine handles the memory allocation of the arrays involved in the time advance of the toroidal potential.

Called from:

initialize_lmloop()

subroutine  updatez_mod/finalize_updatez()

Memory deallocation of arrays associated with time advance of Z

Called from:

finalize_lmloop()

subroutine  updatez_mod/updatez(time, timenext, z, dz, dzdt, omega_ma, omega_ic, domega_ma_dt, domega_ic_dt, tscheme, lrmsnext)

Updates the toroidal potential z and its radial derivative dz

Parameters:
  • time [real ,in] :: Current stage time

  • timenext [real ,in] :: Next time

  • z (1 - llm + ulm,n_r_max) [complex ,inout] :: Toroidal velocity potential z

  • dz (1 - llm + ulm,n_r_max) [complex ,out] :: Radial derivative of z

  • dzdt [type_tarray ,inout]

  • omega_ma [real ,out] :: Calculated OC rotation

  • omega_ic [real ,out] :: Calculated IC rotation

  • domega_ma_dt [type_tscalar ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • tscheme [real ]

  • lrmsnext [logical ,in] :: Logical for storing update if (l_RMS.and.l_logNext)

Called from:

lmloop()

Call to:

get_tor_rhs_imp()

subroutine  updatez_mod/preparez_fd(time, tscheme, dzdt, omega_ma, omega_ic, domega_ma_dt, domega_ic_dt, dom_ma, dom_ic)

– Input of variables:

Parameters:
  • time [real ,in]

  • tscheme [real ]

  • dzdt [type_tarray ,inout]

  • omega_ma [real ,inout] :: Calculated OC rotation

  • omega_ic [real ,inout] :: Calculated IC rotation

  • domega_ma_dt [type_tscalar ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • dom_ma [real ,out] :: /c_dt_z10_ma

  • dom_ic [real ,out] :: /c_dt_z10_ic

Called from:

test_lmloop(), lmloop_rdist()

Call to:

get_openmp_blocks()

subroutine  updatez_mod/fill_ghosts_z(zg)

This subroutine is used to fill the ghosts zones that are located at nR=n_r_cmb-1 and nR=n_r_icb+1. This is used to properly set the Neuman boundary conditions. In case Dirichlet BCs are used, a simple first order extrapolation is employed. This is anyway only used for outputs (like Nusselt numbers).

Parameters:

zg (lm_max,3 - nrstart + nrstop) [complex ,inout]

Called from:

lmloop_rdist(), getstartfields(), assemble_tor_rloc()

Call to:

get_openmp_blocks()

subroutine  updatez_mod/updatez_fd(time, timenext, dom_ma, dom_ic, z, dz, dzdt, omega_ma, omega_ic, domega_ma_dt, domega_ic_dt, tscheme, lrmsnext)

– Input of variables:

Parameters:
  • time [real ,in] :: Current stage time

  • timenext [real ,in] :: Next time

  • dom_ma [real ,in]

  • dom_ic [real ,in]

  • z (lm_max,1 - nrstart + nrstop) [complex ,inout] :: Toroidal potential

  • dz (lm_max,1 - nrstart + nrstop) [complex ,out] :: Radial derivative of z

  • dzdt [type_tarray ,inout]

  • omega_ma [real ,inout] :: Calculated OC rotation

  • omega_ic [real ,inout] :: Calculated IC rotation

  • domega_ma_dt [type_tscalar ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • tscheme [real ]

  • lrmsnext [logical ,in] :: Logical for storing update if (l_RMS.and.l_logNext)

Called from:

lmloop_rdist()

Call to:

get_tor_rhs_imp_ghost(), get_openmp_blocks()

subroutine  updatez_mod/get_tor_rhs_imp(time, z, dz, dzdt, domega_ma_dt, domega_ic_dt, omega_ic, omega_ma, omega_ic1, omega_ma1, tscheme, istage, l_calc_lin, lrmsnext[, l_in_cheb_space])

– Input variables

Parameters:
  • time [real ,in]

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

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

  • dzdt [type_tarray ,inout]

  • domega_ma_dt [type_tscalar ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • omega_ic [real ,inout]

  • omega_ma [real ,inout]

  • omega_ic1 [real ,inout]

  • omega_ma1 [real ,inout]

  • tscheme [real ]

  • istage [integer ,in]

  • l_calc_lin [logical ,in]

  • lrmsnext [logical ,in]

Options:

l_in_cheb_space [logical ,in,]

Called from:

readstartfields_old(), readstartfields(), readstartfields_mpi(), getstartfields(), updatez(), assemble_tor()

Call to:

get_openmp_blocks(), get_ddr(), get_angular_moment(), cc2real()

subroutine  updatez_mod/get_tor_rhs_imp_ghost(time, zg, dz, dzdt, domega_ma_dt, domega_ic_dt, omega_ic, omega_ma, omega_ic1, omega_ma1, tscheme, istage, l_calc_lin, lrmsnext)

– Input variables

Parameters:
  • time [real ,in]

  • zg (lm_max,3 - nrstart + nrstop) [complex ,inout]

  • dz (lm_max,1 - nrstart + nrstop) [complex ,out]

  • dzdt [type_tarray ,inout]

  • domega_ma_dt [type_tscalar ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • omega_ic [real ,inout]

  • omega_ma [real ,inout]

  • omega_ic1 [real ,inout]

  • omega_ma1 [real ,inout]

  • tscheme [real ]

  • istage [integer ,in]

  • l_calc_lin [logical ,in]

  • lrmsnext [logical ,in]

Called from:

getstartfields(), updatez_fd(), assemble_tor_rloc()

Call to:

get_openmp_blocks(), get_ddr_ghost(), get_angular_moment_rloc(), cc2real()

subroutine  updatez_mod/assemble_tor(time, z, dz, dzdt, domega_ic_dt, domega_ma_dt, omega_ic, omega_ma, omega_ic1, omega_ma1, lrmsnext, tscheme)

This subroutine is used to assemble the toroidal flow potential when an IMEX RK time scheme with an assembly stage is employed (LM-distributed version).

Parameters:
  • time [real ,in]

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

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

  • dzdt [type_tarray ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • domega_ma_dt [type_tscalar ,inout]

  • omega_ic [real ,inout]

  • omega_ma [real ,inout]

  • omega_ic1 [real ,inout]

  • omega_ma1 [real ,inout]

  • lrmsnext [logical ,in]

  • tscheme [real ]

Called from:

assemble_stage()

Call to:

abortrun(), get_tor_rhs_imp()

subroutine  updatez_mod/assemble_tor_rloc(time, z, dz, dzdt, domega_ic_dt, domega_ma_dt, omega_ic, omega_ma, omega_ic1, omega_ma1, lrmsnext, tscheme)

This subroutine is used when a IMEX Runge-Kutta scheme with an assembly stage is employed (R-distributed version)

Parameters:
  • time [real ,in]

  • z (lm_max,1 - nrstart + nrstop) [complex ,inout]

  • dz (lm_max,1 - nrstart + nrstop) [complex ,out]

  • dzdt [type_tarray ,inout]

  • domega_ic_dt [type_tscalar ,inout]

  • domega_ma_dt [type_tscalar ,inout]

  • omega_ic [real ,inout]

  • omega_ma [real ,inout]

  • omega_ic1 [real ,inout]

  • omega_ma1 [real ,inout]

  • lrmsnext [logical ,in]

  • tscheme [real ]

Called from:

assemble_stage_rdist()

Call to:

abortrun(), get_openmp_blocks(), bulk_to_ghost(), exch_ghosts(), fill_ghosts_z(), get_tor_rhs_imp_ghost()

subroutine  updatez_mod/finish_exp_tor(omega_ma, omega_ic, lorentz_torque_ma, lorentz_torque_ic, domega_ma_dt_exp, domega_ic_dt_exp)

This subroutine adds the explicit terms (Lorentz torque and part of the gravitationnal torque) to the time evolution of the inner core and mantle rotations.

Parameters:
  • omega_ma [real ,in] :: rotation rate of the mantle

  • omega_ic [real ,in] :: rotation rate of the inner core

  • lorentz_torque_ma [real ,in] :: Lorentz torque (for OC rotation)

  • lorentz_torque_ic [real ,in] :: Lorentz torque (for IC rotation)

  • domega_ma_dt_exp [real ,out]

  • domega_ic_dt_exp [real ,out]

Called from:

finish_explicit_assembly(), finish_explicit_assembly_rdist()

updateS.f90

Description

This module handles the time advance of the entropy s. It contains the computation of the implicit terms and the linear solves.

Quick access

Variables:

get_smat, get_smat_rdist, lsmat, s_ghost, smat_fac, smat_fd

Routines:

assemble_entropy(), assemble_entropy_rloc(), fill_ghosts_s(), finalize_updates(), finish_exp_entropy(), finish_exp_entropy_rdist(), get_entropy_rhs_imp(), get_entropy_rhs_imp_ghost(), initialize_updates(), prepares_fd(), updates(), updates_fd()

Needed modules

Variables

  • updates_mod/fd_fac_bot (*) [real,private/allocatable]
  • updates_mod/fd_fac_top (*) [real,private/allocatable]
  • updates_mod/get_smat [private]
  • updates_mod/get_smat_rdist [private]
  • updates_mod/lsmat (*) [logical,allocatable/public]
  • updates_mod/maxthreads [integer,private]
  • updates_mod/rhs1 (*,*,*) [real,private/allocatable]
  • updates_mod/s_ghost (*,*) [complex,public/allocatable]
  • updates_mod/smat_fac (*,*) [real,private/allocatable]
  • updates_mod/smat_fd [type_tri_par,public]

Subroutines and functions

subroutine  updates_mod/initialize_updates()

This subroutine allocates the arrays involved in the time-advance of the entropy/temperature equation.

Called from:

initialize_lmloop()

subroutine  updates_mod/finalize_updates()

Memory deallocation of updateS module

Called from:

finalize_lmloop()

subroutine  updates_mod/updates(s, ds, dsdt, phi, tscheme)

Updates the entropy field s and its radial derivative.

Parameters:
  • s (1 - llm + ulm,n_r_max) [complex ,inout] :: Entropy

  • ds (1 - llm + ulm,n_r_max) [complex ,out] :: Radial derivative of entropy

  • dsdt [type_tarray ,inout]

  • phi (1 - llm + ulm,n_r_max) [complex ,in] :: Phase field

  • tscheme [real ]

Called from:

lmloop()

Call to:

get_entropy_rhs_imp()

subroutine  updates_mod/prepares_fd(tscheme, dsdt, phi)

This subroutine is used to assemble the r.h.s. of the entropy equation when parallel F.D solvers are used. Boundary values are set here.

Parameters:
Called from:

test_lmloop(), lmloop_rdist()

Call to:

get_openmp_blocks()

subroutine  updates_mod/fill_ghosts_s(sg)

This subroutine is used to fill the ghosts zones that are located at nR=n_r_cmb-1 and nR=n_r_icb+1. This is used to properly set the Neuman boundary conditions. In case Dirichlet BCs are used, a simple first order extrapolation is employed. This is anyway only used for outputs (like Nusselt numbers).

Parameters:

sg (lm_max,3 - nrstart + nrstop) [complex ,inout]

Called from:

lmloop_rdist(), getstartfields(), assemble_entropy_rloc()

Call to:

get_openmp_blocks()

subroutine  updates_mod/updates_fd(s, ds, dsdt, phi, tscheme)

This subroutine is called after the linear solves have been completed. This is then assembling the linear terms that will be used in the r.h.s. for the next iteration.

Parameters:
Called from:

lmloop_rdist()

Call to:

get_entropy_rhs_imp_ghost(), get_openmp_blocks()

subroutine  updates_mod/finish_exp_entropy(w, dvsrlm, ds_exp_last)

This subroutine completes the computation of the advection term by computing the radial derivative (LM-distributed variant).

Parameters:
Called from:

finish_explicit_assembly()

Call to:

get_openmp_blocks()

subroutine  updates_mod/finish_exp_entropy_rdist(w, dvsrlm, ds_exp_last)

This subroutine completes the computation of the advection term by computing the radial derivative (R-distributed variant).

Parameters:
Called from:

finish_explicit_assembly_rdist()

Call to:

get_dr_rloc(), get_openmp_blocks()

subroutine  updates_mod/get_entropy_rhs_imp(s, ds, dsdt, phi, istage, l_calc_lin[, l_in_cheb_space])

This subroutine computes the linear terms that enters the r.h.s.. This is used with LM-distributed

Parameters:
  • s (1 - llm + ulm,n_r_max) [complex ,inout]

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

  • dsdt [type_tarray ,inout]

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

  • istage [integer ,in]

  • l_calc_lin [logical ,in]

Options:

l_in_cheb_space [logical ,in,]

Called from:

readstartfields_old(), readstartfields(), readstartfields_mpi(), getstartfields(), updates(), assemble_entropy()

Call to:

get_openmp_blocks(), get_ddr()

subroutine  updates_mod/get_entropy_rhs_imp_ghost(sg, ds, dsdt, phi, istage, l_calc_lin)

This subroutine computes the linear terms that enters the r.h.s.. This is used with R-distributed

Parameters:
Called from:

getstartfields(), updates_fd(), assemble_entropy_rloc()

Call to:

get_openmp_blocks(), get_ddr_ghost()

subroutine  updates_mod/assemble_entropy_rloc(s, ds, dsdt, phi, tscheme)

This subroutine is used when an IMEX Runge-Kutta time scheme with an assembly stage is used. This is used when R is distributed.

Parameters:
Called from:

assemble_stage_rdist()

Call to:

get_openmp_blocks(), bulk_to_ghost(), exch_ghosts(), fill_ghosts_s(), get_entropy_rhs_imp_ghost()

subroutine  updates_mod/assemble_entropy(s, ds, dsdt, phi, tscheme)

This subroutine is used to assemble the entropy/temperature at assembly stages of IMEX-RK time schemes. This is used when LM is distributed.

Parameters:
Called from:

assemble_stage()

Call to:

get_entropy_rhs_imp()

updateXI.f90

Description

This module handles the time advance of the chemical composition xi. It contains the computation of the implicit terms and the linear solves.

Quick access

Variables:

fd_fac_bot, fd_fac_top, get_ximat, get_ximat_rdist, lximat, xi_ghost, ximat_fac, ximat_fd

Routines:

assemble_comp(), assemble_comp_rloc(), fill_ghosts_xi(), finalize_updatexi(), finish_exp_comp(), finish_exp_comp_rdist(), get_comp_rhs_imp(), get_comp_rhs_imp_ghost(), initialize_updatexi(), preparexi_fd(), updatexi(), updatexi_fd()

Needed modules

Variables

  • updatexi_mod/fd_fac_bot (*) [complex,private/allocatable]
  • updatexi_mod/fd_fac_top (*) [complex,private/allocatable]
  • updatexi_mod/get_ximat [private]
  • updatexi_mod/get_ximat_rdist [private]
  • updatexi_mod/lximat (*) [logical,allocatable/public]
  • updatexi_mod/maxthreads [integer,private]
  • updatexi_mod/rhs1 (*,*,*) [real,private/allocatable]
  • updatexi_mod/xi_ghost (*,*) [complex,allocatable/public]
  • updatexi_mod/ximat_fac (*,*) [real,private/allocatable]
  • updatexi_mod/ximat_fd [type_tri_par,public]

Subroutines and functions

subroutine  updatexi_mod/initialize_updatexi()
Called from:

initialize_lmloop()

subroutine  updatexi_mod/finalize_updatexi()

This subroutine deallocates the matrices involved in the time-advance of xi.

Called from:

finalize_lmloop()

subroutine  updatexi_mod/updatexi(xi, dxi, dxidt, tscheme)

Updates the chemical composition field s and its radial derivative.

Parameters:
  • xi (1 - llm + ulm,n_r_max) [complex ,inout] :: Chemical composition

  • dxi (1 - llm + ulm,n_r_max) [complex ,out] :: Radial derivative of xi

  • dxidt [type_tarray ,inout]

  • tscheme [real ]

Called from:

lmloop()

Call to:

get_comp_rhs_imp()

subroutine  updatexi_mod/preparexi_fd(tscheme, dxidt)

This subroutine is used to assemble the r.h.s. of the composition equation when parallel F.D solvers are used. Boundary values are set here.

Parameters:
  • tscheme [real ]

  • dxidt [type_tarray ,inout]

Called from:

test_lmloop(), lmloop_rdist()

Call to:

get_openmp_blocks()

subroutine  updatexi_mod/fill_ghosts_xi(xig)

This subroutine is used to fill the ghosts zones that are located at nR=n_r_cmb-1 and nR=n_r_icb+1. This is used to properly set the Neuman boundary conditions. In case Dirichlet BCs are used, a simple first order extrapolation is employed. This is anyway only used for outputs (like Sherwood numbers).

Parameters:

xig (lm_max,3 - nrstart + nrstop) [complex ,inout]

Called from:

lmloop_rdist(), getstartfields(), assemble_comp_rloc()

Call to:

get_openmp_blocks()

subroutine  updatexi_mod/updatexi_fd(xi, dxidt, tscheme)

This subroutine is called after the linear solves have been completed. This is then assembling the linear terms that will be used in the r.h.s. for the next iteration.

Parameters:
  • xi (lm_max,1 - nrstart + nrstop) [complex ,inout] :: Composition

  • dxidt [type_tarray ,inout]

  • tscheme [real ]

Called from:

lmloop_rdist()

Call to:

get_comp_rhs_imp_ghost(), get_openmp_blocks()

subroutine  updatexi_mod/finish_exp_comp(w, dvxirlm, dxi_exp_last)

This subroutine completes the computation of the advection term which enters the composition equation by taking the radial derivative. This is the LM-distributed version.

Parameters:
Called from:

finish_explicit_assembly()

Call to:

get_openmp_blocks()

subroutine  updatexi_mod/finish_exp_comp_rdist(w, dvxirlm, dxi_exp_last)

This subroutine completes the computation of the advection term which enters the composition equation by taking the radial derivative. This is the R-distributed version.

Parameters:
Called from:

finish_explicit_assembly_rdist()

Call to:

get_dr_rloc(), get_openmp_blocks()

subroutine  updatexi_mod/get_comp_rhs_imp(xi, dxi, dxidt, istage, l_calc_lin[, l_in_cheb_space])

This subroutine computes the linear terms which enter the r.h.s. of the equation for composition. This is the LM-distributed version.

Parameters:
  • xi (1 - llm + ulm,n_r_max) [complex ,inout]

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

  • dxidt [type_tarray ,inout]

  • istage [integer ,in]

  • l_calc_lin [logical ,in]

Options:

l_in_cheb_space [logical ,in,]

Called from:

readstartfields_old(), readstartfields(), readstartfields_mpi(), getstartfields(), updatexi(), assemble_comp()

Call to:

get_openmp_blocks(), get_ddr()

subroutine  updatexi_mod/get_comp_rhs_imp_ghost(xig, dxidt, istage, l_calc_lin)

This subroutine computes the linear terms which enter the r.h.s. of the equation for composition. This is the R-distributed version.

Parameters:
  • xig (lm_max,3 - nrstart + nrstop) [complex ,inout]

  • dxidt [type_tarray ,inout]

  • istage [integer ,in]

  • l_calc_lin [logical ,in]

Called from:

getstartfields(), updatexi_fd(), assemble_comp_rloc()

Call to:

get_openmp_blocks(), get_ddr_ghost()

subroutine  updatexi_mod/assemble_comp(xi, dxi, dxidt, tscheme)

This subroutine is used to assemble the chemical composition when an IMEX-RK with an assembly stage is employed. Non-Dirichlet boundary conditions are handled using Canuto (1986) approach. This is the LM distributed version.

Parameters:
  • xi (1 - llm + ulm,n_r_max) [complex ,inout]

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

  • dxidt [type_tarray ,inout]

  • tscheme [real ]

Called from:

assemble_stage()

Call to:

get_comp_rhs_imp()

subroutine  updatexi_mod/assemble_comp_rloc(xi, dxidt, tscheme)

This subroutine is used when an IMEX Runge-Kutta time scheme with an assembly stage is used. This is used when R is distributed.

Parameters:
Called from:

assemble_stage_rdist()

Call to:

get_openmp_blocks(), bulk_to_ghost(), exch_ghosts(), fill_ghosts_xi(), get_comp_rhs_imp_ghost()

updateB.f90

Description

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 linear solves.

Quick access

Variables:

aj_ghost, b_ghost, bmat_fac, bmat_fd, get_bmat, get_bmat_rdist, jmat_fac, jmat_fd, lbmat, rhs2, work_ic_lmloc, worka

Routines:

assemble_mag(), assemble_mag_rloc(), fill_ghosts_b(), finalize_updateb(), finish_exp_mag(), finish_exp_mag_ic(), finish_exp_mag_rdist(), get_mag_ic_rhs_imp(), get_mag_rhs_imp(), get_mag_rhs_imp_ghost(), initialize_updateb(), prepareb_fd(), updateb(), updateb_fd()

Needed modules

Variables

  • updateb_mod/aj_ghost (*,*) [complex,public/allocatable]
  • updateb_mod/b_ghost (*,*) [complex,public/allocatable]
  • updateb_mod/bmat_fac (*,*) [real,private/allocatable]
  • updateb_mod/bmat_fd [type_tri_par,public]
  • updateb_mod/get_bmat [private]

    ‘)

  • updateb_mod/get_bmat_rdist [private]
  • updateb_mod/jmat_fac (*,*) [real,private/allocatable]
  • updateb_mod/jmat_fd [type_tri_par,public]
  • updateb_mod/lbmat (*) [logical,allocatable/public]
  • updateb_mod/rhs1 (*,*,*) [real,private/allocatable]
  • updateb_mod/rhs2 (*,*,*) [real,private/allocatable]
  • updateb_mod/work_ic_lmloc (*,*) [complex,private/allocatable]
  • updateb_mod/worka (*,*) [complex,private/allocatable]
  • updateb_mod/workb (*,*) [complex,private/allocatable]

Subroutines and functions

subroutine  updateb_mod/initialize_updateb()

Purpose of this subroutine is to allocate the matrices needed to time advance the magnetic field. Depending on the radial scheme and the inner core conductivity, it can be full, bordered or band matrices.

Called from:

initialize_lmloop()

subroutine  updateb_mod/finalize_updateb()

This subroutine deallocates the matrices involved in the time advance of the magnetic field.

Called from:

finalize_lmloop()

subroutine  updateb_mod/updateb(b, db, ddb, aj, dj, ddj, dbdt, djdt, b_ic, db_ic, ddb_ic, aj_ic, dj_ic, ddj_ic, dbdt_ic, djdt_ic, b_nl_cmb, aj_nl_cmb, aj_nl_icb, time, tscheme, lrmsnext)

Calculates update of magnetic field potentials.

Parameters:
Called from:

lmloop(), lmloop_rdist()

Call to:

get_mag_rhs_imp(), get_mag_ic_rhs_imp()

subroutine  updateb_mod/prepareb_fd(time, tscheme, dbdt, djdt)

This subroutine assembles the r.h.s. when finite difference parallel solver is employed

Parameters:
  • time [real ,in]

  • tscheme [real ]

  • dbdt [type_tarray ,inout]

  • djdt [type_tarray ,inout]

Called from:

test_lmloop(), lmloop_rdist()

Call to:

abortrun(), get_openmp_blocks()

subroutine  updateb_mod/fill_ghosts_b(bg, ajg)

This subroutine is used to fill the ghosts zones that are located at nR=n_r_cmb-1 and nR=n_r_icb+1. This is used to properly set the Neuman boundary conditions. In case Dirichlet BCs are used, a simple first order extrapolation is employed. This is anyway only used for outputs.

Parameters:
Called from:

lmloop_rdist(), getstartfields(), assemble_mag_rloc()

Call to:

get_openmp_blocks(), abortrun()

subroutine  updateb_mod/updateb_fd(b, db, ddb, aj, dj, ddj, dbdt, djdt, tscheme, lrmsnext)

This subroutine handles the IMEX postprocs once the solve has been completed

Parameters:
Called from:

lmloop_rdist()

Call to:

get_mag_rhs_imp_ghost(), get_openmp_blocks()

subroutine  updateb_mod/finish_exp_mag_ic(b_ic, aj_ic, omega_ic, db_exp_last, dj_exp_last)

This subroutine computes the nonlinear term at the inner core boundary when there is a conducting inner core and stress-free boundary conditions.

Parameters:
Called from:

finish_explicit_assembly(), finish_explicit_assembly_rdist()

subroutine  updateb_mod/finish_exp_mag(dvxbhlm, dj_exp_last)

This subroutine finishes the computation of the nonlinear induction term by taking the missing radial derivative (LM-distributed version).

Parameters:
Called from:

finish_explicit_assembly()

Call to:

get_openmp_blocks()

subroutine  updateb_mod/finish_exp_mag_rdist(dvxbhlm, dj_exp_last)

This subroutine finishes the computation of the nonlinear induction term by taking the missing radial derivative (R-distributed version).

Parameters:
Called from:

finish_explicit_assembly_rdist()

Call to:

get_dr_rloc(), get_openmp_blocks()

subroutine  updateb_mod/get_mag_ic_rhs_imp(b_ic, db_ic, ddb_ic, aj_ic, dj_ic, ddj_ic, dbdt_ic, djdt_ic, istage, l_calc_lin[, l_in_cheb_space])

This subroutine computes the linear terms that enter the r.h.s. of the inner core equations.

Parameters:
Options:

l_in_cheb_space [logical ,in,]

Called from:

readstartfields_old(), readstartfields(), readstartfields_mpi(), getstartfields(), updateb(), assemble_mag()

Call to:

get_openmp_blocks(), get_ddr_even()

subroutine  updateb_mod/assemble_mag(b, db, ddb, aj, dj, ddj, b_ic, db_ic, ddb_ic, aj_ic, dj_ic, ddj_ic, dbdt, djdt, dbdt_ic, djdt_ic, lrmsnext, tscheme)

This subroutine is used when an IMEX Runge Kutta with an assembly stage is employed. This is the LM-distributed version

Parameters:
Called from:

assemble_stage(), assemble_stage_rdist()

Call to:

abortrun(), get_mag_rhs_imp(), get_mag_ic_rhs_imp()

subroutine  updateb_mod/assemble_mag_rloc(b, db, ddb, aj, dj, ddj, dbdt, djdt, lrmsnext, tscheme)

This subroutine is used when an IMEX Runge Kutta with an assembly stage is employed. This is the R-distributed version.

Parameters:
Called from:

assemble_stage_rdist()

Call to:

abortrun(), get_openmp_blocks(), bulk_to_ghost(), exch_ghosts(), fill_ghosts_b(), get_mag_rhs_imp_ghost()

subroutine  updateb_mod/get_mag_rhs_imp(b, db, ddb, aj, dj, ddj, dbdt, djdt, tscheme, istage, l_calc_lin, lrmsnext[, l_in_cheb_space])

This subroutine handles the computation of the linear terms which enter the r.h.s. of the induction equation (LM-distributed version).

Parameters:
Options:

l_in_cheb_space [logical ,in,]

Called from:

readstartfields_old(), readstartfields(), readstartfields_mpi(), getstartfields(), updateb(), assemble_mag()

Call to:

get_openmp_blocks(), get_ddr(), cc2real()

subroutine  updateb_mod/get_mag_rhs_imp_ghost(bg, db, ddb, ajg, dj, ddj, dbdt, djdt, tscheme, istage, l_calc_lin, lrmsnext)

This subroutine handles the computation of the linear terms which enter the r.h.s. of the induction equation (R-distributed version).

Parameters:
Called from:

getstartfields(), updateb_fd(), assemble_mag_rloc()

Call to:

get_openmp_blocks(), get_ddr_ghost(), cc2real()

updatePHI.f90

Description

This module handles the time advance of the phase field phi. It contains the computation of the implicit terms and the linear solves.

Quick access

Variables:

get_phimat, get_phimat_rdist, lphimat, phi_ghost, phimat_fac, phimat_fd

Routines:

assemble_phase(), assemble_phase_rloc(), fill_ghosts_phi(), finalize_updatephi(), get_phase_rhs_imp(), get_phase_rhs_imp_ghost(), initialize_updatephi(), preparephase_fd(), updatephase_fd(), updatephi()

Needed modules

Variables

  • updatephi_mod/get_phimat [private]
  • updatephi_mod/get_phimat_rdist [private]
  • updatephi_mod/lphimat (*) [logical,allocatable/public]
  • updatephi_mod/maxthreads [integer,private]
  • updatephi_mod/phi_ghost (*,*) [complex,allocatable/public]
  • updatephi_mod/phimat_fac (*,*) [real,private/allocatable]
  • updatephi_mod/phimat_fd [type_tri_par,public]
  • updatephi_mod/rhs1 (*,*,*) [real,private/allocatable]

Subroutines and functions

subroutine  updatephi_mod/initialize_updatephi()
Called from:

initialize_lmloop()

subroutine  updatephi_mod/finalize_updatephi()

This subroutine deallocates the matrices involved in the time-advance of phi.

Called from:

finalize_lmloop()

subroutine  updatephi_mod/updatephi(phi, dphidt, tscheme)

Updates the phase field

Parameters:
  • phi (1 - llm + ulm,n_r_max) [complex ,inout] :: Chemical composition

  • dphidt [type_tarray ,inout]

  • tscheme [real ]

Called from:

lmloop()

Call to:

get_phase_rhs_imp()

subroutine  updatephi_mod/preparephase_fd(tscheme, dphidt)

This subroutine is used to assemble the r.h.s. of the phase field equation when parallel F.D solvers are used. Boundary values are set here.

Parameters:
  • tscheme [real ]

  • dphidt [type_tarray ,inout]

Called from:

lmloop_rdist()

Call to:

get_openmp_blocks()

subroutine  updatephi_mod/fill_ghosts_phi(phig)

This subroutine is used to fill the ghosts zones that are located at nR=n_r_cmb-1 and nR=n_r_icb+1. This is used to properly set the Neuman boundary conditions. In case Dirichlet BCs are used, a simple first order extrapolation is employed. This is anyway only used for outputs (like Sherwood numbers).

Parameters:

phig (lm_max,3 - nrstart + nrstop) [complex ,inout]

Called from:

lmloop_rdist(), getstartfields(), assemble_phase_rloc()

Call to:

get_openmp_blocks()

subroutine  updatephi_mod/updatephase_fd(phi, dphidt, tscheme)

This subroutine is called after the linear solves have been completed. This is then assembling the linear terms that will be used in the r.h.s. for the next iteration.

Parameters:
  • phi (lm_max,1 - nrstart + nrstop) [complex ,inout] :: Phase field

  • dphidt [type_tarray ,inout]

  • tscheme [real ]

Called from:

lmloop_rdist()

Call to:

get_phase_rhs_imp_ghost(), get_openmp_blocks()

subroutine  updatephi_mod/get_phase_rhs_imp(phi, dphidt, istage, l_calc_lin[, l_in_cheb_space])

This subroutine computes the linear terms which enter the r.h.s. of the equation for phase field. This is the LM-distributed version.

Parameters:
  • phi (1 - llm + ulm,n_r_max) [complex ,inout]

  • dphidt [type_tarray ,inout]

  • istage [integer ,in]

  • l_calc_lin [logical ,in]

Options:

l_in_cheb_space [logical ,in,]

Called from:

getstartfields(), updatephi(), assemble_phase()

Call to:

get_openmp_blocks(), get_ddr()

subroutine  updatephi_mod/get_phase_rhs_imp_ghost(phig, dphidt, istage, l_calc_lin)

This subroutine computes the linear terms which enter the r.h.s. of the equation for phase field. This is the R-distributed version.

Parameters:
  • phig (lm_max,3 - nrstart + nrstop) [complex ,inout]

  • dphidt [type_tarray ,inout]

  • istage [integer ,in]

  • l_calc_lin [logical ,in]

Called from:

getstartfields(), updatephase_fd(), assemble_phase_rloc()

Call to:

get_openmp_blocks(), get_ddr_ghost()

subroutine  updatephi_mod/assemble_phase(phi, dphidt, tscheme)

This subroutine is used to assemble the phase field when an IMEX-RK with an assembly stage is employed.

Parameters:
  • phi (1 - llm + ulm,n_r_max) [complex ,inout]

  • dphidt [type_tarray ,inout]

  • tscheme [real ]

Called from:

assemble_stage()

Call to:

get_phase_rhs_imp()

subroutine  updatephi_mod/assemble_phase_rloc(phi, dphidt, tscheme)

This subroutine is used when an IMEX Runge-Kutta time scheme with an assembly stage is used. This is used when R is distributed.

Parameters:
  • phi (lm_max,1 - nrstart + nrstop) [complex ,inout]

  • dphidt [type_tarray ,inout]

  • tscheme [real ]

Called from:

assemble_stage_rdist()

Call to:

get_openmp_blocks(), bulk_to_ghost(), exch_ghosts(), fill_ghosts_phi(), get_phase_rhs_imp_ghost()