Base modules

precision.f90

Description

This module controls the precision used in MagIC

Quick access

Variables:

cp, lip, mpi_def_complex, mpi_def_real, mpi_out_real, outp, sizeof_character, sizeof_def_complex, sizeof_def_real, sizeof_integer, sizeof_logical, sizeof_out_real

Needed modules

  • iso_fortran_env (real32(), real64(), int32(), int64())

  • mpimod

Variables

  • precision_mod/cp [integer,parameter=real64]
  • precision_mod/lip [integer,parameter=int64]
  • precision_mod/mpi_def_complex [integer,parameter=mpi_complex16]
  • precision_mod/mpi_def_real [integer,parameter=mpi_real8]
  • precision_mod/mpi_out_real [integer,parameter=mpi_real4]
  • precision_mod/outp [integer,parameter=real32]
  • precision_mod/sizeof_character [integer,parameter=1]
  • precision_mod/sizeof_def_complex [integer,parameter='real64real64']
  • precision_mod/sizeof_def_real [integer,parameter='real64']
  • precision_mod/sizeof_integer [integer,parameter=int32]
  • precision_mod/sizeof_logical [integer,parameter=2]
  • precision_mod/sizeof_out_real [integer,parameter='real32']

truncation.f90

Description

This module defines the grid points and the truncation

Quick access

Variables:

fd_order, fd_order_bound, fd_ratio, fd_stretch, l_axi, l_max, l_maxmag, ldtbmem, lm_max, lm_max_dtb, lm_maxmag, lmagmem, lstressmem, m_max, m_min, minc, n_cheb_ic_max, n_cheb_max, n_m_max, n_phi_max, n_phi_maxstr, n_phi_tot, n_r_ic_max, n_r_ic_max_dtb, n_r_ic_maxmag, n_r_max, n_r_max_dtb, n_r_maxmag, n_r_maxstr, n_r_tot, n_r_totmag, n_theta_axi, n_theta_max, n_theta_maxstr, nalias, nlat_padded, radial_scheme, rcut_l

Routines:

checktruncation(), initialize_truncation(), prime_decomposition()

Needed modules

Variables

  • truncation/fd_order [integer]

    Finite difference order (for now only 2 and 4 are safe)

  • truncation/fd_order_bound [integer]

    Finite difference order on the boundaries

  • truncation/fd_ratio [real]

    drMin over drMax (only when FD are used)

  • truncation/fd_stretch [real]

    regular intervals over irregular intervals

  • truncation/l_axi [logical]

    logical for axisymmetric calculations

  • truncation/l_max [integer]

    max degree of Plms

  • truncation/l_maxmag [integer]

    Max. degree for magnetic field calculation

  • truncation/ldtbmem [integer]

    Memory for movie output

  • truncation/lm_max [integer]

    number of l/m combinations

  • truncation/lm_max_dtb [integer]

    Number of l/m combinations for movie output

  • truncation/lm_maxmag [integer]

    Max. number of l/m combinations for magnetic field calculation

  • truncation/lmagmem [integer]

    Memory for magnetic field calculation

  • truncation/lstressmem [integer]

    Memory for stress output

  • truncation/m_max [integer]

    max order of Plms

  • truncation/m_min [integer]

    min order of Plms

  • truncation/minc [integer]

    basic wavenumber, longitude symmetry

  • truncation/n_cheb_ic_max [integer]

    number of chebs in inner core

  • truncation/n_cheb_max [integer]

    max degree-1 of cheb polynomia

  • truncation/n_m_max [integer]

    max number of ms (different oders)

  • truncation/n_phi_max [integer]

    absolute number of phi grid-points

  • truncation/n_phi_maxstr [integer]

    Number of phi points for stress output

  • truncation/n_phi_tot [integer]

    number of longitude grid points

  • truncation/n_r_ic_max [integer]

    number of grid points in inner core

  • truncation/n_r_ic_max_dtb [integer]

    Number of IC radial points for movie output

  • truncation/n_r_ic_maxmag [integer]

    Number of radial points to calculate IC magnetic field

  • truncation/n_r_max [integer]

    number of radial grid points

  • truncation/n_r_max_dtb [integer]

    Number of radial points for movie output

  • truncation/n_r_maxmag [integer]

    Number of radial points to calculate magnetic field

  • truncation/n_r_maxstr [integer]

    Number of radial points for stress output

  • truncation/n_r_tot [integer]

    total number of radial grid points

  • truncation/n_r_totmag [integer]

    n_r_maxMag + n_r_ic_maxMag

  • truncation/n_theta_axi [integer]

    number of theta grid-points (axisymmetric models)

  • truncation/n_theta_max [integer]

    number of theta grid-points

  • truncation/n_theta_maxstr [integer]

    Number of theta points for stress output

  • truncation/nalias [integer]

    controls dealiasing in latitude

  • truncation/nlat_padded [integer]

    number of theta grid-points with padding included

  • truncation/radial_scheme [character(len=72)]

    radial scheme (either Cheybev of FD)

  • truncation/rcut_l [real]

    Cut-off radius when degree varies with radius

Subroutines and functions

subroutine  truncation/initialize_truncation()
Called from:

readnamelists()

Call to:

prime_decomposition()

subroutine  truncation/checktruncation()

This function checks truncations and writes it into STDOUT and the log-file. MPI: called only by the processor responsible for output !

Called from:

magic

Call to:

abortrun()

subroutine  truncation/prime_decomposition(nlon)

This subroutine tries to find the closest nlon which allow a prime decomposition of the form 2**i * 3**j * 4**k

Parameters:

nlon [integer ,inout]

Called from:

initialize_truncation()

num_param.f90

Description

Module containing numerical and control parameters

Quick access

Variables:

alffac, alph1, alph2, alpha, amstart, anelastic_flavour, courfac, dct_counter, delxh2, delxr2, difchem, difeta, difkap, difnu, dtmax, dtmin, enscale, escale, f_exp_counter, intfac, istop, ldif, ldifexp, lm2phy_counter, lscale, map_function, mpi_packing, mpi_transp, n_lscale, n_time_steps, n_tscale, nl_counter, phy2lm_counter, polo_flow_eq, pscale, run_time_limit, solve_counter, td_counter, tend, time_scheme, timestart, tscale, vscale

