Non-linear part of the time stepping (radial loop)

radialLoop.f90

Quick access

Routines:

finalize_radialloop(), initialize_radialloop(), radialloopg()

Needed modules

Variables

Subroutines and functions

subroutine  radialloop/initialize_radialloop()
Called from:

magic

Call to:

memwrite()

subroutine  radialloop/finalize_radialloop()
Called from:

magic

subroutine  radialloop/radialloopg(l_graph, l_frame, time, timestage, tscheme, dtlast, ltocalc, ltonext, ltonext2, lhelcalc, lpowercalc, lrmscalc, lpresscalc, lpressnext, lviscbccalc, lfluxprofcalc, lperpparcalc, lgeoscalc, lhemicalc, l_probe_out, dsdt, dwdt, dzdt, dpdt, dxidt, dphidt, dbdt, djdt, dvxvhlm, dvxbhlm, dvsrlm, dvxirlm, lorentz_torque_ic, lorentz_torque_ma, br_vt_lm_cmb, br_vp_lm_cmb, br_vt_lm_icb, br_vp_lm_icb, dtrkc, dthkc)

This subroutine performs the actual time-stepping.

Parameters:
Called from:

step_time()

rIteration.f90

Description

This module is used to define an abstract class for the radial loop

Quick access

Types:

riter_t

Needed modules

Types

  • type  riteration/riter_t

Variables

  • riteration/unknown_interface [private]

rIter.f90

Description

This module actually handles the loop over the radial levels. It contains the spherical harmonic transforms and the operations on the arrays in physical space.

Quick access

Types:

riter_single_t

Variables:

radialloop, transform_to_grid_space, transform_to_lm_space

Needed modules

Types

  • type  riter_mod/riter_single_t
    Type fields:
    • % dtb_arrays [dtb_arrays_t ]

    • % gsa [grid_space_arrays_t ]

    • % nl_lm [nonlinear_lm_t ]

    • % to_arrays [to_arrays_t ]

Variables

  • riter_mod/finalize [private]
  • riter_mod/initialize [private]
  • riter_mod/radialloop [private]
  • riter_mod/transform_to_grid_space [private]
  • riter_mod/transform_to_lm_space [private]

get_nl.f90

Quick access

Types:

general_arrays_t

Types

  • type  general_arrays_mod/general_arrays_t

Variables

get_td.f90

Description

This module is used to finish the assembly of the nonlinear terms in \((\ell,m)\) space. Derivatives along \(\theta\) and \(\phi\) are handled using recurrence relations.

Quick access

Types:

nonlinear_lm_t

Variables:

get_td, lm_min, set_zero

Needed modules

Types

  • type  nonlinear_lm_mod/nonlinear_lm_t
    Type fields:
    • % advplm (*) [complex ,allocatable]

    • % advrlm (*) [complex ,allocatable]

    • % advtlm (*) [complex ,allocatable]

    • % heattermslm (*) [complex ,allocatable]

    • % vsplm (*) [complex ,allocatable]

    • % vstlm (*) [complex ,allocatable]

    • % vxbplm (*) [complex ,allocatable]

    • % vxbrlm (*) [complex ,allocatable]

    • % vxbtlm (*) [complex ,allocatable]

    • % vxiplm (*) [complex ,allocatable]

    • % vxitlm (*) [complex ,allocatable]

Variables

  • nonlinear_lm_mod/finalize [private]
  • nonlinear_lm_mod/get_td [private]
  • nonlinear_lm_mod/initialize [private]
  • nonlinear_lm_mod/lm_min [integer,private]
  • nonlinear_lm_mod/set_zero [private]

nonlinear_bcs.f90

Quick access

Routines:

get_b_nl_bcs(), get_br_v_bcs(), v_rigid_boundary()

Needed modules

Variables

Subroutines and functions

subroutine  nonlinear_bcs/get_br_v_bcs(br, vt, vp, omega, o_r_e_2, o_rho, br_vt_lm, br_vp_lm)

Purpose of this subroutine is to calculate the nonlinear term of the magnetic boundary condition for a conducting mantle or inner core in space (r,lm). Calculation is performed for the theta block:

n_theta_min<=n_theta<=n_theta_min+n_theta_block-1

On input br, vt and vp are given on all phi points and thetas in the specific block. On output the contribution of these grid points to all degree and orders is stored in br_vt_lm and br_vp_lm. Output is [r/sin(theta)*Br*U]=[(0,br_vt_lm,br_vp_lm)]

Parameters:
  • br (*,*) [real ,in] :: \(r^2 B_r\)

  • vt (*,*) [real ,in] :: \(r \sin\theta u_\theta\)

  • vp (*,*) [real ,in] :: \(r \sin\theta u_\phi\)

  • omega [real ,in] :: rotation rate of mantle or IC

  • o_r_e_2 [real ,in] :: \(1/r^2\)

  • o_rho [real ,in] :: \(1/\tilde{\rho}\) (anelastic)

  • br_vt_lm (lm_max) [complex ,inout]

  • br_vp_lm (lm_max) [complex ,inout]

Call to:

spat_to_sphertor()

subroutine  nonlinear_bcs/get_b_nl_bcs(bc, br_vt_lm, br_vp_lm, lm_min_b, lm_max_b, b_nl_bc, aj_nl_bc)

Purpose of this subroutine is to calculate the nonlinear term of the magnetic boundary condition for a conducting mantle in physical space (theta,phi), assuming that the conductance of the mantle is much smaller than that of the core. Calculation is performed for the theta block:

n_theta_min<=n_theta<=n_theta_min+n_theta_block-1
Parameters:
  • bc [character(len=3),in] :: Distinguishes ‘CMB’ and ‘ICB’

  • br_vt_lm (lm_max) [complex ,in] :: \(B_r u_\theta/(r^2\sin^2\theta)\)

  • br_vp_lm (lm_max) [complex ,in] :: \(B_r u_\phi/(r^2\sin^2\theta)\)

  • lm_min_b [integer ,in]

  • lm_max_b [integer ,in] :: limits of lm-block

  • b_nl_bc (1 + lm_max_b - lm_min_b) [complex ,out] :: nonlinear bc for b

  • aj_nl_bc (1 + lm_max_b - lm_min_b) [complex ,out] :: nonlinear bc for aj

Called from:

step_time()

Call to:

abortrun()

subroutine  nonlinear_bcs/v_rigid_boundary(nr, omega, lderiv, vrr, vtr, vpr, cvrr, dvrdtr, dvrdpr, dvtdpr, dvpdpr)

Purpose of this subroutine is to set the velocities and their derivatives at a fixed boundary. While vt is zero, since we only allow for rotation about the \(z\)-axis, vp= r \sin(theta) v_phi = r**2 sin(theta)**2 omega and cvr= r**2 * radial component of (\curl v) = r**2  2 cos(theta) omega

Parameters:
  • nr [integer ,in] :: no of radial grid point

  • omega [real ,in] :: boundary rotation rate

  • lderiv [logical ,in] :: derivatives required ?

  • vrr (*,*) [real ,out]

  • vtr (*,*) [real ,out]

  • vpr (*,*) [real ,out]

  • cvrr (*,*) [real ,out]

  • dvrdtr (*,*) [real ,out]

  • dvrdpr (*,*) [real ,out]

  • dvtdpr (*,*) [real ,out]

  • dvpdpr (*,*) [real ,out]