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
iso_fortran_env
(output_unit()
)fields
: 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….precision_mod
: This module controls the precision used in MagICparallel_mod
: This module contains the blocking informationconstants
(one()
): module containing constants and parameters used in the code.useful
(abortrun()
,logwrite()
): This module contains several useful routines.num_param
(solve_counter()
): Module containing numerical and control parametersmem_alloc
(memwrite()
,bytes_allocated()
): This little module is used to estimate the global memory allocation used in MagICtruncation
(l_max()
,lm_max()
,n_r_max()
,n_r_maxmag()
,n_r_ic_max()
,lm_maxmag()
): This module defines the grid points and the truncationradial_data
(nrstart()
,nrstop()
,nrstartmag()
,nrstopmag()
): This module defines the MPI decomposition in the radial direction.blocking
(lo_map()
,llm()
,ulm()
,llmmag()
,ulmmag()
,st_map()
): Module containing blocking informationlogic
(l_mag()
,l_conv()
,l_heat()
,l_single_matrix()
,l_double_curl()
,l_chemical_conv()
,l_cond_ic()
,l_onset()
,l_z10mat()
,l_parallel_solve()
,l_mag_par_solve()
,l_phase_field()
,l_update_s()
,l_update_xi()
,l_update_phi()
,l_update_v()
,l_update_b()
): Module containing the logicals that control the runtime_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.time_schemes
(type_tscheme()
): This module defines an abstract class type_tscheme which is employed for the time advance of the code.timing
(timer_type()
): This module contains functions that are used to measure the time spent.updates_mod
: This module handles the time advance of the entropy s. It contains the computation of the implicit terms and the linear solves….updatez_mod
: This module handles the time advance of the toroidal potential z It contains the computation of the implicit terms and the linear solves….updatewp_mod
: 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.updatewps_mod
: 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 linearupdateb_mod
: 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 linearupdatexi_mod
: This module handles the time advance of the chemical composition xi. It contains the computation of the implicit terms and the linear solves….updatephi_mod
: This module handles the time advance of the phase field phi. It contains the computation of the implicit terms and the linear solves….
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:
- 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:
- 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:
- 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:
- 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:
- 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]
b_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,in]
aj_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,in]
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:
- 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:
omega_ma [real ,in]
omega_ic [real ,in]
b_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,in]
aj_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,in]
dvxbh_rloc (lm_maxmag,1 - nrstartmag + nrstopmag) [complex ,inout]
lorentz_torque_ma [real ,in]
lorentz_torque_ic [real ,in]
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:
- 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:
- 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:
- 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
omp_lib
precision_mod
: This module controls the precision used in MagICmem_alloc
(bytes_allocated()
): This little module is used to estimate the global memory allocation used in MagICtruncation
(lm_max()
,n_r_max()
,l_max()
,m_min()
): This module defines the grid points and the truncationradial_data
(n_r_cmb()
,n_r_icb()
,nrstart()
,nrstop()
): This module defines the MPI decomposition in the radial direction.radial_functions
(or1()
,or2()
,rho0()
,rgrav()
,r()
,visc()
,dlvisc()
,rscheme_oc()
,beta()
,dbeta()
,dlkappa()
,dltemp0()
,ddltemp0()
,alpha0()
,dlalpha0()
,ddlalpha0()
,ogrun()
,kappa()
,orho1()
,dentropy0()
,temp0()
,l_r()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(kbotv()
,ktopv()
,ktops()
,kbots()
,ra()
,opr()
,vischeatfac()
,thexpnb()
,buofac()
,corfac()
,ktopp()
): Module containing the physical parametersspecial
(ellipticity_cmb()
,ellipticity_icb()
,ellip_fac_cmb()
,ellip_fac_icb()
): This module contains all variables for the case of an imposed IC dipole, an imposed external magnetic field and a special boundary forcing to excite inertial modesnum_param
(dct_counter()
,solve_counter()
): Module containing numerical and control parametersinit_fields
(tops()
,bots()
,omegaosz_ma1()
,tshift_ma1()
,omegaosz_ic1()
,tshift_ic1()
): This module is used to construct the initial solution.blocking
(lo_sub_map()
,lo_map()
,st_sub_map()
,llm()
,ulm()
,st_map()
): Module containing blocking informationhorizontal_data
(hdif_v()
,hdif_s()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderlogic
(l_temperature_diff()
,l_rms()
,l_full_sphere()
): Module containing the logicals that control the runrms
(difpol2hint()
,difpollmr()
): This module contains the calculation of the RMS force balance and induction terms.communications
(get_global_sum()
): This module contains the different MPI communicators used in MagIC.parallel_mod
(chunksize()
,rank()
,n_procs()
,get_openmp_blocks()
): This module contains the blocking informationradial_der
(get_dddr()
,get_ddr()
,get_dr()
,get_dr_rloc()
): Radial derivatives functionsconstants
(zero()
,one()
,two()
,three()
,four()
,third()
,half()
,pi()
,osq4pi()
): module containing constants and parameters used in the code.fields
(work_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….useful
(abortrun()
,cc2real()
): This module contains several useful routines.time_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()
): This module defines two types that are defined to store the implicit/explicit terms at the different sub-stage/step.
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:
- subroutine updatewps_mod/finalize_updatewps()¶
- Called from:
- 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:
time [real ,in]
z10 (n_r_max) [real ,in]
dwdt [type_tarray ,inout]
dpdt [type_tarray ,inout]
dsdt [type_tarray ,inout]
tscheme [real ]
lrmsnext [logical ,in]
- Called from:
- Call to:
- subroutine updatewps_mod/finish_exp_smat(dvsrlm, ds_exp_last)¶
- Parameters:
- Called from:
- Call to:
- subroutine updatewps_mod/finish_exp_smat_rdist(dvsrlm, ds_exp_last)¶
- Parameters:
- Called from:
- Call to:
- 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:
dsdt [type_tarray ,inout]
dwdt [type_tarray ,inout]
dpdt [type_tarray ,inout]
tscheme [real ]
lrmsnext [logical ,in]
- Called from:
- Call to:
- 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:
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:
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
omp_lib
precision_mod
: This module controls the precision used in MagICmem_alloc
(bytes_allocated()
): This little module is used to estimate the global memory allocation used in MagICtruncation
(lm_max()
,n_r_max()
,l_max()
,m_min()
): This module defines the grid points and the truncationradial_data
(n_r_cmb()
,n_r_icb()
,nrstart()
,nrstop()
): This module defines the MPI decomposition in the radial direction.radial_functions
(or1()
,or2()
,rho0()
,rgrav()
,visc()
,dlvisc()
,r()
,alpha0()
,temp0()
,beta()
,dbeta()
,ogrun()
,l_r()
,rscheme_oc()
,ddlvisc()
,ddbeta()
,orho1()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(kbotv()
,ktopv()
,ra()
,buofac()
,chemfac()
,vischeatfac()
,thexpnb()
,ktopp()
): Module containing the physical parametersspecial
(ellipticity_cmb()
,ellipticity_icb()
,ellip_fac_cmb()
,ellip_fac_icb()
,tide_fac20()
,tide_fac22p()
,tide_fac22n()
,omega_tide()
,amp_tide()
,l_radial_flow_bc()
): This module contains all variables for the case of an imposed IC dipole, an imposed external magnetic field and a special boundary forcing to excite inertial modesnum_param
(dct_counter()
,solve_counter()
): Module containing numerical and control parametersinit_fields
(omegaosz_ma1()
,tshift_ma1()
,omegaosz_ic1()
,tshift_ic1()
): This module is used to construct the initial solution.blocking
(lo_sub_map()
,lo_map()
,st_sub_map()
,llm()
,ulm()
,st_map()
): Module containing blocking informationhorizontal_data
(hdif_v()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderlogic
(l_chemical_conv()
,l_rms()
,l_double_curl()
,l_fluxprofs()
,l_finite_diff()
,l_full_sphere()
,l_heat()
,l_parallel_solve()
): Module containing the logicals that control the runrms
(difpol2hint()
,difpollmr()
): This module contains the calculation of the RMS force balance and induction terms.communications
(get_global_sum()
): This module contains the different MPI communicators used in MagIC.parallel_mod
: This module contains the blocking informationradial_der
(get_dddr()
,get_ddr()
,get_dr()
,get_dr_rloc()
,get_ddddr_ghost()
,bulk_to_ghost()
,exch_ghosts()
): Radial derivatives functionsintegration
(rint_r()
): Radial and geostrophic integration functionsfields
(work_lmloc()
,s_rloc()
,xi_rloc()
): 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….constants
(zero()
,one()
,two()
,three()
,four()
,third()
,half()
): module containing constants and parameters used in the code.useful
(abortrun()
,cc2real()
): This module contains several useful routines.time_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()
): This module defines two types that are defined to store the implicit/explicit terms at the different sub-stage/step.parallel_solvers
: This module contains the routines that are used to solve linear banded problems with R-distributed arrays.
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:
- 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:
- 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:
time [real ,in]
dwdt [type_tarray ,inout]
dpdt [type_tarray ,inout]
tscheme [real ]
lrmsnext [logical ,in]
lpressnext [logical ,in]
- Called from:
- Call to:
- subroutine updatewp_mod/preparew_fd(time, tscheme, dwdt, lpressnext)¶
- Parameters:
time [real ,in]
tscheme [real ]
dwdt [type_tarray ,inout]
lpressnext [logical ,in]
- Called from:
- Call to:
- subroutine updatewp_mod/fill_ghosts_w(wg, p0g, lpressnext)¶
This subroutine is used to fill the ghost zones.
- Parameters:
- Called from:
- Call to:
- 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:
- Call to:
- subroutine updatewp_mod/finish_exp_pol(dvxvhlm, dw_exp_last)¶
- Parameters:
- Called from:
- Call to:
- subroutine updatewp_mod/finish_exp_pol_rdist(dvxvhlm, dw_exp_last)¶
- Parameters:
- Called from:
- Call to:
- 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:
dwdt [type_tarray ,inout]
dpdt [type_tarray ,inout]
tscheme [real ]
istage [integer ,in]
l_calc_lin [logical ,in]
lpressnext [logical ,in]
lrmsnext [logical ,in]
- Options:
l_in_cheb_space [logical ,in,]
- Called from:
readstartfields_old()
,readstartfields()
,readstartfields_mpi()
,getstartfields()
,updatewp()
- Call to:
- 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:
dwdt [type_tarray ,inout]
tscheme [real ]
istage [integer ,in]
l_calc_lin [logical ,in]
lpressnext [logical ,in]
lrmsnext [logical ,in]
- Called from:
- Call to:
- 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:
dwdt [type_tarray ,inout]
dpdt [type_tarray ,inout]
tscheme [real ]
lpressnext [logical ,in]
lrmsnext [logical ,in]
- Called from:
- Call to:
- 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:
block_sze [integer ,in]
nblocks [integer ,in]
dwdt [type_tarray ,inout]
tscheme [real ]
lpressnext [logical ,in]
lrmsnext [logical ,in]
- Called from:
- Call to:
get_openmp_blocks()
,abortrun()
,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
init_fields
: This module is used to construct the initial solution.omp_lib
precision_mod
: This module controls the precision used in MagICcommunications
(allgather_from_rloc()
): This module contains the different MPI communicators used in MagIC.mem_alloc
(bytes_allocated()
): This little module is used to estimate the global memory allocation used in MagICtruncation
(n_r_max()
,lm_max()
,l_max()
,m_min()
): This module defines the grid points and the truncationradial_data
(n_r_cmb()
,n_r_icb()
,nrstart()
,nrstop()
): This module defines the MPI decomposition in the radial direction.radial_functions
(visc()
,or1()
,or2()
,rscheme_oc()
,dlvisc()
,beta()
,rho0()
,r_icb()
,r_cmb()
,r()
,dbeta()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(kbotv()
,ktopv()
,prec_angle()
,po()
,oek()
,gammatau_gravi()
): Module containing the physical parametersnum_param
(amstart()
,dct_counter()
,solve_counter()
): Module containing numerical and control parameterstorsional_oscillations
(ddzasl()
): This module contains information for TO calculation and outputblocking
(lo_sub_map()
,lo_map()
,st_sub_map()
,llm()
,ulm()
,st_map()
): Module containing blocking informationhorizontal_data
(hdif_v()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderlogic
(l_rot_ma()
,l_rot_ic()
,l_srma()
,l_sric()
,l_z10mat()
,l_precession()
,l_correct_ame()
,l_correct_amz()
,l_parallel_solve()
,l_to()
,l_finite_diff()
,l_full_sphere()
): Module containing the logicals that control the runconstants
(c_lorentz_ma()
,c_lorentz_ic()
,c_dt_z10_ma()
,c_dt_z10_ic()
,c_moi_ma()
,c_moi_ic()
,c_z10_omega_ma()
,c_z10_omega_ic()
,c_moi_oc()
,y10_norm()
,y11_norm()
,zero()
,one()
,two()
,four()
,pi()
,third()
): module containing constants and parameters used in the code.parallel_mod
: This module contains the blocking informationoutrot
(get_angular_moment()
,get_angular_moment_rloc()
): This module handles the writing of several diagnostic files related to the rotation: angular momentum (AM.TAG), drift (drift.TAG), inner core and mantle rotations….rms
(diftor2hint()
): This module contains the calculation of the RMS force balance and induction terms.radial_der
(get_ddr()
,get_ddr_ghost()
,bulk_to_ghost()
,exch_ghosts()
): Radial derivatives functionsfields
(work_lmloc()
,bodyforce_lmloc()
,bodyforce_rloc()
): 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….useful
(abortrun()
,cc2real()
): This module contains several useful routines.time_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.special
: This module contains all variables for the case of an imposed IC dipole, an imposed external magnetic field and a special boundary forcing to excite inertial modesparallel_solvers
: This module contains the routines that are used to solve linear banded problems with R-distributed arrays.
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:
- subroutine updatez_mod/finalize_updatez()¶
Memory deallocation of arrays associated with time advance of Z
- Called from:
- 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:
- Call to:
- 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:
- Call to:
- 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:
- Called from:
- Call to:
- 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:
- Call to:
- 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]
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:
- 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]
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:
- Call to:
- 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]
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:
- Call to:
- 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]
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:
- Call to:
abortrun()
,get_openmp_blocks()
,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:
- 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
omp_lib
precision_mod
: This module controls the precision used in MagICmem_alloc
(bytes_allocated()
): This little module is used to estimate the global memory allocation used in MagICtruncation
(n_r_max()
,lm_max()
,l_max()
): This module defines the grid points and the truncationradial_data
(n_r_cmb()
,n_r_icb()
,nrstart()
,nrstop()
): This module defines the MPI decomposition in the radial direction.radial_functions
(orho1()
,or1()
,or2()
,beta()
,dentropy0()
,rscheme_oc()
,kappa()
,dlkappa()
,dltemp0()
,temp0()
,r()
,l_r()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(opr()
,kbots()
,ktops()
,stef()
): Module containing the physical parametersnum_param
(dct_counter()
,solve_counter()
): Module containing numerical and control parametersinit_fields
(tops()
,bots()
): This module is used to construct the initial solution.blocking
(lo_map()
,lo_sub_map()
,llm()
,ulm()
,st_map()
): Module containing blocking informationhorizontal_data
(hdif_s()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderlogic
(l_anelastic_liquid()
,l_finite_diff()
,l_phase_field()
,l_full_sphere()
,l_parallel_solve()
): Module containing the logicals that control the runparallel_mod
: This module contains the blocking informationradial_der
(get_ddr()
,get_dr()
,get_dr_rloc()
,get_ddr_ghost()
,exch_ghosts()
,bulk_to_ghost()
): Radial derivatives functionsfields
(work_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….constants
(zero()
,one()
,two()
): module containing constants and parameters used in the code.useful
(abortrun()
): This module contains several useful routines.time_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()
): This module defines two types that are defined to store the implicit/explicit terms at the different sub-stage/step.parallel_solvers
(type_tri_par()
): This module contains the routines that are used to solve linear banded problems with R-distributed arrays.
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:
- subroutine updates_mod/finalize_updates()¶
Memory deallocation of updateS module
- Called from:
- subroutine updates_mod/updates(s, ds, dsdt, phi, tscheme)¶
Updates the entropy field s and its radial derivative.
- 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:
- Call to:
- 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:
- Called from:
- Call to:
- 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:
- Call to:
- 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).
- 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).
- 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:
- Options:
l_in_cheb_space [logical ,in,]
- Called from:
readstartfields_old()
,readstartfields()
,readstartfields_mpi()
,getstartfields()
,updates()
,assemble_entropy()
- Call to:
- 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:
- Call to:
- 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:
- Call to:
get_openmp_blocks()
,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.
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
omp_lib
precision_mod
: This module controls the precision used in MagICtruncation
(n_r_max()
,lm_max()
,l_max()
): This module defines the grid points and the truncationradial_data
(n_r_icb()
,n_r_cmb()
,nrstart()
,nrstop()
): This module defines the MPI decomposition in the radial direction.radial_functions
(orho1()
,or1()
,or2()
,beta()
,rscheme_oc()
,r()
,dxicond()
,l_r()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(osc()
,kbotxi()
,ktopxi()
): Module containing the physical parametersnum_param
(dct_counter()
,solve_counter()
): Module containing numerical and control parametersinit_fields
(topxi()
,botxi()
): This module is used to construct the initial solution.blocking
(lo_map()
,lo_sub_map()
,llm()
,ulm()
,st_map()
): Module containing blocking informationhorizontal_data
(hdif_xi()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderlogic
(l_finite_diff()
,l_full_sphere()
,l_parallel_solve()
,l_onset()
): Module containing the logicals that control the runparallel_mod
(rank()
,chunksize()
,n_procs()
,get_openmp_blocks()
): This module contains the blocking informationradial_der
(get_ddr()
,get_dr()
,get_dr_rloc()
,get_ddr_ghost()
,exch_ghosts()
,bulk_to_ghost()
): Radial derivatives functionsconstants
(zero()
,one()
,two()
): module containing constants and parameters used in the code.fields
(work_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….mem_alloc
(bytes_allocated()
): This little module is used to estimate the global memory allocation used in MagICuseful
(abortrun()
): This module contains several useful routines.time_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()
): This module defines two types that are defined to store the implicit/explicit terms at the different sub-stage/step.parallel_solvers
(type_tri_par()
): This module contains the routines that are used to solve linear banded problems with R-distributed arrays.
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:
- subroutine updatexi_mod/finalize_updatexi()¶
This subroutine deallocates the matrices involved in the time-advance of xi.
- Called from:
- subroutine updatexi_mod/updatexi(xi, dxi, dxidt, tscheme)¶
Updates the chemical composition field s and its radial derivative.
- 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:
- Call to:
- 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:
- Called from:
- Call to:
- 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:
- Called from:
- Call to:
- 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.
- 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.
- 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:
- Options:
l_in_cheb_space [logical ,in,]
- Called from:
readstartfields_old()
,readstartfields()
,readstartfields_mpi()
,getstartfields()
,updatexi()
,assemble_comp()
- Call to:
- 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:
- Called from:
- Call to:
- 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:
- Called from:
- Call to:
- 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:
- Call to:
get_openmp_blocks()
,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
omp_lib
precision_mod
: This module controls the precision used in MagICparallel_mod
: This module contains the blocking informationmem_alloc
(bytes_allocated()
): This little module is used to estimate the global memory allocation used in MagICtruncation
(n_r_max()
,n_r_tot()
,n_r_ic_max()
,n_cheb_ic_max()
,n_r_ic_maxmag()
,n_r_maxmag()
,n_r_totmag()
,lm_max()
,l_maxmag()
,lm_maxmag()
): This module defines the grid points and the truncationradial_functions
(chebt_ic()
,or2()
,r_cmb()
,chebt_ic_even()
,d2cheb_ic()
,l_r()
,cheb_norm_ic()
,dr_fac_ic()
,lambda()
,dllambda()
,o_r_ic()
,r()
,or1()
,cheb_ic()
,dcheb_ic()
,rscheme_oc()
,dr_top_ic()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)radial_data
(n_r_cmb()
,n_r_icb()
,nrstartmag()
,nrstopmag()
): This module defines the MPI decomposition in the radial direction.physical_parameters
(n_r_lcr()
,opm()
,o_sr()
,kbotb()
,imagcon()
,tmagcon()
,sigma_ratio()
,conductance_ma()
,ktopb()
,ktopv()
): Module containing the physical parametersinit_fields
(bpeaktop()
,bpeakbot()
): This module is used to construct the initial solution.num_param
(solve_counter()
,dct_counter()
): Module containing numerical and control parametersblocking
(st_map()
,lo_map()
,st_sub_map()
,lo_sub_map()
,llmmag()
,ulmmag()
): Module containing blocking informationhorizontal_data
(hdif_b()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderlogic
(l_cond_ic()
,l_lcr()
,l_rot_ic()
,l_mag_nl()
,l_b_nl_icb()
,l_b_nl_cmb()
,l_cond_ma()
,l_rms()
,l_finite_diff()
,l_full_sphere()
,l_mag_par_solve()
): Module containing the logicals that control the runrms
(dtbpollmr()
,dtbpol2hint()
,dtbtor2hint()
): This module contains the calculation of the RMS force balance and induction terms.constants
(pi()
,zero()
,one()
,two()
,three()
,half()
): module containing constants and parameters used in the code.special
(n_imp()
,l_imp()
,amp_imp()
,expo_imp()
,bmax_imp()
,rrmp()
,l_curr()
,amp_curr()
,fac_loop()
): This module contains all variables for the case of an imposed IC dipole, an imposed external magnetic field and a special boundary forcing to excite inertial modesfields
(work_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….radial_der
(get_dr()
,get_ddr()
,get_dr_rloc()
,get_ddr_ghost()
,exch_ghosts()
,bulk_to_ghost()
): Radial derivatives functionsuseful
(abortrun()
,cc2real()
): This module contains several useful routines.time_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()
): This module defines two types that are defined to store the implicit/explicit terms at the different sub-stage/step.bordered_matrices
parallel_solvers
(type_tri_par()
): This module contains the routines that are used to solve linear banded problems with R-distributed arrays.
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:
- subroutine updateb_mod/finalize_updateb()¶
This subroutine deallocates the matrices involved in the time advance of the magnetic field.
- Called from:
- 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:
b (1 - llmmag + ulmmag,n_r_maxmag) [complex ,inout]
db (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
ddb (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
aj (1 - llmmag + ulmmag,n_r_maxmag) [complex ,inout]
dj (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
ddj (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
dbdt [type_tarray ,inout]
djdt [type_tarray ,inout]
b_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,inout]
db_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,out]
ddb_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,out]
aj_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,inout]
dj_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,out]
ddj_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,out]
dbdt_ic [type_tarray ,inout]
djdt_ic [type_tarray ,inout]
b_nl_cmb (*) [complex ,in] :: nonlinear BC for b at CMB
aj_nl_cmb (*) [complex ,in] :: nonlinear BC for aj at CMB
aj_nl_icb (*) [complex ,in] :: nonlinear BC for dr aj at ICB
time [real ,in]
tscheme [real ]
lrmsnext [logical ,in]
- Called from:
- Call to:
- 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:
- Call to:
- 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:
bg (lm_max,3 - nrstartmag + nrstopmag) [complex ,inout]
ajg (lm_max,3 - nrstartmag + nrstopmag) [complex ,inout]
- Called from:
- Call to:
- 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:
b (lm_max,1 - nrstartmag + nrstopmag) [complex ,inout]
db (lm_max,1 - nrstartmag + nrstopmag) [complex ,out]
ddb (lm_max,1 - nrstartmag + nrstopmag) [complex ,out]
aj (lm_max,1 - nrstartmag + nrstopmag) [complex ,inout]
dj (lm_max,1 - nrstartmag + nrstopmag) [complex ,out]
ddj (lm_max,1 - nrstartmag + nrstopmag) [complex ,out]
dbdt [type_tarray ,inout]
djdt [type_tarray ,inout]
tscheme [real ]
lrmsnext [logical ,in]
- Called from:
- Call to:
- 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:
b_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,in]
aj_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,in]
omega_ic [real ,in]
db_exp_last (1 - llmmag + ulmmag,n_r_ic_max) [complex ,inout]
dj_exp_last (1 - llmmag + ulmmag,n_r_ic_max) [complex ,inout]
- 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:
dvxbhlm (1 - llmmag + ulmmag,n_r_maxmag) [complex ,inout]
dj_exp_last (1 - llmmag + ulmmag,n_r_maxmag) [complex ,inout]
- Called from:
- Call to:
- 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:
dvxbhlm (lm_max,1 - nrstartmag + nrstopmag) [complex ,inout]
dj_exp_last (lm_max,1 - nrstartmag + nrstopmag) [complex ,inout]
- Called from:
- Call to:
- 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:
b_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,inout]
db_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,out]
ddb_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,out]
aj_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,inout]
dj_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,out]
ddj_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,out]
dbdt_ic [type_tarray ,inout]
djdt_ic [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()
,updateb()
,assemble_mag()
- Call to:
- 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:
b (1 - llmmag + ulmmag,n_r_maxmag) [complex ,inout]
db (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
ddb (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
aj (1 - llmmag + ulmmag,n_r_maxmag) [complex ,inout]
dj (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
ddj (1 - llmmag + ulmmag,n_r_maxmag) [complex ,out]
b_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,inout]
db_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,out]
ddb_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,out]
aj_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,inout]
dj_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,out]
ddj_ic (1 - llmmag + ulmmag,n_r_ic_max) [complex ,out]
dbdt [type_tarray ,inout]
djdt [type_tarray ,inout]
dbdt_ic [type_tarray ,inout]
djdt_ic [type_tarray ,inout]
lrmsnext [logical ,in]
tscheme [real ]
- Called from:
- Call to:
- 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:
b (lm_maxmag,1 - nrstartmag + nrstopmag) [complex ,inout]
db (lm_maxmag,1 - nrstartmag + nrstopmag) [complex ,out]
ddb (lm_maxmag,1 - nrstartmag + nrstopmag) [complex ,out]
aj (lm_maxmag,1 - nrstartmag + nrstopmag) [complex ,inout]
dj (lm_maxmag,1 - nrstartmag + nrstopmag) [complex ,out]
ddj (lm_maxmag,1 - nrstartmag + nrstopmag) [complex ,out]
dbdt [type_tarray ,inout]
djdt [type_tarray ,inout]
lrmsnext [logical ,in]
tscheme [real ]
- Called from:
- Call to:
abortrun()
,get_openmp_blocks()
,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:
dbdt [type_tarray ,inout]
djdt [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()
,updateb()
,assemble_mag()
- Call to:
- 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:
bg (lm_max,3 - nrstartmag + nrstopmag) [complex ,inout]
db (lm_max,1 - nrstartmag + nrstopmag) [complex ,out]
ddb (lm_max,1 - nrstartmag + nrstopmag) [complex ,out]
ajg (lm_max,3 - nrstartmag + nrstopmag) [complex ,inout]
dj (lm_max,1 - nrstartmag + nrstopmag) [complex ,out]
ddj (lm_max,1 - nrstartmag + nrstopmag) [complex ,out]
dbdt [type_tarray ,inout]
djdt [type_tarray ,inout]
tscheme [real ]
istage [integer ,in]
l_calc_lin [logical ,in]
lrmsnext [logical ,in]
- Called from:
- Call to:
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
omp_lib
precision_mod
: This module controls the precision used in MagICtruncation
(n_r_max()
,lm_max()
,l_max()
): This module defines the grid points and the truncationradial_data
(n_r_icb()
,n_r_cmb()
,nrstart()
,nrstop()
): This module defines the MPI decomposition in the radial direction.radial_functions
(or2()
,rscheme_oc()
,r()
,or1()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)num_param
(dct_counter()
,solve_counter()
): Module containing numerical and control parametersphysical_parameters
(pr()
,phasedifffac()
,stef()
,ktopphi()
,kbotphi()
): Module containing the physical parametersinit_fields
(phi_top()
,phi_bot()
): This module is used to construct the initial solution.blocking
(lo_map()
,lo_sub_map()
,llm()
,ulm()
,st_map()
): Module containing blocking informationlogic
(l_finite_diff()
,l_full_sphere()
,l_parallel_solve()
): Module containing the logicals that control the runparallel_mod
(rank()
,chunksize()
,n_procs()
,get_openmp_blocks()
): This module contains the blocking informationradial_der
(get_ddr()
,get_ddr_ghost()
,exch_ghosts()
,bulk_to_ghost()
): Radial derivatives functionsconstants
(zero()
,one()
,two()
): module containing constants and parameters used in the code.fields
(work_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….mem_alloc
(bytes_allocated()
): This little module is used to estimate the global memory allocation used in MagICuseful
(abortrun()
): This module contains several useful routines.time_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()
): This module defines two types that are defined to store the implicit/explicit terms at the different sub-stage/step.parallel_solvers
(type_tri_par()
): This module contains the routines that are used to solve linear banded problems with R-distributed arrays.
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:
- subroutine updatephi_mod/finalize_updatephi()¶
This subroutine deallocates the matrices involved in the time-advance of phi.
- Called from:
- subroutine updatephi_mod/updatephi(phi, dphidt, tscheme)¶
Updates the phase field
- Parameters:
- Called from:
- Call to:
- 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:
- Call to:
- 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:
- Called from:
- Call to:
- 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:
- Called from:
- Call to:
- 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:
- Options:
l_in_cheb_space [logical ,in,]
- Called from:
- Call to:
- 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:
- Called from:
- Call to:
- 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:
- Called from:
- Call to:
- 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:
- Called from:
- Call to:
get_openmp_blocks()
,fill_ghosts_phi()
,get_phase_rhs_imp_ghost()