Routines:

finalize_num_param(), initialize_num_param()

Needed modules

Variables

  • num_param/alffac [real,public]

    Value to scale Alfen-velocity in courant criteria

  • num_param/alph1 [real,public]

    Input parameter for non-linear map to define degree of spacing (0.0:2.0)

  • num_param/alph2 [real,public]

    Input parameter for non-linear map to define central point of different spacing (-1.0:1.0)

  • num_param/alpha [real,public]

    Weight for implicit time step

  • num_param/amstart [real,public]
  • num_param/anelastic_flavour [character(len=72),public]

    version of the anelastic approximation

  • num_param/courfac [real,public]

    Value to scale velocity in courant criteria

  • num_param/dct_counter [timer_type,public]

    Time counter for discrete cosine transforms

  • num_param/delxh2 (*) [real,allocatable/public]

    Auxiliary arrays containing effective Courant grid intervals

  • num_param/delxr2 (*) [real,allocatable/public]

    Auxiliary arrays containing effective Courant grid intervals

  • num_param/difchem [real,public]

    Amplitude of chemical hyperdiffusion

  • num_param/difeta [real,public]

    Amplitude of magnetic hyperdiffusion

  • num_param/difkap [real,public]

    Amplitude of thermal hyperdiffusion

  • num_param/difnu [real,public]

    Amplitude of viscous hyperdiffusion

  • num_param/dtmax [real,public]

    Maximum allowed time step

  • num_param/dtmin [real,public]

    Minimum allowed time step

  • num_param/enscale [real,public]

    Energies scale

  • num_param/escale [real,public]

    Energy scale

  • num_param/f_exp_counter [timer_type,public]

    Time counter for r-der of adv. terms

  • num_param/intfac [real,public]

    Value to re-scale dtMax during simulation

  • num_param/istop [integer,public]

    Variable used in FFT soubroutine

  • num_param/ldif [integer,public]

    Degree where hyperdiffusion starts to act

  • num_param/ldifexp [integer,public]

    Exponent for hyperdiffusion function

  • num_param/lm2phy_counter [timer_type,public]
  • num_param/lscale [real,public]

    Length scale

  • num_param/map_function [character(len=72),public]

    Mapping family: either tangent or arcsin

  • num_param/mpi_packing [character(len=72),public]

    packing the alltoall

  • num_param/mpi_transp [character(len=72),public]

    Form of the MPI transpose (point to point or alltoall)

  • num_param/n_lscale [integer,public]

    Control length scale

  • num_param/n_time_steps [integer,public]

    Total number of time steps requested in the name list

  • num_param/n_tscale [integer,public]

    Control time scale

  • num_param/nl_counter [timer_type,public]
  • num_param/phy2lm_counter [timer_type,public]
  • num_param/polo_flow_eq [character(len=72),public]

    form of the poloidal flow equation: Pressure or Double Curl

  • num_param/pscale [real,public]
  • num_param/run_time_limit [real,public]
  • num_param/solve_counter [timer_type,public]

    Time counter for linear solves

  • num_param/td_counter [timer_type,public]
  • num_param/tend [real,public]

    Numerical time where run should end

  • num_param/time_scheme [character(len=72),public]

    Time scheme

  • num_param/timestart [real,public]

    Numerical time where run should start

  • num_param/tscale [real,public]

    Time scale

  • num_param/vscale [real,public]

    Velocity scale

Subroutines and functions

subroutine  num_param/initialize_num_param()
Called from:

magic

subroutine  num_param/finalize_num_param()
Called from:

magic

phys_param.f90

Description

Module containing the physical parameters

Quick access

Variables:

ampforce, ampstrat, bn, buofac, chemfac, cmbhflux, con_decrate, con_funcwidth, con_lambdamatch, con_lambdaout, con_radratio, conductance_ma, corfac, difexp, dilution_fac, dissnb, ek, ekscaled, ellip_fac_cmb, ellip_fac_icb, ellipticity_cmb, ellipticity_icb, epsc, epsc0, epscxi, epscxi0, epsphase, epss, g0, g1, g2, grunnb, imagcon, imps, impxi, interior_model, kbotb, kbotphi, kbots, kbotv, kbotxi, ktopb, ktopp, ktopphi, ktops, ktopv, ktopxi, lffac, mode, n_imps, n_imps_max, n_impxi, n_impxi_max, n_r_lcr, nvarcond, nvardiff, nvarentropygrad, nvareps, nvarvisc, o_sr, oek, ohmlossfac, opm, opr, osc, peaks, peakxi, penaltyfac, phasedifffac, phis, phixi, po, polind, pr, prec_angle, prmag, r_cut_model, r_lcr, ra, radratio, rascaled, raxi, rho_ratio_ic, rho_ratio_ma, rstrat, sc, sigma_ratio, slopestrat, stef, strat, thetas, thetaxi, thexpnb, thickstrat, tmagcon, tmelt, vischeatfac, widths, widthxi

Needed modules

  • precision_mod: This module controls the precision used in MagIC

