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:

finalize_output(), initialize_output(), output()

Needed modules

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:

magic

Call to:

initialize_coeff()

subroutine  output_mod/finalize_output()
Called from:

magic

Call to:

finalize_coeff()

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]

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

Called from:

step_time()

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:

e_kin_file, n_e_kin_file, n_u_square_file, u_square_file

Routines:

finalize_kinetic_energy(), get_e_kin(), get_u_square(), initialize_kinetic_energy()

Needed modules

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/initialize_kinetic_energy()
Called from:

magic

subroutine  kinetic_energy/finalize_kinetic_energy()
Called from:

magic

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 (1 - llm + ulm,n_r_max) [complex ,in] :: Array containing kinetic field poloidal potential

  • dw (1 - llm + ulm,n_r_max) [complex ,in] :: Array containing radial derivative of w

  • z (1 - llm + ulm,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:

fields_average(), output()

Call to:

cc2real(), rint_r(), abortrun()

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 (1 - llm + ulm,n_r_max) [complex ,in] :: Array containing kinetic field poloidal potential

  • dw (1 - llm + ulm,n_r_max) [complex ,in] :: Array containing radial derivative of w

  • z (1 - llm + ulm,n_r_max) [complex ,in] :: Array containing kinetic field toroidal potential

  • rolr (n_r_max) [real ,out] :: local Rossby number

Called from:

output()

Call to:

cc2real(), rint_r()

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

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:

magic

Call to:

plm_theta()

subroutine  magnetic_energy/finalize_magnetic_energy()

Close file and deallocates global arrays

Called from:

magic

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 (1 - llmmag + ulmmag,n_r_maxmag) [complex ,in] :: Array containing magnetic field poloidal potential

  • db (1 - llmmag + ulmmag,n_r_maxmag) [complex ,in] :: Array containing radial derivative of b

  • aj (1 - llmmag + ulmmag,n_r_maxmag) [complex ,in] :: Array containing magnetic field toroidal potential

  • b_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,in] :: Array containing IC magnetic field poloidal potential

  • db_ic (1 - llmmag + ulmmag,n_r_ic_maxmag) [complex ,in] :: Array containing radial derivative of IC b

  • aj_ic (1 - llmmag + ulmmag,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:

fields_average(), output()

Call to:

cc2real(), reduce_scalar(), gather_from_lo_to_rank0(), rint_r(), cc22real(), rintic(), get_br_skew()

subroutine  magnetic_energy/get_br_skew(bcmb, br_skew)

This subroutine calculates the skewness of the radial magnetic field at the outer boundary. bskew := <B^4> / <B^2>^2 where <..> is average over the surface

Parameters:
  • bcmb (lm_max) [complex ,in]

  • br_skew [real ,out]

Called from:

get_e_mag()

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:

getdlm()

Needed modules

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

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

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

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

  • dl [real ,out]

  • dlr (n_r_max) [real ,out]

  • dm [real ,out]

  • dlc [real ,out]

  • dlpolpeak [real ,out]

  • dlrc (n_r_max) [real ,out]

  • dlpolpeakr (n_r_max) [real ,out]

  • switch_bn [character(len=1),in]

Called from:

output()

Call to:

cc2real(), abortrun(), rint_r()

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

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:

magic

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:

magic

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:

output()

Call to:

gather_from_rloc(), rint_r(), round_off()

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:

output()

Call to:

gather_from_rloc(), rint_r()

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 (1 - llm + ulm,n_r_max) [complex ,in] :: Entropy/temperature

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

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

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

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

Called from:

output()

Call to:

rint_r(), round_off()

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 (1 - llm + ulm,n_r_max) [complex ,in] :: Entropy/Temperature

  • ds (1 - llm + ulm,n_r_max) [complex ,in] :: Radial der. of Entropy/Temperature

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

Called from:

output()

Call to:

gather_from_rloc(), axi_to_spat(), rint_r(), round_off()

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:

radialloop()

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:

radialloop()

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:

radialloop()

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.

Parameters:
  • time [real ,in] :: Time

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

  • dt [real ,in] :: Timestep size

  • l_log [logical ,in] :: Do we need to store outputs

  • nlogs [integer ,in] :: Do not write at the first time step

Called from:

output()

Call to:

rint_r(), gather_from_lo_to_rank0()

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

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/initialize_outrot()
Called from:

magic

subroutine  outrot/finalize_outrot()
Called from:

magic

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]

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

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

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

  • b (1 - llmmag + ulmmag,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:

output()

Call to:

get_viscous_torque(), get_angular_moment()

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:

write_rot(), get_power()

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 and bp 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:

radialloop()

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:
  • z10 (n_r_max) [complex ,in]

  • z11 (n_r_max) [complex ,in]

  • omega_ic [real ,in]

  • omega_ma [real ,in]

  • angular_moment_oc (*) [real ,out]

  • angular_moment_ic (*) [real ,out]

  • angular_moment_ma (*) [real ,out]

Called from:

write_rot(), get_tor_rhs_imp()

Call to:

rint_r()

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:
  • z10 (1 - nrstart + nrstop) [complex ,in]

  • z11 (1 - nrstart + nrstop) [complex ,in]

  • omega_ic [real ,in]

  • omega_ma [real ,in]

  • angular_moment_oc (*) [real ,out]

  • angular_moment_ic (*) [real ,out]

  • angular_moment_ma (*) [real ,out]

Called from:

get_tor_rhs_imp_ghost()

Call to:

allgather_from_rloc(), rint_r()

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

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:

magic

subroutine  outpar_mod/finalize_outpar_mod()

Closing and memory deallocation of outPar related outputs: fluxesR.TAG, perpar.TAG, bLayersR.TAG, …

Called from:

magic

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 (1 - llm + ulm,n_r_max) [complex ,in] :: Entropy or temperature

  • ds (1 - llm + ulm,n_r_max) [complex ,in] :: Radial der. of entropy or temperature

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

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

  • dp (1 - llm + ulm,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:

output()

Call to:

gather_from_rloc(), round_off()

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:

output()

Call to:

gather_from_rloc(), rint_r(), round_off()

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:

radialloop()

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:

radialloop()

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:

radialloop()

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

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/initialize_output_power()

Memory allocation

Called from:

magic

subroutine  power/finalize_output_power()
Called from:

magic

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:
Called from:

output()

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:

radialloop()

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_pa_r_l_ave, e_mag_t_l_ave, e_mag_t_m_ave, e_mag_t_r_l_ave, e_mag_t_r_m_ave, e_mag_ta_r_l_ave, e_mer_l_ave, e_mer_r_l_ave, e_zon_l_ave, e_zon_r_l_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_mer_l_ave, u2_p_l_ave, u2_p_m_ave, u2_t_l_ave, u2_t_m_ave, u2_zon_l_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

Variables

Subroutines and functions

subroutine  spectra/initialize_spectra()

This subroutine allocates the arrays employed to generate spectra.

Called from:

magic

subroutine  spectra/finalize_spectra()

This subroutine terminates the memory allocation associated with spectra.

Called from:

magic

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:
Called from:

fields_average(), output()

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, e_pa_r_l, e_ta_r_l, fac[, time])

This routine handles the writing of 2D spectra of energy in both (r,ell) and (r,m) spaces

Parameters:
  • file_name [character(len=*),in] :: name of the output file

  • e_p_r_l (n_r_max,1 + l_max) [real ,in] :: Poloidal spectrum (r,l) space

  • e_t_r_l (n_r_max,1 + l_max) [real ,in] :: Toroidal spectrum (r,l) space

  • e_p_r_m (n_r_max,1 + l_max) [real ,in] :: Poloidal spectrum (r,m) space

  • e_t_r_m (n_r_max,1 + l_max) [real ,in] :: Toroidal spectrum (r,m) space

  • e_pa_r_l (n_r_max,1 + l_max) [real ,in] :: Pol. axi. spectrum (r,l) space

  • e_ta_r_l (n_r_max,1 + l_max) [real ,in] :: Tor. axi. spectrum (r,l) space

  • fac [real ,in] :: normalisation factor

Options:

time [real ,in,] :: Time for a snapshot

Called from:

spectrum()

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 (1 - llm + ulm,n_r_max) [complex ,in] :: The scalar field in l,m space

  • dscal (1 - llm + ulm,n_r_max) [complex ,in] :: The radial derivative of the scalar field

  • t_l (1 + l_max) [real ,out] :: Spectrum as a function of degree l

  • t_m (1 + l_max) [real ,out] :: Spectrum as a funtion of order m

  • t_icb_l (1 + l_max) [real ,out] :: Spectrum at ICB as a function of l

  • t_icb_m (1 + l_max) [real ,out] :: Spectrum at ICB as a function of m

  • dt_icb_l (1 + l_max) [real ,out] :: Spectrum of radial der. at ICB as a function of l

  • dt_icb_m (1 + l_max) [real ,out] :: Spectrum of radial der. at ICB as a function of m

Called from:

spectrum()

Call to:

cc2real(), rint_r()

subroutine  spectra/spectrum_vec(w, dw, z, e_p_r_l, e_t_r_l, e_p_r_m, e_t_r_m, e_mer_r_l, e_zon_r_l, e_p_l, e_t_l, e_mer_l, e_zon_l, e_p_m, e_t_m, fac_scal[, fac])

This routine handles the computation of spectra of a solenoidal vector field.

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

  • dw (1 - llm + ulm,n_r_max) [complex ,in] :: Radial derivative of poloidal potential

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

  • e_p_r_l (n_r_max,1 + l_max) [real ,out] :: Poloidal spectrum (r,l) space

  • e_t_r_l (n_r_max,1 + l_max) [real ,out] :: Toroidal spectrum (r,l) space

  • e_p_r_m (n_r_max,1 + l_max) [real ,out] :: Poloidal spectrum (r,m) space

  • e_t_r_m (n_r_max,1 + l_max) [real ,out] :: Toroidal spectrum (r,m) space

  • e_mer_r_l (n_r_max,1 + l_max) [real ,out] :: Pol. axi. spectrum (r,l) space

  • e_zon_r_l (n_r_max,1 + l_max) [real ,out] :: Tor. axi. spectrum (r,l) space

  • e_p_l (1 + l_max) [real ,out] :: Poloidal spectrum as a function of l

  • e_t_l (1 + l_max) [real ,out] :: Toroidal spectrum as a function of l

  • e_mer_l (1 + l_max) [real ,out] :: Pol. axi. spectrum as a function of l

  • e_zon_l (1 + l_max) [real ,out] :: Tor. axi. spectrum as a function of l

  • e_p_m (1 + l_max) [real ,out] :: Poloidal spectrum as a function of m

  • e_t_m (1 + l_max) [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:

spectrum()

Call to:

cc2real(), rint_r()

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 (1 - llm + ulm,n_r_ic_max) [complex ,in] :: Poloidal potential

  • db_ic (1 - llm + ulm,n_r_ic_max) [complex ,in] :: Radial derivative of poloidal potential

  • aj_ic (1 - llm + ulm,n_r_ic_max) [complex ,in] :: Toroidal potential

  • e_p_l (1 + l_max) [real ,out] :: Poloidal spectrum as a function of l

  • e_t_l (1 + l_max) [real ,out] :: Toroidal spectrum as a function of l

  • e_p_m (1 + l_max) [real ,out] :: Poloidal spectrum as a function of m

  • e_t_m (1 + l_max) [real ,out] :: Toroidal spectrum as a function of m

  • fac [real ,in] :: Constant normalisation factor

Called from:

spectrum()

Call to:

cc2real(), cc22real(), rintic()

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:

output()

Call to:

cc2real(), rint_r()