IO: time series, radial profiles and spectra¶
output.f90
¶
Description
This module handles the calls to the different output routines.
Quick access
- Variables
cmb_file
,cmbmov_file
,dipcmbmean
,dipmean
,dlbmean
,dlvcmean
,dlvmean
,dmbmean
,dmvmean
,dpvmean
,dt_cmb_file
,dte_file
,dteint
,dzvmean
,e_kin_pmean
,e_kin_tmean
,e_mag_pmean
,e_mag_tmean
,elcmbmean
,elmean
,etot
,etotold
,geosamean
,geosmean
,geosmmean
,geosnapmean
,geoszmean
,lbdissmean
,lvdissmean
,n_cmb_file
,n_cmb_setsmov
,n_cmbmov_file
,n_dt_cmb_file
,n_dt_cmb_sets
,n_dte_file
,n_e_sets
,n_par_file
,n_spec
,nlogs
,npotsets
,nrms_sets
,par_file
,rela
,relm
,relna
,relz
,rmmean
,rolmean
,timenormlog
,timenormrms
,timepassedlog
,timepassedrms
- Routines
Needed modules
iso_fortran_env
(output_unit()
)precision_mod
: This module controls the precision used in MagICparallel_mod
: This module contains the blocking informationtruncation
(n_r_max()
,n_r_ic_max()
,minc()
,l_max()
,l_maxmag()
,n_r_maxmag()
,lm_max()
): This module defines the grid points and the truncationradial_functions
(or1()
,or2()
,r()
,rscheme_oc()
,r_cmb()
,r_icb()
,orho1()
,sigma()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)radial_data
(nrstart()
,nrstop()
,nrstartmag()
,nrstopmag()
,n_r_cmb()
,n_r_icb()
): This module defines the MPI decomposition in the radial direction.physical_parameters
(opm()
,ek()
,ktopv()
,prmag()
,nvarcond()
,lffac()
,ekscaled()
): Module containing the physical parametersnum_param
(tscale()
,escale()
): Module containing numerical and control parametersblocking
(st_map()
,lm2()
,lo_map()
,llm()
,ulm()
,llmmag()
,ulmmag()
): Module containing blocking informationhorizontal_data
(hdif_b()
,dpl0eq()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderlogic
(l_average()
,l_mag()
,l_power()
,l_anel()
,l_mag_lf()
,lverbose()
,l_dtb()
,l_rms()
,l_r_field()
,l_r_fieldt()
,l_r_fieldxi()
,l_sric()
,l_cond_ic()
,l_rmagspec()
,l_movie_ic()
,l_store_frame()
,l_cmb_field()
,l_dt_cmb_field()
,l_save_out()
,l_non_rot()
,l_perppar()
,l_energy_modes()
,l_heat()
,l_hel()
,l_par()
,l_chemical_conv()
,l_movie()
,l_full_sphere()
,l_spec_avg()
,l_phase_field()
,l_hemi()
): Module containing the logicals that control the runfields
(omega_ic()
,omega_ma()
,b_ic()
,db_ic()
,ddb_ic()
,aj_ic()
,dj_ic()
,w_lmloc()
,dw_lmloc()
,ddw_lmloc()
,p_lmloc()
,xi_lmloc()
,s_lmloc()
,ds_lmloc()
,z_lmloc()
,dz_lmloc()
,b_lmloc()
,db_lmloc()
,ddb_lmloc()
,aj_lmloc()
,dj_lmloc()
,ddj_lmloc()
,b_ic_lmloc()
,db_ic_lmloc()
,ddb_ic_lmloc()
,aj_ic_lmloc()
,dj_ic_lmloc()
,ddj_ic_lmloc()
,dp_lmloc()
,dxi_lmloc()
,w_rloc()
,z_rloc()
,p_rloc()
,s_rloc()
,xi_rloc()
,b_rloc()
,aj_rloc()
,bicb()
,phi_rloc()
,phi_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….fieldslast
(dwdt()
,dzdt()
,dpdt()
,dsdt()
,dbdt()
,djdt()
,dbdt_ic()
,dphidt()
,djdt_ic()
,dxidt()
,domega_ic_dt()
,domega_ma_dt()
,lorentz_torque_ma_dt()
,lorentz_torque_ic_dt()
): This module contains all the work arrays of the previous time-steps needed to time advance the code. They are needed in the time-stepping scheme….kinetic_energy
(get_e_kin()
,get_u_square()
): This module handles the computation of kinetic energy and the time-averaged radial profiles.magnetic_energy
(get_e_mag()
): This module handles the computation and the writing of the diagnostic files related to magnetic energy: e_mag_oc.TAG, e_mag_ic.TAG, dipole.TAG, eMagR.TAGfields_average_mod
(fields_average()
): This module is used when one wants to store time-averaged quantitiesspectra
(spectrum()
,get_amplitude()
): This module handles the computation and the writing of spectra. It handles both 2-D spectra in (r,l) and (r,m) spaces and usual spectra integrated over all radii in (l) or (m) spaces….outto_mod
(outto()
): This module handles the writing of TO-related outputs: zonal force balance and z-integrated terms. This is a re-implementation of the spectral method used up to MagIC 5.10, which formerly relies on calculation of Plm on the cylindrical grid….output_data
(tag()
,l_max_cmb()
,n_log_file()
,log_file()
): This module contains the parameters for output controlconstants
(vol_oc()
,vol_ic()
,mass()
,surf_cmb()
,two()
,three()
,zero()
): module containing constants and parameters used in the code.outmisc_mod
(outheat()
,outhelicity()
,outhemi()
,outphase()
,get_onset()
): This module contains several subroutines that can compute and store various informations: helicity (helicity.TAG), heat transfer (heat.TAG), phase field (phase.TAG) and North/South hemisphericity of energies (hemi.TAG)geos
(outgeos()
,outomega()
): This module is used to compute z-integrated diagnostics such as the degree of geostrophy or the separation of energies between inside and outside the tangent cylinder. This makes use of a local Simpson’s method. This alsooutrot
(write_rot()
): 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….integration
(rint_r()
): Radial integration functionsoutpar_mod
(outpar()
,outperppar()
): This module is used to compute several time-averaged radial profiles: fluxes, boundary layers, etc.graphout_mod
(graphout_ic()
): This module contains the subroutines that store the 3-D graphic files.power
(get_power()
): This module handles the writing of the power budgetcommunications
(gather_all_from_lo_to_rank0()
,gt_oc()
,gt_ic()
,gather_from_lo_to_rank0()
): This module contains the different MPI communicators used in MagIC.out_coeff
(write_pot_mpi()
): This module contains the subroutines that calculate the Bcmb files, the [B|V|T]_coeff_r files and the [B|V|T]_lmr filesgetdlm_mod
(getdlm()
): This module is used to calculate the lengthscales. It computes both the integral lengthscale and the peak of the poloidal energy. It also stores the radial profiles of these lengthscales….dtb_mod
(get_dtblmfinish()
): This module contains magnetic field stretching and advection terms plus a separate omega-effect. It is used for movie output….rms
(zerorms()
,dtvrms()
,dtbrms()
): This module contains the calculation of the RMS force balance and induction terms.useful
(logwrite()
): 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.storecheckpoints
: This module contains several subroutines that can be used to store the checkpoint_#.tag files
Variables
-
output_mod/
cmb_file
[character(len=72),private]¶
-
-
output_mod/
cmbmov_file
[character(len=72),private]¶
-
-
output_mod/
dipcmbmean
[real,private]¶
-
-
output_mod/
dipmean
[real,private]¶
-
-
output_mod/
dlbmean
[real,private]¶
-
-
output_mod/
dlvcmean
[real,private]¶
-
-
output_mod/
dlvmean
[real,private]¶
-
-
output_mod/
dmbmean
[real,private]¶
-
-
output_mod/
dmvmean
[real,private]¶
-
-
output_mod/
dpvmean
[real,private]¶
-
-
output_mod/
dt_cmb_file
[character(len=72),private]¶
-
-
output_mod/
dte_file
[character(len=72),private]¶
-
-
output_mod/
dteint
[real,private]¶
-
-
output_mod/
dzvmean
[real,private]¶
-
-
output_mod/
e_kin_pmean
[real,private]¶
-
-
output_mod/
e_kin_tmean
[real,private]¶
-
-
output_mod/
e_mag_pmean
[real,private]¶
-
-
output_mod/
e_mag_tmean
[real,private]¶
-
-
output_mod/
elcmbmean
[real,private]¶
-
-
output_mod/
elmean
[real,private]¶
-
-
output_mod/
etot
[real,private]¶
-
-
output_mod/
etotold
[real,private]¶
-
-
output_mod/
geosamean
[real,private]¶
-
-
output_mod/
geosmean
[real,private]¶
-
-
output_mod/
geosmmean
[real,private]¶
-
-
output_mod/
geosnapmean
[real,private]¶
-
-
output_mod/
geoszmean
[real,private]¶
-
-
output_mod/
lbdissmean
[real,private]¶
-
-
output_mod/
lvdissmean
[real,private]¶
-
-
output_mod/
n_cmb_file
[integer,private]¶
-
-
output_mod/
n_cmb_setsmov
[integer,private]¶
-
-
output_mod/
n_cmbmov_file
[integer,private]¶
-
-
output_mod/
n_dt_cmb_file
[integer,private]¶
-
-
output_mod/
n_dt_cmb_sets
[integer,private]¶
-
-
output_mod/
n_dte_file
[integer,private]¶
-
-
output_mod/
n_e_sets
[integer,private]¶
-
-
output_mod/
n_par_file
[integer,private]¶
-
-
output_mod/
n_spec
[integer,private]¶
-
-
output_mod/
nlogs
[integer,private]¶
-
-
output_mod/
npotsets
[integer,private]¶
-
-
output_mod/
nrms_sets
[integer,private]¶
-
-
output_mod/
par_file
[character(len=72),private]¶
-
-
output_mod/
rela
[real,private]¶
-
-
output_mod/
relm
[real,private]¶
-
-
output_mod/
relna
[real,private]¶
-
-
output_mod/
relz
[real,private]¶
-
-
output_mod/
rmmean
[real,private]¶
-
-
output_mod/
rolmean
[real,private]¶
-
-
output_mod/
timenormlog
[real,private]¶
-
-
output_mod/
timenormrms
[real,private]¶
-
-
output_mod/
timepassedlog
[real,private]¶
-
-
output_mod/
timepassedrms
[real,private]¶
-
Subroutines and functions
-
subroutine
output_mod/
initialize_output
()¶ - Called from
- Call to
-
subroutine
output_mod/
finalize_output
()¶ - Called from
- Call to
-
subroutine
output_mod/
output
(time, tscheme, n_time_step, l_stop_time, l_pot, l_log, l_graph, lrmscalc, l_store, l_new_rst_file, lonsetcalc, l_spectrum, ltocalc, ltoframe, l_frame, n_frame, l_cmb, n_cmb_sets, l_r, lorentz_torque_ic, lorentz_torque_ma, dbdt_cmb_lmloc)¶ This subroutine controls most of the output.
- Parameters
time [real ,in] :: Rm (Re) :”,RmMean, &
tscheme [real ]
n_time_step [integer ,in]
l_stop_time [logical ,in]
l_pot [logical ,in]
l_log [logical ,in]
l_graph [logical ,in]
lrmscalc [logical ,in]
l_store [logical ,in]
l_new_rst_file [logical ,in]
lonsetcalc [logical ,in]
l_spectrum [logical ,in]
ltocalc [logical ,in]
ltoframe [logical ,in]
l_frame [logical ,in]
n_frame [integer ,inout]
l_cmb [logical ,in]
n_cmb_sets [integer ,inout]
l_r [logical ,in]
lorentz_torque_ic [real ,in]
lorentz_torque_ma [real ,in]
- Called from
- Call to
write_rot()
,get_e_kin()
,get_e_mag()
,get_amplitude()
,spectrum()
,fields_average()
,get_power()
,get_u_square()
,getdlm()
,outpar()
,outperppar()
,outheat()
,outhelicity()
,outhemi()
,outphase()
,outgeos()
,outto()
,get_dtblmfinish()
,get_onset()
,zerorms()
,dtvrms()
,dtbrms()
,write_bcmb()
,write_coeffs()
,write_pot_mpi()
,rbrspec()
,rbpspec()
,store_mpi()
,gather_from_lo_to_rank0()
,gather_all_from_lo_to_rank0()
,movie_gather_frames_to_rank0()
,store_movie_frame_ic()
,logwrite()
,write_movie_frame()
,graphout_ic()
,rint_r()
,outomega()
kinetic_energy.f90
¶
Description
This module handles the computation of kinetic energy and the time-averaged radial profiles.
Quick access
- Variables
- Routines
finalize_kinetic_energy()
,get_e_kin()
,get_u_square()
,initialize_kinetic_energy()
Needed modules
parallel_mod
: This module contains the blocking informationprecision_mod
: This module controls the precision used in MagICieee_arithmetic
(ieee_is_nan()
)mem_alloc
(bytes_allocated()
): This little module is used to estimate the global memory allocation used in MagICcommunications
(reduce_radial()
): This module contains the different MPI communicators used in MagIC.truncation
(n_r_max()
,l_max()
): This module defines the grid points and the truncationradial_functions
(r()
,or1()
,rscheme_oc()
,or2()
,r_cmb()
,r_icb()
,orho1()
,orho2()
,sigma()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(prmag()
,ek()
,nvarcond()
): Module containing the physical parametersnum_param
(tscale()
,escale()
): Module containing numerical and control parametersblocking
(lo_map()
,llm()
,ulm()
): Module containing blocking informationlogic
(l_save_out()
,l_non_rot()
,l_anel()
,l_mag()
): Module containing the logicals that control the runoutput_data
(tag()
): This module contains the parameters for output controlconstants
(pi()
,vol_oc()
,one()
,two()
,three()
,half()
,four()
,osq4pi()
): module containing constants and parameters used in the code.integration
(rint_r()
): Radial integration functionsuseful
(cc2real()
,abortrun()
): This module contains several useful routines.
Variables
-
kinetic_energy/
e_kin_file
[character(len=72),private]¶
-
-
kinetic_energy/
e_p_asa
(*) [real,private/allocatable]¶
-
-
kinetic_energy/
e_pa
(*) [real,private/allocatable]¶
-
-
kinetic_energy/
e_t_asa
(*) [real,private/allocatable]¶
-
-
kinetic_energy/
e_ta
(*) [real,private/allocatable]¶
-
-
kinetic_energy/
n_e_kin_file
[integer,private]¶
-
-
kinetic_energy/
n_u_square_file
[integer,private]¶
-
-
kinetic_energy/
u_square_file
[character(len=72),private]¶
-
Subroutines and functions
-
subroutine
kinetic_energy/
get_e_kin
(time, l_write, l_stop_time, n_e_sets, w, dw, z, e_p, e_t, e_p_as, e_t_as[, ekinr])¶ Calculates kinetic energy = 1/2 Integral (v^2 dV). Integration in theta,phi is handled by summation of spherical harmonics Integration in r by using Chebyshev integrals or Simpson rules if FD are used.
- Parameters
time [real ,in] :: Current time
l_write [logical ,in] :: Switch to write output
l_stop_time [logical ,in] :: Indicates when last time step of the run is reached for radial output
n_e_sets [integer ,in] :: Switch for time-average and to determine first time step
w (ulm-(llm)+1,n_r_max) [complex ,in] :: Array containing kinetic field poloidal potential
dw (ulm-(llm)+1,n_r_max) [complex ,in] :: Array containing radial derivative of w
z (ulm-(llm)+1,n_r_max) [complex ,in] :: Array containing kinetic field toroidal potential
e_p [real ,out] :: poloidal energy
e_t [real ,out] :: toroidal energy
e_p_as [real ,out] :: axisymmetric poloidal energy
e_t_as [real ,out] :: 1,2,3,4,5
- Options
ekinr (n_r_max) [real ,out,] :: Radial profile of kinetic energy
- Called from
- Call to
-
subroutine
kinetic_energy/
get_u_square
(time, w, dw, z, rolr)¶ Calculates square velocity = 1/2 Integral (v^2 dV) Writes the different contributions in u_square.TAG file
- Parameters
time [real ,in] :: 1,2,3, 4,5
w (ulm-(llm)+1,n_r_max) [complex ,in] :: Array containing kinetic field poloidal potential
dw (ulm-(llm)+1,n_r_max) [complex ,in] :: Array containing radial derivative of w
z (ulm-(llm)+1,n_r_max) [complex ,in] :: Array containing kinetic field toroidal potential
rolr (n_r_max) [real ,out] :: local Rossby number
- Called from
- Call to
magnetic_energy.f90
¶
Description
This module handles the computation and the writing of the diagnostic files related to magnetic energy: e_mag_oc.TAG, e_mag_ic.TAG, dipole.TAG, eMagR.TAG
Quick access
- Variables
bcmb
,dipole_file
,e_dipa
,e_mag_ic_file
,e_mag_oc_file
,e_p_asa
,e_pa
,e_t_asa
,e_ta
,earth_compliance_file
,lm_max_comp
,n_compliance_file
,n_dipole_file
,n_e_mag_ic_file
,n_e_mag_oc_file
,n_phi_max_comp
,n_theta_max_comp
,plm_comp
- Routines
finalize_magnetic_energy()
,get_br_skew()
,get_e_mag()
,initialize_magnetic_energy()
Needed modules
parallel_mod
: This module contains the blocking informationprecision_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_maxmag()
,n_r_ic_maxmag()
,n_r_max()
,n_r_ic_max()
,lm_max()
,minc()
): This module defines the grid points and the truncationradial_data
(n_r_cmb()
): This module defines the MPI decomposition in the radial direction.radial_functions
(r_icb()
,r_cmb()
,r_ic()
,dr_fac_ic()
,chebt_ic()
,sigma()
,orho1()
,r()
,or2()
,rscheme_oc()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(lffac()
,kbotb()
,ktopb()
): Module containing the physical parametersnum_param
(escale()
,tscale()
): Module containing numerical and control parametersblocking
(st_map()
,lo_map()
,llmmag()
,ulmmag()
): Module containing blocking informationlogic
(l_cond_ic()
,l_mag()
,l_mag_lf()
,l_save_out()
,l_earth_likeness()
,l_full_sphere()
): Module containing the logicals that control the runmovie_data
(moviedipcolat()
,moviediplon()
,moviedipstrength()
,moviedipstrengthgeo()
)output_data
(tag()
,l_max_comp()
,l_geo()
): This module contains the parameters for output controlconstants
(pi()
,zero()
,one()
,two()
,half()
,four()
,osq4pi()
): module containing constants and parameters used in the code.special
(n_imp()
,rrmp()
): 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 modesintegration
(rint_r()
,rintic()
): Radial integration functionsuseful
(cc2real()
,cc22real()
): This module contains several useful routines.communications
(gather_from_lo_to_rank0()
,reduce_radial()
,reduce_scalar()
,send_lm_pair_to_master()
): This module contains the different MPI communicators used in MagIC.
Variables
-
magnetic_energy/
bcmb
(*) [complex,private/allocatable]¶
-
-
magnetic_energy/
dipole_file
[character(len=72),private]¶
-
-
magnetic_energy/
e_dipa
(*) [real,private/allocatable]¶ Time-averaged dipole (l=1) energy
-
-
magnetic_energy/
e_mag_ic_file
[character(len=72),private]¶
-
-
magnetic_energy/
e_mag_oc_file
[character(len=72),private]¶
-
-
magnetic_energy/
e_p_asa
(*) [real,private/allocatable]¶ Time-averaged axisymmetric poloidal energy
-
-
magnetic_energy/
e_pa
(*) [real,private/allocatable]¶ Time-averaged poloidal energy
-
-
magnetic_energy/
e_t_asa
(*) [real,private/allocatable]¶ Time-averaged axisymmetric toroidal energy
-
-
magnetic_energy/
e_ta
(*) [real,private/allocatable]¶ Time-averaged toroidal energy
-
-
magnetic_energy/
earth_compliance_file
[character(len=72),private]¶
-
-
magnetic_energy/
lm_max_comp
[integer,private]¶
-
-
magnetic_energy/
n_compliance_file
[integer,private]¶
-
-
magnetic_energy/
n_dipole_file
[integer,private]¶
-
-
magnetic_energy/
n_e_mag_ic_file
[integer,private]¶
-
-
magnetic_energy/
n_e_mag_oc_file
[integer,private]¶
-
-
magnetic_energy/
n_phi_max_comp
[integer,private]¶
-
-
magnetic_energy/
n_theta_max_comp
[integer,private]¶
-
-
magnetic_energy/
plm_comp
(*,*) [real,private/allocatable]¶
-
Subroutines and functions
-
subroutine
magnetic_energy/
initialize_magnetic_energy
()¶ Open diagnostic files and allocate memory
- Called from
- Call to
-
subroutine
magnetic_energy/
finalize_magnetic_energy
()¶ Close file and deallocates global arrays
- Called from
-
subroutine
magnetic_energy/
get_e_mag
(time, l_write, l_stop_time, n_e_sets, b, db, aj, b_ic, db_ic, aj_ic, e_p, e_t, e_p_as, e_t_as, e_p_ic, e_t_ic, e_p_as_ic, e_t_as_ic, e_p_os, e_p_as_os, e_cmb, dip, dipcmb, elsanel)¶ calculates magnetic energy = 1/2 Integral(B^2 dV) integration in theta,phi by summation over harmonic coeffs. integration in r by Chebyshev integrals or Simpson rule depending whether FD or Cheb is used.
- Parameters
time [real ,in] :: 1
l_write [logical ,in] :: Switch to write output
l_stop_time [logical ,in] :: Indicates when last time step of the run is reached for radial output
n_e_sets [integer ,in] :: Switch for time-average and to determine first time step
b (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in] :: Array containing magnetic field poloidal potential
db (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in] :: Array containing radial derivative of b
aj (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in] :: Array containing magnetic field toroidal potential
b_ic (ulmmag-(llmmag)+1,n_r_ic_maxmag) [complex ,in] :: Array containing IC magnetic field poloidal potential
db_ic (ulmmag-(llmmag)+1,n_r_ic_maxmag) [complex ,in] :: Array containing radial derivative of IC b
aj_ic (ulmmag-(llmmag)+1,n_r_ic_maxmag) [complex ,in] :: Array containing IC magnetic field toroidal potential
e_p [real ,out] :: Volume averaged poloidal magnetic energy
e_t [real ,out] :: Volume averaged toroidal magnetic energy
e_p_as [real ,out] :: Volume averaged axisymmetric poloidal magnetic energy
e_t_as [real ,out] :: 4,5
e_p_ic [real ,out] :: IC poloidal magnetic energy
e_t_ic [real ,out] :: IC toroidal magnetic energy
e_p_as_ic [real ,out] :: IC axisymmetric poloidal magnetic energy
e_t_as_ic [real ,out] :: IC axisymmetric toroidal magnetic energy
e_p_os [real ,out] :: Outside poloidal magnetic energy
e_p_as_os [real ,out] :: 8,9
e_cmb [real ,out] :: 17
dip [real ,out] :: 4
dipcmb [real ,out] :: 6
elsanel [real ,out] :: Radially averaged Elsasser number
- Called from
- Call to
cc2real()
,reduce_scalar()
,gather_from_lo_to_rank0()
,rint_r()
,cc22real()
,rintic()
,get_br_skew()
getDlm.f90
¶
Description
This module is used to calculate the lengthscales. It computes both the integral lengthscale and the peak of the poloidal energy. It also stores the radial profiles of these lengthscales.
Quick access
- Routines
Needed modules
parallel_mod
: This module contains the blocking informationprecision_mod
: This module controls the precision used in MagICcommunications
(reduce_radial()
): This module contains the different MPI communicators used in MagIC.truncation
(minc()
,m_max()
,l_max()
,n_r_max()
): This module defines the grid points and the truncationradial_functions
(or2()
,r()
,rscheme_oc()
,orho1()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)num_param
(escale()
): Module containing numerical and control parametersblocking
(lo_map()
,llm()
,ulm()
): Module containing blocking informationconstants
(pi()
,half()
): module containing constants and parameters used in the code.useful
(abortrun()
): This module contains several useful routines.integration
(rint_r()
): Radial integration functions
Variables
Subroutines and functions
-
subroutine
getdlm_mod/
getdlm
(w, dw, z, dl, dlr, dm, dlc, dlpolpeak, dlrc, dlpolpeakr, switch_bn)¶ This routine is used to compute integral lengthscale using spectra
outMisc.f90
¶
Description
This module contains several subroutines that can compute and store various informations: helicity (helicity.TAG), heat transfer (heat.TAG), phase field (phase.TAG) and North/South hemisphericity of energies (hemi.TAG)
Quick access
- Variables
asym_file
,coeff_old
,drift_asym_file
,drift_sym_file
,ekinlr
,ekinsr
,heat_file
,hel2asr
,helasr
,heleaasr
,helicity_file
,helna2asr
,helnaasr
,hemi_brabs_r
,hemi_ekin_r
,hemi_emag_r
,hemi_file
,hemi_vrabs_r
,n_drift_asym_file
,n_drift_sym_file
,n_growth_asym_file
,n_growth_sym_file
,n_heat_file
,n_helicity_file
,n_hemi_file
,n_phase_file
,n_rmelt_file
,phase_file
,phimeanr
,pmeanr
,rhomeanr
,rmelt_file
,smeanr
,sym_file
,tmeanr
,tphi
,tphiold
,volsr
,ximeanr
- Routines
finalize_outmisc_mod()
,get_ekin_solid_liquid()
,get_helicity()
,get_hemi()
,get_onset()
,initialize_outmisc_mod()
,outheat()
,outhelicity()
,outhemi()
,outphase()
Needed modules
parallel_mod
: This module contains the blocking informationprecision_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 MagICcommunications
(gather_from_rloc()
,gather_from_lo_to_rank0()
): This module contains the different MPI communicators used in MagIC.truncation
(l_max()
,n_r_max()
,nlat_padded()
,n_theta_max()
,n_r_maxmag()
,n_phi_max()
,lm_max()
,m_min()
,m_max()
,minc()
): This module defines the grid points and the truncationradial_data
(n_r_icb()
,n_r_cmb()
,nrstart()
,nrstop()
,nrstartmag()
,nrstopmag()
): This module defines the MPI decomposition in the radial direction.radial_functions
(r_icb()
,rscheme_oc()
,kappa()
,r_cmb()
,temp0()
,r()
,rho0()
,dltemp0()
,dlalpha0()
,beta()
,orho1()
,alpha0()
,otemp1()
,ogrun()
,or2()
,orho2()
,or4()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(vischeatfac()
,thexpnb()
,opr()
,stef()
,lffac()
): Module containing the physical parametersnum_param
(lscale()
,escale()
,vscale()
): Module containing numerical and control parametersblocking
(llm()
,ulm()
,lo_map()
,lm2()
): Module containing blocking informationradial_der
(get_dr()
): Radial derivatives functionsmean_sd
(mean_sd_type()
): This module contains a small type that simply handles two arrays (mean and SD) This type is used for time-averaged outputs (and their standard deviations).horizontal_data
(gauss()
,theta_ord()
,n_theta_cal2ord()
,o_sin_theta_e2()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderlogic
(l_save_out()
,l_anelastic_liquid()
,l_heat()
,l_hel()
,l_hemi()
,l_temperature_diff()
,l_chemical_conv()
,l_phase_field()
,l_mag()
,l_onset()
): Module containing the logicals that control the runoutput_data
(tag()
): This module contains the parameters for output controlconstants
(pi()
,vol_oc()
,osq4pi()
,sq4pi()
,one()
,two()
,four()
,half()
,zero()
): module containing constants and parameters used in the code.start_fields
(topcond()
,botcond()
,deltacond()
,topxicond()
,botxicond()
,deltaxicond()
): This module is used to set-up the initial starting fields. They can be obtained by reading a starting checkpoint file or by setting some starting conditions.useful
(cc2real()
,round_off()
): This module contains several useful routines.integration
(rint_r()
): Radial integration functions
Variables
-
outmisc_mod/
asym_file
[character(len=72),private]¶
-
-
outmisc_mod/
coeff_old
(*) [complex,private/allocatable]¶
-
-
outmisc_mod/
drift_asym_file
[character(len=72),private]¶
-
-
outmisc_mod/
drift_sym_file
[character(len=72),private]¶
-
-
outmisc_mod/
ekinlr
(*) [real,private/allocatable]¶
-
-
outmisc_mod/
ekinsr
(*) [real,private/allocatable]¶
-
-
outmisc_mod/
heat_file
[character(len=72),private]¶
-
-
outmisc_mod/
hel2asr
(*,*) [real,private/allocatable]¶
-
-
outmisc_mod/
helasr
(*,*) [real,private/allocatable]¶
-
-
outmisc_mod/
heleaasr
(*) [real,private/allocatable]¶
-
-
outmisc_mod/
helicity_file
[character(len=72),private]¶
-
-
outmisc_mod/
helna2asr
(*,*) [real,private/allocatable]¶
-
-
outmisc_mod/
helnaasr
(*,*) [real,private/allocatable]¶
-
-
outmisc_mod/
hemi_brabs_r
(*,*) [real,private/allocatable]¶
-
-
outmisc_mod/
hemi_ekin_r
(*,*) [real,private/allocatable]¶
-
-
outmisc_mod/
hemi_emag_r
(*,*) [real,private/allocatable]¶
-
-
outmisc_mod/
hemi_file
[character(len=72),private]¶
-
-
outmisc_mod/
hemi_vrabs_r
(*,*) [real,private/allocatable]¶
-
-
outmisc_mod/
n_calls
[integer,private]¶
-
-
outmisc_mod/
n_drift_asym_file
[integer,private]¶
-
-
outmisc_mod/
n_drift_sym_file
[integer,private]¶
-
-
outmisc_mod/
n_growth_asym_file
[integer,private]¶
-
-
outmisc_mod/
n_growth_sym_file
[integer,private]¶
-
-
outmisc_mod/
n_heat_file
[integer,private]¶
-
-
outmisc_mod/
n_helicity_file
[integer,private]¶
-
-
outmisc_mod/
n_hemi_file
[integer,private]¶
-
-
outmisc_mod/
n_phase_file
[integer,private]¶
-
-
outmisc_mod/
n_rmelt_file
[integer,private]¶
-
-
outmisc_mod/
phase_file
[character(len=72),private]¶
-
-
outmisc_mod/
phimeanr
[mean_sd_type,private]¶
-
-
outmisc_mod/
pmeanr
[mean_sd_type,private]¶
-
-
outmisc_mod/
rhomeanr
[mean_sd_type,private]¶
-
-
outmisc_mod/
rmelt_file
[character(len=72),private]¶
-
-
outmisc_mod/
smeanr
[mean_sd_type,private]¶
-
-
outmisc_mod/
sym_file
[character(len=72),private]¶
-
-
outmisc_mod/
tmeanr
[mean_sd_type,private]¶
-
-
outmisc_mod/
tphi
[real,private]¶
-
-
outmisc_mod/
tphiold
[real,private]¶
-
-
outmisc_mod/
volsr
(*) [real,private/allocatable]¶
-
-
outmisc_mod/
ximeanr
[mean_sd_type,private]¶
-
Subroutines and functions
-
subroutine
outmisc_mod/
initialize_outmisc_mod
()¶ This subroutine handles the opening of some output diagnostic files that have to do with heat transfer, helicity, phase field or hemisphericity
- Called from
-
subroutine
outmisc_mod/
finalize_outmisc_mod
()¶ This subroutine handles the closing of the time series of heat.TAG, hel.TAG, hemi.TAG and phase.TAG
- Called from
-
subroutine
outmisc_mod/
outhemi
(timescaled)¶ This function handles the writing of outputs related to hemisphericity of the kinetic and magnetic energy between Northern and Southern hemispheres. This is based on Wieland Dietrich’s work (see Dietrich & Wicht, 2013). Outputs are stored in the time series hemi.TAG
- Parameters
timescaled [real ,in]
- Called from
- Call to
-
subroutine
outmisc_mod/
outhelicity
(timescaled)¶ This subroutine is used to store informations about kinetic helicity. Outputs are stored in the time series helicity.TAG
- Parameters
timescaled [real ,in]
- Called from
- Call to
-
subroutine
outmisc_mod/
outheat
(time, timepassed, timenorm, l_stop_time, s, ds, p, xi, dxi)¶ This subroutine is used to store informations about heat transfer (i.e. Nusselt number, temperature, entropy, …)
- Parameters
time [real ,in]
timepassed [real ,in]
timenorm [real ,in]
l_stop_time [logical ,in]
s (ulm-(llm)+1,n_r_max) [complex ,in] :: Entropy/temperature
ds (ulm-(llm)+1,n_r_max) [complex ,in] :: Radial derivative of entropy/temp
xi (ulm-(llm)+1,n_r_max) [complex ,in] :: Chemical composition
dxi (ulm-(llm)+1,n_r_max) [complex ,in] :: Radial derivative of xi
- Called from
- Call to
-
subroutine
outmisc_mod/
outphase
(time, timepassed, timenorm, l_stop_time, nlogs, s, ds, phi)¶ This subroutine handles the writing of time series related with phase field: phase.TAG
- Parameters
time [real ,in] :: Time
timepassed [real ,in] :: Time passed since last call
timenorm [real ,in]
l_stop_time [logical ,in] :: Last iteration
nlogs [integer ,in] :: Number of log outputs
s (ulm-(llm)+1,n_r_max) [complex ,in] :: Entropy/Temperature
ds (ulm-(llm)+1,n_r_max) [complex ,in] :: Radial der. of Entropy/Temperature
- Called from
- Call to
-
subroutine
outmisc_mod/
get_hemi
(vr, vt, vp, nr, field)¶ This subroutine is used to compute kinetic or magnetic energy in Northern or Southern hemipshere.
- Parameters
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
nr [integer ,in] :: radial level
field [character(len=1),in]
- Called from
-
subroutine
outmisc_mod/
get_helicity
(vr, vt, vp, cvr, dvrdt, dvrdp, dvtdr, dvpdr, nr)¶ This subroutine calculates axisymmetric and non-axisymmetric contributions to kinetic helicity and squared helicity.
- Parameters
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
cvr (*,*) [real ,in]
dvrdt (*,*) [real ,in]
dvrdp (*,*) [real ,in]
dvtdr (*,*) [real ,in]
dvpdr (*,*) [real ,in]
nr [integer ,in]
- Called from
-
subroutine
outmisc_mod/
get_ekin_solid_liquid
(vr, vt, vp, phi, nr)¶ This subroutine computes the kinetic energy content in the solid and in the liquid phase when phase field is employed.
- Parameters
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
phi (*,*) [real ,in]
nr [integer ,in]
- Called from
-
subroutine
outmisc_mod/
get_onset
(time, w, dt, l_log, nlogs)¶ This subroutine is used to estimate the growth rate and the drifting frequencies of a series of m modes for both equatorially-symmetric and equatorially-antisymmetric modes. This is used to compute the critical Rayleigh number. This makes uses of the radial integration of the poloidal potential at different (l,m) tuples.
outRot.f90
¶
Description
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.
Quick access
- Variables
angular_file
,driftbd_file
,driftbq_file
,driftvd_file
,driftvq_file
,inerp_file
,inert_file
,n_angular_file
,n_driftbd_file
,n_driftbq_file
,n_driftvd_file
,n_driftvq_file
,n_inerp_file
,n_inert_file
,n_rot_file
,n_sric_file
,n_srma_file
,rot_file
,sric_file
,srma_file
- Routines
finalize_outrot()
,get_angular_moment()
,get_angular_moment_rloc()
,get_lorentz_torque()
,get_viscous_torque()
,initialize_outrot()
,write_rot()
Needed modules
parallel_mod
: This module contains the blocking informationprecision_mod
: This module controls the precision used in MagICcommunications
(allgather_from_rloc()
,send_lm_pair_to_master()
): This module contains the different MPI communicators used in MagIC.truncation
(n_r_max()
,n_r_maxmag()
,minc()
,n_phi_max()
,n_theta_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
(r_icb()
,r_cmb()
,r()
,rscheme_oc()
,beta()
,visc()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(kbotv()
,ktopv()
,lffac()
): Module containing the physical parametersnum_param
(lscale()
,tscale()
,vscale()
): Module containing numerical and control parametersblocking
(lo_map()
,lm_balance()
,llm()
,ulm()
,llmmag()
,ulmmag()
): Module containing blocking informationlogic
(l_am()
,l_save_out()
,l_iner()
,l_sric()
,l_rot_ic()
,l_srma()
,l_rot_ma()
,l_mag_lf()
,l_mag()
,l_drift()
,l_finite_diff()
,l_full_sphere()
): Module containing the logicals that control the runoutput_data
(tag()
): This module contains the parameters for output controlconstants
(c_moi_oc()
,c_moi_ma()
,c_moi_ic()
,pi()
,y11_norm()
,y10_norm()
,zero()
,two()
,third()
,four()
,half()
): module containing constants and parameters used in the code.integration
(rint_r()
): Radial integration functionshorizontal_data
(costheta()
,gauss()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderspecial
(bic()
,lgrenoble()
): 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 modesuseful
(abortrun()
): This module contains several useful routines.
Variables
-
outrot/
angular_file
[character(len=72),private]¶
-
-
outrot/
driftbd_file
[character(len=72),private]¶
-
-
outrot/
driftbq_file
[character(len=72),private]¶
-
-
outrot/
driftvd_file
[character(len=72),private]¶
-
-
outrot/
driftvq_file
[character(len=72),private]¶
-
-
outrot/
inerp_file
[character(len=72),private]¶
-
-
outrot/
inert_file
[character(len=72),private]¶
-
-
outrot/
n_angular_file
[integer,private]¶
-
-
outrot/
n_driftbd_file
[integer,private]¶
-
-
outrot/
n_driftbq_file
[integer,private]¶
-
-
outrot/
n_driftvd_file
[integer,private]¶
-
-
outrot/
n_driftvq_file
[integer,private]¶
-
-
outrot/
n_inerp_file
[integer,private]¶
-
-
outrot/
n_inert_file
[integer,private]¶
-
-
outrot/
n_rot_file
[integer,private]¶
-
-
outrot/
n_sric_file
[integer,private]¶
-
-
outrot/
n_srma_file
[integer,private]¶
-
-
outrot/
rot_file
[character(len=72),private]¶
-
-
outrot/
sric_file
[character(len=72),private]¶
-
-
outrot/
srma_file
[character(len=72),private]¶
-
Subroutines and functions
-
subroutine
outrot/
write_rot
(time, dt, ekinic, ekinma, w, z, dz, b, omega_ic, omega_ma, lorentz_torque_ic, lorentz_torque_ma)¶ – Input of variables:
- Parameters
time [real ,in]
dt [real ,in]
ekinic [real ,out]
ekinma [real ,out]
b (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
omega_ic [real ,in]
omega_ma [real ,in]
lorentz_torque_ic [real ,in]
lorentz_torque_ma [real ,in]
- Called from
- Call to
-
subroutine
outrot/
get_viscous_torque
(viscous_torque, z10, dz10, r, dlrho, nu)¶ Purpose of this subroutine is to calculate the viscous torque on mantle or inner core respectively.
\[\Gamma_\nu=4\sqrt{\pi/3}\nu r\left[ \frac{\partial z_{10}}{\partial r} -(\frac{2}{r}+\beta)z_{10} \right]\]- Parameters
viscous_torque [real ,out]
z10 [real ,in]
dz10 [real ,in] :: z10 coefficient and its radial deriv.
r [real ,in] :: radius (ICB or CMB)
dlrho [real ,in] :: dln(rho)/dr
nu [real ,in] :: viscosity
- Called from
-
subroutine
outrot/
get_lorentz_torque
(lorentz_torque, br, bp, nr)¶ Purpose of this subroutine is to calculate the Lorentz torque on mantle or inner core respectively.
Note
lorentz_torque
must be set to zero before loop over theta blocks is started.Warning
subroutine returns
-lorentz_torque
if used at CMB to calculate torque on mantle because if the inward surface normal vector.The Prandtl number is always the Prandtl number of the outer core. This comes in via scaling of the magnetic field. Theta alternates between northern and southern hemisphere in
br
andbp
but not in gauss. This has to be cared for, and we use:gauss(latitude)=gauss(-latitude)
here.- Parameters
lorentz_torque [real ,inout] :: Lorentz torque
br (*,*) [real ,in] :: array containing \(r^2 B_r\)
bp (*,*) [real ,in] :: array containing \(r\sin\theta B_\phi\)
nr [integer ,in] :: radial level
- Called from
-
subroutine
outrot/
get_angular_moment
(z10, z11, omega_ic, omega_ma, angular_moment_oc, angular_moment_ic, angular_moment_ma)¶ Calculates angular momentum of outer core, inner core and mantle. For outer core we need
z(l=1|m=0,1|r)
, for inner core and mantle the respective rotation rates are needed.- Parameters
- Called from
- Call to
-
subroutine
outrot/
get_angular_moment_rloc
(z10, z11, omega_ic, omega_ma, angular_moment_oc, angular_moment_ic, angular_moment_ma)¶ Calculates angular momentum of outer core, inner core and mantle. For outer core we need
z(l=1|m=0,1|r)
, for inner core and mantle the respective rotation rates are needed. This is the version that takes r-distributed arrays as input arrays.- Parameters
- Called from
- Call to
outPar.f90
¶
Description
This module is used to compute several time-averaged radial profiles: fluxes, boundary layers, etc.
Quick access
- Variables
comp
,dlpolpeak
,dlv
,dlvc
,duh
,duhasr
,entropy
,epar
,eparasr
,eparaxi
,eparaxiasr
,eperp
,eperpasr
,eperpaxi
,eperpaxiasr
,fcond
,fconv
,fconvasr
,fkin
,fkinasr
,fpoyn
,fpoynasr
,fres
,fresasr
,fvisc
,fviscasr
,gradt2
,gradt2asr
,n_perppar_file
,perppar_file
,rm
,rol
,uh
,uhasr
,urol
- Routines
finalize_outpar_mod()
,get_fluxes()
,get_nlblayers()
,get_perppar()
,initialize_outpar_mod()
,outpar()
,outperppar()
Needed modules
parallel_mod
: This module contains the blocking informationprecision_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 MagICcommunications
(gather_from_rloc()
): This module contains the different MPI communicators used in MagIC.blocking
(llm()
,ulm()
,lo_map()
): Module containing blocking informationtruncation
(n_r_max()
,n_r_maxmag()
,l_max()
,lm_max()
,l_maxmag()
,n_theta_max()
,n_phi_max()
): This module defines the grid points and the truncationlogic
(l_viscbccalc()
,l_anel()
,l_fluxprofs()
,l_mag_nl()
,l_perppar()
,l_save_out()
,l_temperature_diff()
,l_anelastic_liquid()
,l_mag()
,l_heat()
,l_chemical_conv()
): Module containing the logicals that control the runhorizontal_data
(gauss()
,o_sin_theta_e2()
,costheta()
,sintheta_e2()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderphysical_parameters
(ek()
,prmag()
,ohmlossfac()
,vischeatfac()
,opr()
,kbots()
,ktops()
,thexpnb()
,ekscaled()
): Module containing the physical parametersnum_param
(tscale()
): Module containing numerical and control parametersconstants
(pi()
,mass()
,osq4pi()
,sq4pi()
,half()
,two()
,four()
,third()
,one()
): module containing constants and parameters used in the code.radial_functions
(r()
,or2()
,sigma()
,rho0()
,kappa()
,temp0()
,rscheme_oc()
,orho1()
,dlalpha0()
,dltemp0()
,beta()
,alpha0()
,or1()
,orho2()
,visc()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)radial_data
(n_r_icb()
,nrstart()
,nrstop()
,nrstartmag()
,nrstopmag()
,n_r_cmb()
): This module defines the MPI decomposition in the radial direction.output_data
(tag()
): This module contains the parameters for output controluseful
(cc2real()
,round_off()
): This module contains several useful routines.mean_sd
(mean_sd_type()
): This module contains a small type that simply handles two arrays (mean and SD) This type is used for time-averaged outputs (and their standard deviations).integration
(rint_r()
): Radial integration functions
Variables
-
outpar_mod/
comp
[mean_sd_type,private]¶
-
-
outpar_mod/
dlpolpeak
[mean_sd_type,private]¶
-
-
outpar_mod/
dlv
[mean_sd_type,private]¶
-
-
outpar_mod/
dlvc
[mean_sd_type,private]¶
-
-
outpar_mod/
duh
[mean_sd_type,private]¶
-
-
outpar_mod/
duhasr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
entropy
[mean_sd_type,private]¶
-
-
outpar_mod/
epar
[mean_sd_type,private]¶
-
-
outpar_mod/
eparasr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
eparaxi
[mean_sd_type,private]¶
-
-
outpar_mod/
eparaxiasr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
eperp
[mean_sd_type,private]¶
-
-
outpar_mod/
eperpasr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
eperpaxi
[mean_sd_type,private]¶
-
-
outpar_mod/
eperpaxiasr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
fcond
[mean_sd_type,private]¶
-
-
outpar_mod/
fconv
[mean_sd_type,private]¶
-
-
outpar_mod/
fconvasr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
fkin
[mean_sd_type,private]¶
-
-
outpar_mod/
fkinasr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
fpoyn
[mean_sd_type,private]¶
-
-
outpar_mod/
fpoynasr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
fres
[mean_sd_type,private]¶
-
-
outpar_mod/
fresasr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
fvisc
[mean_sd_type,private]¶
-
-
outpar_mod/
fviscasr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
gradt2
[mean_sd_type,private]¶
-
-
outpar_mod/
gradt2asr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
n_calls
[integer,private]¶
-
-
outpar_mod/
n_perppar_file
[integer,private]¶
-
-
outpar_mod/
perppar_file
[character(len=72),private]¶
-
-
outpar_mod/
rm
[mean_sd_type,private]¶
-
-
outpar_mod/
rol
[mean_sd_type,private]¶
-
-
outpar_mod/
uh
[mean_sd_type,private]¶
-
-
outpar_mod/
uhasr
(*) [real,private/allocatable]¶
-
-
outpar_mod/
urol
[mean_sd_type,private]¶
-
Subroutines and functions
-
subroutine
outpar_mod/
initialize_outpar_mod
()¶ Memory allocation and file openings of several outputs (perpPar, fluxes, bLayers). Mostly time-averaged radial outputs.
- Called from
-
subroutine
outpar_mod/
finalize_outpar_mod
()¶ Closing and memory deallocation of outPar related outputs: fluxesR.TAG, perpar.TAG, bLayersR.TAG, …
- Called from
-
subroutine
outpar_mod/
outpar
(s, ds, xi, p, dp, timepassed, timenorm, l_stop_time, ekinr, rolru2, dlvr, dlvrc, dlpolpeakr, rmr)¶ This routine handles the computation and the writing of parR.TAG and bLayersR.TAG files
- Parameters
s (ulm-(llm)+1,n_r_max) [complex ,in] :: Entropy or temperature
ds (ulm-(llm)+1,n_r_max) [complex ,in] :: Radial der. of entropy or temperature
xi (ulm-(llm)+1,n_r_max) [complex ,in] :: Chemical composition
dp (ulm-(llm)+1,n_r_max) [complex ,in] :: Radial derivative of pressure
timepassed [real ,in]
timenorm [real ,in]
l_stop_time [logical ,in] :: Is it the end of the run
ekinr (n_r_max) [real ,in] :: kinetic energy w radius
rolru2 (n_r_max) [real ,in]
dlvr (n_r_max) [real ,in]
dlvrc (n_r_max) [real ,in]
dlpolpeakr (n_r_max) [real ,in]
rmr (n_r_max) [real ,out] :: Radial profile of magnetic Reynolds number
- Called from
- Call to
-
subroutine
outpar_mod/
outperppar
(time, timepassed, timenorm, l_stop_time)¶ This subroutine handles the writing the time series perpar.tag which stores kinetic energy content perpendicular and parallel to rotation axis.
- Parameters
time [real ,in]
timepassed [real ,in]
timenorm [real ,in]
l_stop_time [logical ,in]
- Called from
- Call to
-
subroutine
outpar_mod/
get_fluxes
(vr, vt, vp, dvrdr, dvtdr, dvpdr, dvrdt, dvrdp, sr, pr, br, bt, bp, cbt, cbp, nr)¶ This routine computes the various contribution to heat fluxes:
Convective flux: \(F_c= \rho T (u_r s)\)
Kinetic flux: \(F_k = 1/2\,\rho u_r (u_r^2+u_\theta^2+u_\phi^2)\)
Viscous flux: \(F_= -(u \cdot S )_r\))
If the run is magnetic, then this routine also computes:
Poynting flux
Resistive flux
- Parameters
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
dvrdr (*,*) [real ,in]
dvtdr (*,*) [real ,in]
dvpdr (*,*) [real ,in]
dvrdt (*,*) [real ,in]
dvrdp (*,*) [real ,in]
sr (*,*) [real ,in]
pr (*,*) [real ,in]
br (*,*) [real ,in]
bt (*,*) [real ,in]
bp (*,*) [real ,in]
cbt (*,*) [real ,in]
cbp (*,*) [real ,in]
nr [integer ,in]
- Called from
-
subroutine
outpar_mod/
get_nlblayers
(vt, vp, dvtdr, dvpdr, dsdr, dsdt, dsdp, nr)¶ This subroutine calculates the axisymmetric contributions of:
the horizontal velocity \(u_h = \sqrt{u_\theta^2+u_\phi^2}\)
its radial derivative \(|\partial u_h/\partial r|\)
The thermal dissipation rate \((\nabla T)^2\)
This subroutine is used when one wants to evaluate viscous and thermal dissipation layers
- Parameters
vt (*,*) [real ,in]
vp (*,*) [real ,in]
dvtdr (*,*) [real ,in]
dvpdr (*,*) [real ,in]
dsdr (*,*) [real ,in]
dsdt (*,*) [real ,in]
dsdp (*,*) [real ,in]
nr [integer ,in]
- Called from
-
subroutine
outpar_mod/
get_perppar
(vr, vt, vp, nr)¶ This subroutine calculates the energies parallel and perpendicular to the rotation axis
\(E_\perp = 0.5 (v_s^2+v_\phi^2)\) with \(v_s= v_r\sin\theta+v_\theta\cos\theta\)
\(E_\parallel = 0.5v_z^2\) with \(v_z= v_r\cos\theta-v_\theta*\sin\theta\)
- Parameters
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
nr [integer ,in]
- Called from
power.f90
¶
Description
This module handles the writing of the power budget
Quick access
- Variables
buo_ave
,buo_chem_ave
,ediffint
,n_calls
,n_power_file
,ohm_ave
,power_file
,powerdiff
,visc_ave
,viscasr
- Routines
finalize_output_power()
,get_power()
,get_visc_heat()
,initialize_output_power()
Needed modules
parallel_mod
: This module contains the blocking informationprecision_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 MagICcommunications
(gather_from_rloc()
,reduce_radial()
,send_lm_pair_to_master()
): This module contains the different MPI communicators used in MagIC.truncation
(n_r_ic_maxmag()
,n_r_max()
,n_r_ic_max()
,n_r_maxmag()
,n_phi_max()
,n_theta_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
(r_cmb()
,r_icb()
,r()
,rscheme_oc()
,chebt_ic()
,or2()
,o_r_ic2()
,lambda()
,temp0()
,or1()
,o_r_ic()
,rgrav()
,r_ic()
,dr_fac_ic()
,alpha0()
,orho1()
,otemp1()
,beta()
,visc()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(kbotv()
,ktopv()
,opm()
,lffac()
,buofac()
,chemfac()
,thexpnb()
,vischeatfac()
): Module containing the physical parametersnum_param
(tscale()
,escale()
): Module containing numerical and control parametersblocking
(lo_map()
,st_map()
,llm()
,ulm()
,llmmag()
,ulmmag()
): Module containing blocking informationhorizontal_data
(dlh()
,gauss()
,o_sin_theta_e2()
,cosn_theta_e2()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderlogic
(l_rot_ic()
,l_sric()
,l_rot_ma()
,l_srma()
,l_save_out()
,l_conv()
,l_cond_ic()
,l_heat()
,l_mag()
,l_chemical_conv()
,l_anelastic_liquid()
): Module containing the logicals that control the runoutput_data
(tag()
): This module contains the parameters for output controlmean_sd
(mean_sd_type()
): This module contains a small type that simply handles two arrays (mean and SD) This type is used for time-averaged outputs (and their standard deviations).useful
(cc2real()
,cc22real()
,round_off()
): This module contains several useful routines.integration
(rint_r()
,rintic()
): Radial integration functionsoutrot
(get_viscous_torque()
): 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….constants
(one()
,two()
,half()
,pi()
,third()
): module containing constants and parameters used in the code.
Variables
-
power/
buo_ave
[mean_sd_type,private]¶
-
-
power/
buo_chem_ave
[mean_sd_type,private]¶
-
-
power/
ediffint
[real,private]¶
-
-
power/
n_calls
[integer,private]¶
-
-
power/
n_power_file
[integer,private]¶
-
-
power/
ohm_ave
[mean_sd_type,private]¶
-
-
power/
power_file
[character(len=72),private]¶
-
-
power/
powerdiff
[real,private]¶
-
-
power/
visc_ave
[mean_sd_type,private]¶
-
-
power/
viscasr
(*) [real,private/allocatable]¶
-
Subroutines and functions
-
subroutine
power/
get_power
(time, timepassed, timenorm, l_stop_time, omega_ic, omega_ma, lorentz_torque_ic, lorentz_torque_ma, w, z, dz, s, xi, b, ddb, aj, dj, db_ic, ddb_ic, aj_ic, dj_ic, viscdiss, ohmdiss)¶ This subroutine calculates power and dissipation of the core/mantle system. Energy input into the outer core is by buoyancy and possibly viscous accelarations at the boundaries if the rotation rates of inner core or mantle are prescribed and kept fixed. The losses are due to Ohmic and viscous dissipation. If inner core and mantel are allowed to change their rotation rates due to viscous forces this power is not lost from the system and has to be respected.
The output is written into a file power.TAG.
- Parameters
time [real ,in]
timepassed [real ,in]
timenorm [real ,in]
l_stop_time [logical ,in]
omega_ic [real ,in]
omega_ma [real ,in]
lorentz_torque_ic [real ,in]
lorentz_torque_ma [real ,in]
b (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
ddb (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
aj (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
dj (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
db_ic (ulmmag-(llmmag)+1,n_r_ic_maxmag) [complex ,in]
ddb_ic (ulmmag-(llmmag)+1,n_r_ic_maxmag) [complex ,in]
aj_ic (ulmmag-(llmmag)+1,n_r_ic_maxmag) [complex ,in]
dj_ic (ulmmag-(llmmag)+1,n_r_ic_maxmag) [complex ,in]
viscdiss [real ,out]
ohmdiss [real ,out]
- Called from
- Call to
cc2real()
,gather_from_rloc()
,rint_r()
,rintic()
,get_viscous_torque()
,round_off()
-
subroutine
power/
get_visc_heat
(vr, vt, vp, cvr, dvrdr, dvrdt, dvrdp, dvtdr, dvtdp, dvpdr, dvpdp, nr)¶ Calculates axisymmetric contributions of the viscous heating
- Parameters
vr (*,*) [real ,in]
vt (*,*) [real ,in] ::
vp (*,*) [real ,in]
cvr (*,*) [real ,in] ::
dvrdr (*,*) [real ,in] ::
dvrdt (*,*) [real ,in]
dvrdp (*,*) [real ,in]
dvtdr (*,*) [real ,in]
dvtdp (*,*) [real ,in]
dvpdr (*,*) [real ,in]
dvpdp (*,*) [real ,in]
nr [integer ,in]
- Called from
spectra.f90
¶
Description
This module handles the computation and the writing of spectra. It handles both 2-D spectra in (r,l) and (r,m) spaces and usual spectra integrated over all radii in (l) or (m) spaces.
Quick access
- Variables
am_kpol_file
,am_ktor_file
,am_mpol_file
,am_mtor_file
,dt_icb_l_ave
,dt_icb_m_ave
,dxi_icb_l_ave
,dxi_icb_m_ave
,e_kin_p_l_ave
,e_kin_p_m_ave
,e_kin_p_r_l_ave
,e_kin_p_r_m_ave
,e_kin_t_l_ave
,e_kin_t_m_ave
,e_kin_t_r_l_ave
,e_kin_t_r_m_ave
,e_mag_cmb_l_ave
,e_mag_cmb_m_ave
,e_mag_p_l_ave
,e_mag_p_m_ave
,e_mag_p_r_l_ave
,e_mag_p_r_m_ave
,e_mag_t_l_ave
,e_mag_t_m_ave
,e_mag_t_r_l_ave
,e_mag_t_r_m_ave
,n_am_kpol_file
,n_am_ktor_file
,n_am_mpol_file
,n_am_mtor_file
,t_icb_l_ave
,t_icb_m_ave
,t_l_ave
,t_m_ave
,u2_p_l_ave
,u2_p_m_ave
,u2_t_l_ave
,u2_t_m_ave
,xi_icb_l_ave
,xi_icb_m_ave
,xi_l_ave
,xi_m_ave
- Routines
finalize_spectra()
,get_amplitude()
,initialize_spectra()
,spectrum()
,spectrum_scal()
,spectrum_vec()
,spectrum_vec_ic()
,write_2d_spectra()
Needed modules
parallel_mod
: This module contains the blocking informationprecision_mod
: This module controls the precision used in MagICcommunications
(reduce_radial()
): 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()
,n_r_ic_maxmag()
,n_r_maxmag()
,n_r_ic_max()
,l_max()
,minc()
): This module defines the grid points and the truncationradial_data
(n_r_cmb()
,n_r_icb()
): This module defines the MPI decomposition in the radial direction.radial_functions
(orho1()
,orho2()
,r_ic()
,chebt_ic()
,r()
,r_cmb()
,rscheme_oc()
,or2()
,r_icb()
,dr_fac_ic()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(lffac()
): Module containing the physical parametersnum_param
(escale()
,tscale()
): Module containing numerical and control parametersblocking
(lo_map()
,llm()
,ulm()
,llmmag()
,ulmmag()
): Module containing blocking informationlogic
(l_mag()
,l_anel()
,l_cond_ic()
,l_heat()
,l_save_out()
,l_chemical_conv()
,l_energy_modes()
,l_2d_spectra()
,l_full_sphere()
): Module containing the logicals that control the runoutput_data
(tag()
,m_max_modes()
): This module contains the parameters for output controluseful
(cc2real()
,cc22real()
,logwrite()
,round_off()
): This module contains several useful routines.integration
(rint_r()
,rintic()
): Radial integration functionsconstants
(pi()
,vol_oc()
,half()
,one()
,four()
): module containing constants and parameters used in the code.mean_sd
(mean_sd_type()
,mean_sd_2d_type()
): This module contains a small type that simply handles two arrays (mean and SD) This type is used for time-averaged outputs (and their standard deviations).
Variables
-
spectra/
am_kpol_file
[character(len=72),private]¶
-
-
spectra/
am_ktor_file
[character(len=72),private]¶
-
-
spectra/
am_mpol_file
[character(len=72),private]¶
-
-
spectra/
am_mtor_file
[character(len=72),private]¶
-
-
spectra/
dt_icb_l_ave
[mean_sd_type,private]¶
-
-
spectra/
dt_icb_m_ave
[mean_sd_type,private]¶
-
-
spectra/
dxi_icb_l_ave
[mean_sd_type,private]¶
-
-
spectra/
dxi_icb_m_ave
[mean_sd_type,private]¶
-
-
spectra/
e_kin_p_l_ave
[mean_sd_type,private]¶
-
-
spectra/
e_kin_p_m_ave
[mean_sd_type,private]¶
-
-
spectra/
e_kin_p_r_l_ave
[mean_sd_2d_type,private]¶
-
-
spectra/
e_kin_p_r_m_ave
[mean_sd_2d_type,private]¶
-
-
spectra/
e_kin_t_l_ave
[mean_sd_type,private]¶
-
-
spectra/
e_kin_t_m_ave
[mean_sd_type,private]¶
-
-
spectra/
e_kin_t_r_l_ave
[mean_sd_2d_type,private]¶
-
-
spectra/
e_kin_t_r_m_ave
[mean_sd_2d_type,private]¶
-
-
spectra/
e_mag_cmb_l_ave
[mean_sd_type,private]¶
-
-
spectra/
e_mag_cmb_m_ave
[mean_sd_type,private]¶
-
-
spectra/
e_mag_p_l_ave
[mean_sd_type,private]¶
-
-
spectra/
e_mag_p_m_ave
[mean_sd_type,private]¶
-
-
spectra/
e_mag_p_r_l_ave
[mean_sd_2d_type,private]¶
-
-
spectra/
e_mag_p_r_m_ave
[mean_sd_2d_type,private]¶
-
-
spectra/
e_mag_t_l_ave
[mean_sd_type,private]¶
-
-
spectra/
e_mag_t_m_ave
[mean_sd_type,private]¶
-
-
spectra/
e_mag_t_r_l_ave
[mean_sd_2d_type,private]¶
-
-
spectra/
e_mag_t_r_m_ave
[mean_sd_2d_type,private]¶
-
-
spectra/
n_am_kpol_file
[integer,private]¶
-
-
spectra/
n_am_ktor_file
[integer,private]¶
-
-
spectra/
n_am_mpol_file
[integer,private]¶
-
-
spectra/
n_am_mtor_file
[integer,private]¶
-
-
spectra/
t_icb_l_ave
[mean_sd_type,private]¶
-
-
spectra/
t_icb_m_ave
[mean_sd_type,private]¶
-
-
spectra/
t_l_ave
[mean_sd_type,private]¶
-
-
spectra/
t_m_ave
[mean_sd_type,private]¶
-
-
spectra/
u2_p_l_ave
[mean_sd_type,private]¶
-
-
spectra/
u2_p_m_ave
[mean_sd_type,private]¶
-
-
spectra/
u2_t_l_ave
[mean_sd_type,private]¶
-
-
spectra/
u2_t_m_ave
[mean_sd_type,private]¶
-
-
spectra/
xi_icb_l_ave
[mean_sd_type,private]¶
-
-
spectra/
xi_icb_m_ave
[mean_sd_type,private]¶
-
-
spectra/
xi_l_ave
[mean_sd_type,private]¶
-
-
spectra/
xi_m_ave
[mean_sd_type,private]¶
-
Subroutines and functions
-
subroutine
spectra/
initialize_spectra
()¶ This subroutine allocates the arrays employed to generate spectra.
- Called from
-
subroutine
spectra/
finalize_spectra
()¶ This subroutine terminates the memory allocation associated with spectra.
- Called from
-
subroutine
spectra/
spectrum
(n_spec, time, l_avg, n_time_ave, l_stop_time, time_passed, time_norm, s, ds, xi, dxi, w, dw, z, b, db, aj, b_ic, db_ic, aj_ic)¶ This routine handles the computation and the writing of kinetic energy, magnetic energy and temperture spectra, depending on the field of interest.
- Parameters
n_spec [integer ,in] :: number of spectrum/call, file
time [real ,in]
l_avg [logical ,in]
n_time_ave [integer ,in]
l_stop_time [logical ,in]
time_passed [real ,in]
time_norm [real ,in]
b (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
db (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
aj (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
b_ic (ulmmag-(llmmag)+1,n_r_ic_maxmag) [complex ,in]
db_ic (ulmmag-(llmmag)+1,n_r_ic_maxmag) [complex ,in]
aj_ic (ulmmag-(llmmag)+1,n_r_ic_maxmag) [complex ,in]
- Called from
- Call to
spectrum_vec()
,spectrum_scal()
,spectrum_vec_ic()
,cc2real()
,round_off()
,write_2d_spectra()
,logwrite()
-
subroutine
spectra/
write_2d_spectra
(file_name, e_p_r_l, e_t_r_l, e_p_r_m, e_t_r_m, fac[, time])¶ - Parameters
file_name [character(len=*),in] :: name of the output file
e_p_r_l (n_r_max,l_max)+1) [real ,in] :: Poloidal spectrum (r,l) space
e_t_r_l (n_r_max,l_max)+1) [real ,in] :: Toroidal spectrum (r,l) space
e_p_r_m (n_r_max,l_max)+1) [real ,in] :: Poloidal spectrum (r,m) space
e_t_r_m (n_r_max,l_max)+1) [real ,in] :: Toroidal spectrum (r,m) space
fac [real ,in] :: normalisation factor
- Options
time [real ,in,] :: Time for a snapshot
- Called from
-
subroutine
spectra/
spectrum_scal
(scal, dscal, t_l, t_m, t_icb_l, t_icb_m, dt_icb_l, dt_icb_m)¶ This routine is used to compute the spectra of one scalar field such as temperature or chemical composition.
- Parameters
scal (ulm-(llm)+1,n_r_max) [complex ,in] :: The scalar field in l,m space
dscal (ulm-(llm)+1,n_r_max) [complex ,in] :: The radial derivative of the scalar field
t_l (l_max)+1) [real ,out] :: Spectrum as a function of degree l
t_m (l_max)+1) [real ,out] :: Spectrum as a funtion of order m
t_icb_l (l_max)+1) [real ,out] :: Spectrum at ICB as a function of l
t_icb_m (l_max)+1) [real ,out] :: Spectrum at ICB as a function of m
dt_icb_l (l_max)+1) [real ,out] :: Spectrum of radial der. at ICB as a function of l
dt_icb_m (l_max)+1) [real ,out] :: Spectrum of radial der. at ICB as a function of m
- Called from
- Call to
-
subroutine
spectra/
spectrum_vec
(w, dw, z, e_p_r_l, e_t_r_l, e_p_r_m, e_t_r_m, e_p_l, e_t_l, e_p_m, e_t_m, fac_scal[, fac])¶ This routine handles the computation of spectra of a solenoidal vector field.
- Parameters
dw (ulm-(llm)+1,n_r_max) [complex ,in] :: Radial derivative of poloidal potential
e_p_r_l (n_r_max,l_max)+1) [real ,out] :: Poloidal spectrum (r,l) space
e_t_r_l (n_r_max,l_max)+1) [real ,out] :: Toroidal spectrum (r,l) space
e_p_r_m (n_r_max,l_max)+1) [real ,out] :: Poloidal spectrum (r,m) space
e_t_r_m (n_r_max,l_max)+1) [real ,out] :: Toroidal spectrum (r,m) space
e_p_l (l_max)+1) [real ,out] :: Poloidal spectrum as a function of l
e_t_l (l_max)+1) [real ,out] :: Toroidal spectrum as a function of l
e_p_m (l_max)+1) [real ,out] :: Poloidal spectrum as a function of m
e_t_m (l_max)+1) [real ,out] :: Toroidal spectrum as a function of m
fac_scal [real ,in] :: Constant factor (like 1/2)
- Options
fac (n_r_max) [real ,in,] :: Factor which depends on radius (like density)
- Called from
- Call to
-
subroutine
spectra/
spectrum_vec_ic
(b_ic, db_ic, aj_ic, e_p_l, e_t_l, e_p_m, e_t_m, fac)¶ This routine handles the computation of spectra of a solenoidal vector field in the Inner Core.
- Parameters
b_ic (ulm-(llm)+1,n_r_ic_max) [complex ,in] :: Poloidal potential
db_ic (ulm-(llm)+1,n_r_ic_max) [complex ,in] :: Radial derivative of poloidal potential
aj_ic (ulm-(llm)+1,n_r_ic_max) [complex ,in] :: Toroidal potential
e_p_l (l_max)+1) [real ,out] :: Poloidal spectrum as a function of l
e_t_l (l_max)+1) [real ,out] :: Toroidal spectrum as a function of l
e_p_m (l_max)+1) [real ,out] :: Poloidal spectrum as a function of m
e_t_m (l_max)+1) [real ,out] :: Toroidal spectrum as a function of m
fac [real ,in] :: Constant normalisation factor
- Called from
- Call to
-
subroutine
spectra/
get_amplitude
(time, w, dw, z, b, db, aj)¶ This routine is used to generate times series of magnetic and kinetic energy spectra as a function of the spherical harmonic order m.
- Parameters
- Called from
- Call to