Variables

  • physical_parameters/ampforce [real]

    Amplitude of external body force

  • physical_parameters/ampstrat [real]

    stratified Layer

  • physical_parameters/bn [real]

    Normalisation of He burning

  • physical_parameters/buofac [real]

    Ratio of Rayleigh number over Prandtl number

  • physical_parameters/chemfac [real]

    Ratio of comp. Rayleigh number over Schmidt number

  • physical_parameters/cmbhflux [real]

    stratified Layer

  • physical_parameters/con_decrate [real]

    Slope of electrical conductivity profile (nVarCond=2)

  • physical_parameters/con_funcwidth [real]

    nVarCond=1

  • physical_parameters/con_lambdamatch [real]

    Electrical conductivity at con_RadRatio (nVarCond=2)

  • physical_parameters/con_lambdaout [real]

    nVarCond=1

  • physical_parameters/con_radratio [real]

    Transition between branches of electrical conductivity profile (nVarCond=1,2)

  • physical_parameters/conductance_ma [real]

    OC conductivity

  • physical_parameters/corfac [real]

    Inverse of ekScaled

  • physical_parameters/difexp [real]

    Thermal diffusivity variation

  • physical_parameters/dilution_fac [real]

    Omega^2 d/g_top for centrifugal acceleration, named after Chandrasekhar (1987)

  • physical_parameters/dissnb [real]

    Dissipation number

  • physical_parameters/ek [real]

    Ekman number

  • physical_parameters/ekscaled [real]

    \(E\,l^2\)

  • physical_parameters/ellip_fac_cmb [real]

    d/dphi (Y22) * d/dt exp(iomega t) at CMB

  • physical_parameters/ellip_fac_icb [real]

    d/dphi (Y22) * d/dt exp(iomega t) at ICB

  • physical_parameters/ellipticity_cmb [real]

    Ellipticity of CMB, used for libration

  • physical_parameters/ellipticity_icb [real]

    Ellipticity of ICB, used for libration

  • physical_parameters/epsc [real]

    Renormalisation of epsc0

  • physical_parameters/epsc0 [real]

    Internal heat source magnitude

  • physical_parameters/epscxi [real]

    Renormalisation of epsc0Xi

  • physical_parameters/epscxi0 [real]

    Internal chemical heat source magnitude

  • physical_parameters/epsphase [real]

    Cahn number for phase field equatioo

  • physical_parameters/epss [real]

    Deviation from the adiabat

  • physical_parameters/g0 [real]

    Set to 1.0 for constant gravity

  • physical_parameters/g1 [real]

    Set to 1.0 for linear gravity

  • physical_parameters/g2 [real]

    Set to 1.0 for \(1/r^2\) gravity

  • physical_parameters/grunnb [real]

    Grüneisen paramater \(\Gamma=(\gamma-1)/\alpha T\)

  • physical_parameters/imagcon [integer]

    Imposed magnetic field for magnetoconvection, at the boundaries

  • physical_parameters/imps [integer]

    Heat boundary condition

  • physical_parameters/impxi [integer]
  • physical_parameters/interior_model [character(len=72)]

    name of the interior model

  • physical_parameters/kbotb [integer]

    Magnetic boundary condition

  • physical_parameters/kbotphi [integer]

    Boundary conditions for phase field

  • physical_parameters/kbots [integer]

    Entropy boundary condition

  • physical_parameters/kbotv [integer]

    Velocity boundary condition

  • physical_parameters/kbotxi [integer]

    Boundary conditions for chemical composition

  • physical_parameters/ktopb [integer]
  • physical_parameters/ktopp [integer]

    Boundary condition for spherically-symmetric pressure

  • physical_parameters/ktopphi [integer]
  • physical_parameters/ktops [integer]
  • physical_parameters/ktopv [integer]
  • physical_parameters/ktopxi [integer]
  • physical_parameters/lffac [real]

    Inverse of Pr*Ekman

  • physical_parameters/mode [integer]

    Mode of calculation

  • physical_parameters/n_imps [integer]

    Heat boundary condition

  • physical_parameters/n_imps_max [integer,parameter=20]

    Heat boundary condition

  • physical_parameters/n_impxi [integer]
  • physical_parameters/n_impxi_max [integer,parameter=20]
  • physical_parameters/n_r_lcr [integer]

    Number of radial points where conductivity is zero

  • physical_parameters/nvarcond [integer]

    Selection of variable conductivity profile

  • physical_parameters/nvardiff [integer]

    Selection of variable diffusivity profile

  • physical_parameters/nvarentropygrad [integer]

    stratified Layer

  • physical_parameters/nvareps [integer]

    Selection of internal heating profile

  • physical_parameters/nvarvisc [integer]

    Selection of variable viscosity profile

  • physical_parameters/o_sr [real]

    Inverse of sigma_ratio

  • physical_parameters/oek [real]

    Inverse of the Ekman number

  • physical_parameters/ohmlossfac [real]

    Prefactor for Ohmic heating: \(Di\,Pr/(Ra\,E\,Pm^2)\)

  • physical_parameters/opm [real]

    Inverse of magnetic Prandtl number

  • physical_parameters/opr [real]

    Inverse of Prandtl number

  • physical_parameters/osc [real]

    Inverse of Schmidt number (i.e. chemical Prandtl number)

  • physical_parameters/peaks (20) [real]
  • physical_parameters/peakxi (20) [real]
  • physical_parameters/penaltyfac [real]

    Factor that enters the penalty method in the NS equations

  • physical_parameters/phasedifffac [real]

    Diffusion term of phase field

  • physical_parameters/phis (20) [real]
  • physical_parameters/phixi (20) [real]
  • physical_parameters/po [real]

    Poincaré number

  • physical_parameters/polind [real]

    polytropic index

  • physical_parameters/pr [real]

    Prandtl number

  • physical_parameters/prec_angle [real]

    Precession angle

  • physical_parameters/prmag [real]

    magnetic Prandtl number

  • physical_parameters/r_cut_model [real]

    Percentage on the inner part of the interior model to be used

  • physical_parameters/r_lcr [real]

    Radius beyond which conductivity is zero

  • physical_parameters/ra [real]

    Rayleigh number

  • physical_parameters/radratio [real]

    aspect ratio

  • physical_parameters/rascaled [real]

    \(Ra\,l^3\)

  • physical_parameters/raxi [real]

    Chemical composition-based Rayleigh number

  • physical_parameters/rho_ratio_ic [real]

    Same density as outer core

  • physical_parameters/rho_ratio_ma [real]

    Same density as outer core

  • physical_parameters/rstrat [real]

    stratified Layer

  • physical_parameters/sc [real]

    Schmidt number (i.e. chemical Prandtl number)

  • physical_parameters/sigma_ratio [real]

    Value of IC rotation

  • physical_parameters/slopestrat [real]

    stratified Layer

  • physical_parameters/stef [real]

    Stefan number

  • physical_parameters/strat [real]

    number of density scale heights

  • physical_parameters/thetas (20) [real]
  • physical_parameters/thetaxi (20) [real]
  • physical_parameters/thexpnb [real]

    Thermal expansion * temperature \(\alpha_0 T_0\)

  • physical_parameters/thickstrat [real]

    stratified Layer

  • physical_parameters/tmagcon [real]

    Time for magnetoconvection calculation

  • physical_parameters/tmelt [real]

    Melting temperature

  • physical_parameters/vischeatfac [real]

    Prefactor for viscous heating: \(Di\,Pr/Ra\)

  • physical_parameters/widths (20) [real]
  • physical_parameters/widthxi (20) [real]

logic.f90

Description

Module containing the logicals that control the run

Quick access

Variables:

l_2d_rms, l_2d_spectra, l_ab1, l_adv_curl, l_am, l_anel, l_anelastic_liquid, l_average, l_b_nl_cmb, l_b_nl_icb, l_bridge_step, l_centrifuge, l_chemical_conv, l_cmb_field, l_cond_ic, l_cond_ma, l_conv, l_conv_nl, l_corr, l_correct_ame, l_correct_amz, l_corrmov, l_cour_alf_damp, l_double_curl, l_drift, l_dt_cmb_field, l_dtb, l_dtbmovie, l_dtrmagspec, l_earth_likeness, l_energy_modes, l_finite_diff, l_fluxprofs, l_full_sphere, l_geosmovie, l_heat, l_heat_nl, l_hel, l_hemi, l_ht, l_htmovie, l_iner, l_isothermal, l_lcr, l_mag, l_mag_kin, l_mag_lf, l_mag_nl, l_mag_par_solve, l_movie, l_movie_ic, l_movie_oc, l_newmap, l_non_adia, l_non_rot, l_onset, l_packed_transp, l_par, l_parallel_solve, l_perppar, l_phase_field, l_power, l_precession, l_pressgraph, l_probe, l_r_field, l_r_fieldt, l_r_fieldxi, l_rmagspec, l_rms, l_rot_ic, l_rot_ma, l_runtimelimit, l_save_out, l_scramble_theta, l_single_matrix, l_spec_avg, l_sric, l_srma, l_store_frame, l_temperature_diff, l_to, l_tomovie, l_update_b, l_update_s, l_update_v, l_update_xi, l_var_l, l_viscbccalc, l_z10mat, lverbose

Variables

  • logic/l_2d_rms [logical]

    Switch for storing of time-averaged r-l-spectra of forces

  • logic/l_2d_spectra [logical]

    Switch for storing of r-l-spectra

  • logic/l_ab1 [logical]

    1st order Adams Bashforth

  • logic/l_adv_curl [logical]

    Use curl{u}times u for the advection

  • logic/l_am [logical]

    Switch for angular momentum calculation

  • logic/l_anel [logical]

    Switch for anelastic calculation

  • logic/l_anelastic_liquid [logical]

    Switch for anelastic liquid calculation

  • logic/l_average [logical]

    Switch for calculation of time-averages

  • logic/l_b_nl_cmb [logical]

    Switch for non-linear magnetic field at OC

  • logic/l_b_nl_icb [logical]

    Switch for non-linear magnetic field at IC

  • logic/l_bridge_step [logical]

    Used to bridge missing steps when changing the time integrator

  • logic/l_centrifuge [logical]

    Compute centrifugal acceleration

  • logic/l_chemical_conv [logical]

    Switch for chemical convection

  • logic/l_cmb_field [logical]

    Switch for Bcoef files for gauss coefficients

  • logic/l_cond_ic [logical]

    Switch for conducting IC

  • logic/l_cond_ma [logical]

    Switch for conducting OC

  • logic/l_conv [logical]

    Switch off convection

  • logic/l_conv_nl [logical]

    Switch off non-linear convection terms

  • logic/l_corr [logical]

    Switch off rotation

  • logic/l_correct_ame [logical]

    Switch for correction of equatorial angular mom.

  • logic/l_correct_amz [logical]

    Switch for correction of axial angular momentum

  • logic/l_corrmov [logical]

    Switch for North/south correlation movie (see s_getEgeos.f)

  • logic/l_cour_alf_damp [logical]

    Modified Alfven Courant condition based on Christensen et al., GJI, 1999 (.true. by default)

  • logic/l_double_curl [logical]

    Use the double-curl of the NS equation to get the poloidal equation

  • logic/l_drift [logical]

    Switch for drift rates calculation

  • logic/l_dt_cmb_field [logical]

    Switch for Bcoef files for secular variation of gauss coefs.

  • logic/l_dtb [logical]

    Switch to reserve memory for dtB movie

  • logic/l_dtbmovie [logical]

    Switch for dtB movie

  • logic/l_dtrmagspec [logical]

    Switch for magnetic spectra at different depths at movie output times

  • logic/l_earth_likeness [logical]

    Compute the Earth-likeness of the CMB field following Christensen et al., EPSL, 2010

  • logic/l_energy_modes [logical]

    Switch for calculation of distribution of energies over m’s

  • logic/l_finite_diff [logical]

    Use finite differences for the radial scheme

  • logic/l_fluxprofs [logical]

    Switch for calculation of radial profiles of flux contributions

  • logic/l_full_sphere [logical]

    Set to .true. if this is a full sphere calculation

  • logic/l_geosmovie [logical]

    A flag to trigger the production of geos movies

  • logic/l_heat [logical]

    Switch off heat terms calculation

  • logic/l_heat_nl [logical]

    Switch off non-linear heat terms calculation

  • logic/l_hel [logical]

    Switch for helicity calculation, output in misc.TAG

  • logic/l_hemi [logical]

    Compute North/South asymmetry of energies

  • logic/l_ht [logical]

    Switch for heat flux movie frame output

  • logic/l_htmovie [logical]

    Switch for heat flux movie output

  • logic/l_iner [logical]

    Switch for inertial modes calculation

  • logic/l_isothermal [logical]

    Switch for isothermal calculation

  • logic/l_lcr [logical]

    Switch for zero electrical conductivity beyond r_LCR

  • logic/l_mag [logical]

    Switch off magnetic terms calculation

  • logic/l_mag_kin [logical]

    Switch related for kinematic dynamo

  • logic/l_mag_lf [logical]

    Switch off Lorentz force term

  • logic/l_mag_nl [logical]

    Switch off non-linear magnetic terms calculation

  • logic/l_mag_par_solve [logical]

    Can be remove once inner core has also been ported

  • logic/l_movie [logical]

    Switch for recording of movie files

  • logic/l_movie_ic [logical]

    Switch for recording of movie files for IC

  • logic/l_movie_oc [logical]

    Switch for recording of movie files for OC

  • logic/l_newmap [logical]

    Switch for non-linear mapping (see Bayliss and Turkel, 1990)

  • logic/l_non_adia [logical]

    Switch in case the reference state is non-adiabatic

  • logic/l_non_rot [logical]

    Switch to non-rotating

  • logic/l_onset [logical]

    A flag to turn MagIC into a linear stability analysis code

  • logic/l_packed_transp [logical]

    Pack or don’t pack MPI transposes

  • logic/l_par [logical]

    Switch for additional parameters calculation in s_getEgeos.f

  • logic/l_parallel_solve [logical]

    Use R-distributed parallel solver (work only for F.D.)

  • logic/l_perppar [logical]

    Switch for calculation of of kinetic energy perpendicular+parallel to the rotation axis

  • logic/l_phase_field [logical]

    Switch when phase field is used

  • logic/l_power [logical]

    Switch for power budget terms calculation

  • logic/l_precession [logical]

    Use precession

  • logic/l_pressgraph [logical]

    Store pressure in graphic files

  • logic/l_probe [logical]

    Switch for artifical sensors

  • logic/l_r_field [logical]

    Switch for radial coefficients

  • logic/l_r_fieldt [logical]

    Switch for radial T coefficients

  • logic/l_r_fieldxi [logical]

    Switch for radial Xi coefficients

  • logic/l_rmagspec [logical]

    Switch for magnetic spectra at different depths at log times

  • logic/l_rms [logical]

    Switch for RMS force balances calculation

  • logic/l_rot_ic [logical]

    Switch off IC rotation

  • logic/l_rot_ma [logical]

    Switch off OC rotation

  • logic/l_runtimelimit [logical]

    Switch for absolute time limit of the run

  • logic/l_save_out [logical]

    Switch off outputs

  • logic/l_scramble_theta [logical]

    A flag to set theta scrambling

  • logic/l_single_matrix [logical]

    In case entropy, w and P are solved at once implicitely

  • logic/l_spec_avg [logical]

    Switch for calculation of time-averaged spectra

  • logic/l_sric [logical]

    Switch to rotating IC with prescribed rot. rate

  • logic/l_srma [logical]

    Switch to rotating OC with prescribed rot. rate

  • logic/l_store_frame [logical]

    Switch for storing movie frames

  • logic/l_temperature_diff [logical]

    diffusion of temperature instead of entropy

  • logic/l_to [logical]

    Switch for TO output in TOnhs.TAG, TOshs.TAG

  • logic/l_tomovie [logical]

    Switch for TO movie output

  • logic/l_update_b [logical]

    Switch off magnetic field update

  • logic/l_update_s [logical]

    Switch off entropy update

  • logic/l_update_v [logical]

    Switch off velocity field update

  • logic/l_update_xi [logical]

    Switch off update of chemical composition

  • logic/l_var_l [logical]

    When set to .true., degree varies with radius

  • logic/l_viscbccalc [logical]

    Switch for dissipation layer for stress-free BCs plots

  • logic/l_z10mat [logical]

    Switch for solid body rotation

  • logic/lverbose [logical]

    Switch for detailed information about run progress

fields.f90

Description

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.

Quick access

Variables:

aj_ic, aj_ic_lmloc, aj_lmloc, aj_rloc, b_ic, b_ic_lmloc, b_lmloc, b_rloc, bodyforce_lmloc, bodyforce_rloc, db_ic, db_ic_lmloc, db_lmloc, db_rloc, ddb_ic, ddb_ic_lmloc, ddb_lmloc, ddb_rloc, ddj_ic_lmloc, ddj_lmloc, ddj_rloc, ddw_lmloc, ddw_rloc, dj_ic, dj_ic_lmloc, dj_lmloc, dj_rloc, dp_lmloc, dp_rloc, ds_lmloc, ds_rloc, dw_lmloc, dw_rloc, dxi_lmloc, dxi_rloc, dz_lmloc, dz_rloc, field_lmloc_container, field_rloc_container, flow_lmloc_container, flow_rloc_container, omega_ic, omega_ma, p_lmloc, p_rloc, phi_lmloc, phi_rloc, press_lmloc_container, press_rloc_container, s_lmloc, s_lmloc_container, s_rloc, s_rloc_container, w_lmloc, w_rloc, work_lmloc, xi_lmloc, xi_lmloc_container, xi_rloc, xi_rloc_container, z_lmloc, z_rloc

Routines:

finalize_fields(), initialize_fields()

Needed modules

Variables

  • fields/aj_ic (*,*) [complex,allocatable/public]
  • fields/aj_ic_lmloc (*,*) [complex,allocatable/public]
  • fields/aj_lmloc (*,*) [complex,pointer/public]
  • fields/aj_rloc (*,*) [complex,pointer/public]
  • fields/b_ic (*,*) [complex,allocatable/public]
  • fields/b_ic_lmloc (*,*) [complex,allocatable/public]
  • fields/b_lmloc (*,*) [complex,pointer/public]
  • fields/b_rloc (*,*) [complex,pointer/public]
  • fields/bicb (*) [complex,allocatable/public]
  • fields/bodyforce_lmloc (*,*) [complex,allocatable/public]
  • fields/bodyforce_rloc (*,*) [complex,allocatable/public]
  • fields/db_ic (*,*) [complex,allocatable/public]
  • fields/db_ic_lmloc (*,*) [complex,allocatable/public]
  • fields/db_lmloc (*,*) [complex,pointer/public]
  • fields/db_rloc (*,*) [complex,pointer/public]
  • fields/ddb_ic (*,*) [complex,allocatable/public]
  • fields/ddb_ic_lmloc (*,*) [complex,allocatable/public]
  • fields/ddb_lmloc (*,*) [complex,pointer/public]
  • fields/ddb_rloc (*,*) [complex,pointer/public]
  • fields/ddj_ic_lmloc (*,*) [complex,allocatable/public]
  • fields/ddj_lmloc (*,*) [complex,pointer/public]
  • fields/ddj_rloc (*,*) [complex,allocatable/public]
  • fields/ddw_lmloc (*,*) [complex,pointer/public]
  • fields/ddw_rloc (*,*) [complex,pointer/public]
  • fields/dj_ic (*,*) [complex,allocatable/public]
  • fields/dj_ic_lmloc (*,*) [complex,allocatable/public]
  • fields/dj_lmloc (*,*) [complex,pointer/public]
  • fields/dj_rloc (*,*) [complex,pointer/public]
  • fields/dp_lmloc (*,*) [complex,pointer/public]
  • fields/dp_rloc (*,*) [complex,pointer/public]
  • fields/ds_lmloc (*,*) [complex,pointer/public]
  • fields/ds_rloc (*,*) [complex,pointer/public]
  • fields/dw_lmloc (*,*) [complex,pointer/public]
  • fields/dw_rloc (*,*) [complex,pointer/public]
  • fields/dxi_lmloc (*,*) [complex,pointer/public]
  • fields/dxi_rloc (*,*) [complex,pointer/public]
  • fields/dz_lmloc (*,*) [complex,pointer/public]
  • fields/dz_rloc (*,*) [complex,pointer/public]
  • fields/field_lmloc_container (*,*,*) [complex,target/allocatable/public]
  • fields/field_rloc_container (*,*,*) [complex,target/allocatable/public]
  • fields/flow_lmloc_container (*,*,*) [complex,target/allocatable/public]
  • fields/flow_rloc_container (*,*,*) [complex,target/allocatable/public]
  • fields/omega_ic [real,public]
  • fields/omega_ma [real,public]
  • fields/p_lmloc (*,*) [complex,pointer/public]
  • fields/p_rloc (*,*) [complex,pointer/public]
  • fields/phi_lmloc (*,*) [complex,allocatable/public]
  • fields/phi_rloc (*,*) [complex,allocatable/public]
  • fields/press_lmloc_container (*,*,*) [complex,target/allocatable/public]
  • fields/press_rloc_container (*,*,*) [complex,target/allocatable/public]
  • fields/s_lmloc (*,*) [complex,pointer/public]
  • fields/s_lmloc_container (*,*,*) [complex,target/allocatable/public]
  • fields/s_rloc (*,*) [complex,pointer/public]
  • fields/s_rloc_container (*,*,*) [complex,target/allocatable/public]
  • fields/w_lmloc (*,*) [complex,pointer/public]
  • fields/w_rloc (*,*) [complex,pointer/public]
  • fields/work_lmloc (*,*) [complex,allocatable/public]

    Needed in update routines

  • fields/xi_lmloc (*,*) [complex,pointer/public]
  • fields/xi_lmloc_container (*,*,*) [complex,target/allocatable/public]
  • fields/xi_rloc (*,*) [complex,pointer/public]
  • fields/xi_rloc_container (*,*,*) [complex,target/allocatable/public]
  • fields/z_lmloc (*,*) [complex,pointer/public]
  • fields/z_rloc (*,*) [complex,pointer/public]

Subroutines and functions

subroutine  fields/initialize_fields()

This subroutine allocates the different fields used in MagIC

Called from:

magic

subroutine  fields/finalize_fields()

This subroutine deallocates the field arrays used in MagIC

Called from:

magic

dt_fieldsLast.f90

Description

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.

Quick access

Variables:

dbdt, dbdt_cmb_lmloc, dbdt_ic, dbdt_lmloc_container, dbdt_rloc, dbdt_rloc_container, dflowdt_lmloc_container, dflowdt_rloc_container, djdt, djdt_ic, djdt_rloc, domega_ic_dt, domega_ma_dt, dpdt, dpdt_rloc, dphidt, dphidt_rloc, dsdt, dsdt_lmloc_container, dsdt_rloc, dsdt_rloc_container, dvsrlm_lmloc, dvsrlm_rloc, dvxbhlm_lmloc, dvxbhlm_rloc, dvxirlm_lmloc, dvxirlm_rloc, dvxvhlm_lmloc, dvxvhlm_rloc, dwdt, dwdt_rloc, dxidt, dxidt_lmloc_container, dxidt_rloc, dxidt_rloc_container, dzdt, dzdt_rloc, lorentz_torque_ic_dt, lorentz_torque_ma_dt

Routines:

finalize_fieldslast(), initialize_fieldslast()

Needed modules

Variables

  • fieldslast/dbdt [type_tarray,public]
  • fieldslast/dbdt_cmb_lmloc (*) [complex,allocatable/public]
  • fieldslast/dbdt_ic [type_tarray,public]
  • fieldslast/dbdt_lmloc_container (*,*,*,*) [complex,target/allocatable/public]
  • fieldslast/dbdt_rloc (*,*) [complex,pointer/public]
  • fieldslast/dbdt_rloc_container (*,*,*) [complex,target/allocatable/public]
  • fieldslast/dflowdt_lmloc_container (*,*,*,*) [complex,target/allocatable/public]
  • fieldslast/dflowdt_rloc_container (*,*,*) [complex,target/allocatable/public]
  • fieldslast/djdt [type_tarray,public]
  • fieldslast/djdt_ic [type_tarray,public]
  • fieldslast/djdt_rloc (*,*) [complex,pointer/public]
  • fieldslast/domega_ic_dt [type_tscalar,public]
  • fieldslast/domega_ma_dt [type_tscalar,public]
  • fieldslast/dpdt [type_tarray,public]
  • fieldslast/dpdt_rloc (*,*) [complex,pointer/public]
  • fieldslast/dphidt [type_tarray,public]
  • fieldslast/dphidt_rloc (*,*) [complex,allocatable/public]
  • fieldslast/dsdt [type_tarray,public]
  • fieldslast/dsdt_lmloc_container (*,*,*,*) [complex,target/allocatable/public]
  • fieldslast/dsdt_rloc (*,*) [complex,pointer/public]
  • fieldslast/dsdt_rloc_container (*,*,*) [complex,target/allocatable/public]
  • fieldslast/dvsrlm_lmloc (*,*,*) [complex,pointer/public]
  • fieldslast/dvsrlm_rloc (*,*) [complex,pointer/public]
  • fieldslast/dvxbhlm_lmloc (*,*,*) [complex,pointer/public]
  • fieldslast/dvxbhlm_rloc (*,*) [complex,pointer/public]
  • fieldslast/dvxirlm_lmloc (*,*,*) [complex,pointer/public]
  • fieldslast/dvxirlm_rloc (*,*) [complex,pointer/public]
  • fieldslast/dvxvhlm_lmloc (*,*,*) [complex,pointer/public]
  • fieldslast/dvxvhlm_rloc (*,*) [complex,pointer/public]
  • fieldslast/dwdt [type_tarray,public]
  • fieldslast/dwdt_rloc (*,*) [complex,pointer/public]
  • fieldslast/dxidt [type_tarray,public]
  • fieldslast/dxidt_lmloc_container (*,*,*,*) [complex,target/allocatable/public]
  • fieldslast/dxidt_rloc (*,*) [complex,pointer/public]
  • fieldslast/dxidt_rloc_container (*,*,*) [complex,target/allocatable/public]
  • fieldslast/dzdt [type_tarray,public]
  • fieldslast/dzdt_rloc (*,*) [complex,pointer/public]
  • fieldslast/lorentz_torque_ic_dt [type_tscalar,public]
  • fieldslast/lorentz_torque_ma_dt [type_tscalar,public]

Subroutines and functions

subroutine  fieldslast/initialize_fieldslast(nold, nexp, nimp)

This routine defines all the arrays needed to time advance MagIC

Parameters:
  • nold [integer ,in] :: Number of storage of the old state

  • nexp [integer ,in] :: Number of explicit states

  • nimp [integer ,in] :: Number of implicit states

Called from:

magic

subroutine  fieldslast/finalize_fieldslast()

Memory deallocation of d?dt arrays.

Called from:

magic

output_data.f90

Description

This module contains the parameters for output control

Quick access

Variables:

dt_cmb, dt_graph, dt_log, dt_movie, dt_pot, dt_probe, dt_r_field, dt_rst, dt_spec, dt_to, dt_tomovie, l_geo, l_max_cmb, l_max_comp, l_max_r, log_file, lp_file, m_max_modes, n_cmb_step, n_cmbs, n_coeff_r, n_coeff_r_max, n_graph_step, n_graphs, n_log_file, n_log_step, n_logs, n_movie_frames, n_movie_step, n_pot_step, n_pots, n_probe_out, n_probe_step, n_r_array, n_r_field_step, n_r_fields, n_r_step, n_rst_step, n_rsts, n_spec_step, n_specs, n_stores, n_t_cmb, n_t_graph, n_t_log, n_t_movie, n_t_pot, n_t_probe, n_t_r_field, n_t_rst, n_t_spec, n_t_to, n_t_tomovie, n_time_hits, n_to_step, n_tomovie_frames, n_tomovie_step, n_tos, rcut, rdea, runid, sdens, t_cmb, t_cmb_start, t_cmb_stop, t_graph, t_graph_start, t_graph_stop, t_log, t_log_start, t_log_stop, t_movie, t_movie_start, t_movie_stop, t_pot, t_pot_start, t_pot_stop, t_probe, t_probe_start, t_probe_stop, t_r_field, t_r_field_start, t_r_field_stop, t_rst, t_rst_start, t_rst_stop, t_spec, t_spec_start, t_spec_stop, t_to, t_to_start, t_to_stop, t_tomovie, t_tomovie_start, t_tomovie_stop, tag, zdens

Needed modules

  • precision_mod: This module controls the precision used in MagIC

Variables

  • output_data/dt_cmb [real,public]
  • output_data/dt_graph [real,public]
  • output_data/dt_log [real,public]
  • output_data/dt_movie [real,public]
  • output_data/dt_pot [real,public]
  • output_data/dt_probe [real,public]
  • output_data/dt_r_field [real,public]
  • output_data/dt_rst [real,public]
  • output_data/dt_spec [real,public]
  • output_data/dt_to [real,public]
  • output_data/dt_tomovie [real,public]
  • output_data/l_geo [integer,public]

    max degree for geomagnetic field seen on Earth

  • output_data/l_max_cmb [integer,public]
  • output_data/l_max_comp [integer,public]

    Maximum spherical harmonic degree to estimate Earth-likeness

  • output_data/l_max_r [integer,public]
  • output_data/log_file [character(len=72),public]
  • output_data/lp_file [character(len=72),public]
  • output_data/m_max_modes [integer,public]
  • output_data/n_cmb_step [integer,public]
  • output_data/n_cmbs [integer,public]
  • output_data/n_coeff_r (*) [integer,allocatable/public]
  • output_data/n_coeff_r_max [integer,public]
  • output_data/n_graph_step [integer,public]
  • output_data/n_graphs [integer,public]
  • output_data/n_log_file [integer,public]
  • output_data/n_log_step [integer,public]
  • output_data/n_logs [integer,public]
  • output_data/n_movie_frames [integer,public]
  • output_data/n_movie_step [integer,public]
  • output_data/n_pot_step [integer,public]
  • output_data/n_pots [integer,public]
  • output_data/n_probe_out [integer,public]
  • output_data/n_probe_step [integer,public]
  • output_data/n_r_array (100) [integer,public]
  • output_data/n_r_field_step [integer,public]
  • output_data/n_r_fields [integer,public]
  • output_data/n_r_step [integer,public]
  • output_data/n_rst_step [integer,public]
  • output_data/n_rsts [integer,public]
  • output_data/n_spec_step [integer,public]
  • output_data/n_specs [integer,public]
  • output_data/n_stores [integer,public]
  • output_data/n_t_cmb [integer,public]
  • output_data/n_t_graph [integer,public]
  • output_data/n_t_log [integer,public]
  • output_data/n_t_movie [integer,public]
  • output_data/n_t_pot [integer,public]
  • output_data/n_t_probe [integer,public]
  • output_data/n_t_r_field [integer,public]
  • output_data/n_t_rst [integer,public]
  • output_data/n_t_spec [integer,public]
  • output_data/n_t_to [integer,public]
  • output_data/n_t_tomovie [integer,public]
  • output_data/n_time_hits [integer,parameter=5000]
  • output_data/n_to_step [integer,public]
  • output_data/n_tomovie_frames [integer,public]
  • output_data/n_tomovie_step [integer,public]
  • output_data/n_tos [integer,public]
  • output_data/rcut [real,public]
  • output_data/rdea [real,public]
  • output_data/runid [character(len=64),public]
  • output_data/sdens [real,public]

    Density in s when using z-integration

  • output_data/t_cmb (5000) [real,public]
  • output_data/t_cmb_start [real,public]
  • output_data/t_cmb_stop [real,public]
  • output_data/t_graph (5000) [real,public]
  • output_data/t_graph_start [real,public]
  • output_data/t_graph_stop [real,public]
  • output_data/t_log (5000) [real,public]
  • output_data/t_log_start [real,public]
  • output_data/t_log_stop [real,public]
  • output_data/t_movie (5000) [real,public]
  • output_data/t_movie_start [real,public]
  • output_data/t_movie_stop [real,public]
  • output_data/t_pot (5000) [real,public]
  • output_data/t_pot_start [real,public]
  • output_data/t_pot_stop [real,public]
  • output_data/t_probe (5000) [real,public]
  • output_data/t_probe_start [real,public]
  • output_data/t_probe_stop [real,public]
  • output_data/t_r_field (5000) [real,public]
  • output_data/t_r_field_start [real,public]
  • output_data/t_r_field_stop [real,public]
  • output_data/t_rst (5000) [real,public]
  • output_data/t_rst_start [real,public]
  • output_data/t_rst_stop [real,public]
  • output_data/t_spec (5000) [real,public]
  • output_data/t_spec_start [real,public]
  • output_data/t_spec_stop [real,public]
  • output_data/t_to (5000) [real,public]
  • output_data/t_to_start [real,public]
  • output_data/t_to_stop [real,public]
  • output_data/t_tomovie (5000) [real,public]
  • output_data/t_tomovie_start [real,public]
  • output_data/t_tomovie_stop [real,public]
  • output_data/tag [character(len=55),public]
  • output_data/zdens [real,public]

    Density in z when using z-integration

constants.f90

Description

module containing constants and parameters used in the code.

Quick access

Variables:

c_dt_z10_ic, c_dt_z10_ma, c_lorentz_ic, c_lorentz_ma, c_moi_ic, c_moi_ma, c_moi_oc, c_z10_omega_ic, c_z10_omega_ma, ci, codeversion, cos36, cos72, four, half, mass, one, osq4pi, pi, sin36, sin60, sin72, sq4pi, surf_cmb, third, three, two, vol_ic, vol_oc, y10_norm, y11_norm, zero

Needed modules

  • precision_mod: This module controls the precision used in MagIC

Variables

  • constants/c_dt_z10_ic [real]
  • constants/c_dt_z10_ma [real]
  • constants/c_lorentz_ic [real]
  • constants/c_lorentz_ma [real]
  • constants/c_moi_ic [real]

    Moment of inertia of the inner core

  • constants/c_moi_ma [real]

    Moment of inertia of the mantle

  • constants/c_moi_oc [real]

    Moment of inertia of the outer core

  • constants/c_z10_omega_ic [real]
  • constants/c_z10_omega_ma [real]
  • constants/ci [complex,parameter=(0.0_cp,1.0_cp)]
  • constants/codeversion [character(len=4),parameter='6.2']
  • constants/cos36 [real,parameter=cos(36.0_cp*pi/180.0_cp)]
  • constants/cos72 [real,parameter=cos(72.0_cp*pi/180.0_cp)]
  • constants/four [real,parameter=4.0_cp]

    4

  • constants/half [real,parameter=0.5_cp]

    0.5

  • constants/mass [real]

    Mass of the outer core

  • constants/one [real,parameter=1.0_cp]

    1

  • constants/osq4pi [real,parameter=1.0_cp/sq4pi]
  • constants/pi [real,parameter=4.0_cp*atan(1.0_cp)]
  • constants/sin36 [real,parameter=sin(36.0_cp*pi/180.0_cp)]
  • constants/sin60 [real,parameter=0.5_cp*sqrt(3.0_cp)]
  • constants/sin72 [real,parameter=sin(72.0_cp*pi/180.0_cp)]
  • constants/sq4pi [real,parameter=sqrt(4.0_cp*pi)]

    \(1/\sqrt{4\pi}\)

  • constants/surf_cmb [real]

    Outer boundary surface

  • constants/third [real,parameter=1.0]
  • constants/three [real,parameter=3.0_cp]

    1/3

  • constants/two [real,parameter=2.0_cp]

    2

  • constants/vol_ic [real]

    Volume of the inner core

  • constants/vol_oc [real]

    Volume of the outer core

  • constants/y10_norm [real]
  • constants/y11_norm [real]
  • constants/zero [complex,parameter=(0.0_cp,0.0_cp)]

special.f90

Description

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 modes

Quick access

Variables:

amp_curr, amp_imp, amp_mode_ic, amp_mode_ma, bic, bmax_imp, expo_imp, fac_loop, l_curr, l_imp, le, lgrenoble, loopradratio, m_mode_ic, m_mode_ma, mode_symm_ic, mode_symm_ma, n_imp, omega_mode_ic, omega_mode_ma, rrmp

Needed modules

  • precision_mod: This module controls the precision used in MagIC

Variables

  • special/amp_curr [real,public]

    Amplitude of magnetic field of current loop to be scaled by Lehnert

  • special/amp_imp [real,public]

    Amplitude of the time varying osc

  • special/amp_mode_ic [real,public]
  • special/amp_mode_ma [real,public]

    Amplitude of forcing

  • special/bic [real,public]
  • special/bmax_imp [real,public]

    Location of maximum in g_ext/g_int

  • special/expo_imp [real,public]

    Exponent for decay

  • special/fac_loop (*) [real,allocatable/public]

    Array of factors for computing magnetic field for loop

  • special/l_curr [logical,public]

    Switch for current loop at the equator

  • special/l_imp [integer,public]

    Mode of external field (dipole,quadrupole etc.)

  • special/le [real,public]

    Lehnert number defined by the magnetic field at the centre

  • special/lgrenoble [logical,public]
  • special/loopradratio [real,public]

    Radius ratio of outer boundary/current loop

  • special/m_mode_ic [integer,public]
  • special/m_mode_ma [integer,public]

    Order of forcing

  • special/mode_symm_ic [integer,public]
  • special/mode_symm_ma [integer,public]

    Symmetry of forcing: 1 : eq symm, 0 : eq antisymm

  • special/n_imp [integer,public]

    Controls external field model

  • special/omega_mode_ic [real,public]
  • special/omega_mode_ma [real,public]

    Frequency of forcing

  • special/rrmp [real,public]

    Magnetopause radius