IO: graphic files, movie files, coeff files and potential files¶
out_graph_file.f90
¶
Description
This module contains the subroutines that store the 3-D graphic files.
Quick access
- Variables
graph_mpi_fh
,info
,n_fields
,n_graph
,n_graph_file
,size_of_header
- Routines
close_graph_file()
,graphout()
,graphout_header()
,graphout_ic()
,graphout_mpi()
,graphout_mpi_header()
,open_graph_file()
Needed modules
parallel_mod
: This module contains the blocking informationprecision_mod
: This module controls the precision used in MagICconstants
(one()
): module containing constants and parameters used in the code.truncation
(lm_maxmag()
,n_r_maxmag()
,n_r_ic_maxmag()
,lm_max()
,n_theta_max()
,n_phi_tot()
,n_r_max()
,l_max()
,minc()
,n_phi_max()
,n_r_ic_max()
,nlat_padded()
): This module defines the grid points and the truncationradial_functions
(r_cmb()
,orho1()
,or1()
,or2()
,r()
,r_icb()
,r_ic()
,o_r_ic()
,o_r_ic2()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)radial_data
(nrstart()
,n_r_cmb()
): This module defines the MPI decomposition in the radial direction.physical_parameters
(ra()
,ek()
,pr()
,prmag()
,radratio()
,sigma_ratio()
,raxi()
,sc()
,stef()
): Module containing the physical parametersnum_param
(vscale()
): Module containing numerical and control parametershorizontal_data
(theta_ord()
,o_sin_theta()
,n_theta_cal2ord()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderlogic
(l_mag()
,l_cond_ic()
,l_pressgraph()
,l_chemical_conv()
,l_heat()
,l_save_out()
,l_phase_field()
): Module containing the logicals that control the runoutput_data
(runid()
,n_log_file()
,log_file()
,tag()
): This module contains the parameters for output control
Variables
-
graphout_mod/
graph_mpi_fh
[integer,private]¶
-
-
graphout_mod/
info
[integer,private]¶
-
-
graphout_mod/
n_fields
[integer,private]¶
-
-
graphout_mod/
n_graph
[integer,private/optional/default=0]¶
-
-
graphout_mod/
n_graph_file
[integer,public]¶
-
-
graphout_mod/
size_of_header
[integer,private]¶
-
Subroutines and functions
-
subroutine
graphout_mod/
open_graph_file
(n_time_step, timescaled, l_ave[, n_graph_handle])¶ - Parameters
n_time_step [integer ,in]
timescaled [real ,in]
l_ave [logical ,in]
- Options
n_graph_handle [integer ,inout,]
- Called from
- Call to
-
subroutine
graphout_mod/
close_graph_file
([n_graph_handle])¶ This routine handles the closing of the Graphic files
- Options
n_graph_handle [integer ,inout,]
- Called from
-
subroutine
graphout_mod/
graphout
(n_r, vr, vt, vp, br, bt, bp, sr, prer, xir, phir[, n_graph_handle])¶ Output of components of velocity, magnetic field vector, entropy and composition for graphic outputs.
- Parameters
n_r [integer ,in] :: radial grod point no.
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
br (*,*) [real ,in]
bt (*,*) [real ,in]
bp (*,*) [real ,in]
sr (*,*) [real ,in]
prer (*,*) [real ,in]
xir (*,*) [real ,in]
phir (*,*) [real ,in]
- Options
n_graph_handle [integer ,in,] :: File index
-
subroutine
graphout_mod/
graphout_header
(time[, n_graph_handle])¶ - Parameters
time [real ,in]
- Options
n_graph_handle [integer ,in,]
-
subroutine
graphout_mod/
graphout_mpi
(n_r, vr, vt, vp, br, bt, bp, sr, prer, xir, phir[, n_graph_handle])¶ MPI version of the graphOut subroutine (use of MPI_IO)
- Parameters
n_r [integer ,in] :: radial grid point no.
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
br (*,*) [real ,in]
bt (*,*) [real ,in]
bp (*,*) [real ,in]
sr (*,*) [real ,in]
prer (*,*) [real ,in]
xir (*,*) [real ,in]
phir (*,*) [real ,in]
- Options
n_graph_handle [integer ,in,]
- Called from
- Call to
-
subroutine
graphout_mod/
graphout_mpi_header
(time[, n_graph_handle])¶ Writes the header of the G file (MPI version)
- Parameters
time [real ,in]
- Options
n_graph_handle [integer ,in,]
- Called from
-
subroutine
graphout_mod/
write_one_field
(dummy, n_graph_handle, n_phis, n_thetas)¶ - Parameters
dummy (*,*) [real ,in]
n_graph_handle [integer ,in]
n_phis [integer ,in]
n_thetas [integer ,in]
-
subroutine
graphout_mod/
graphout_ic
(b_ic, db_ic, aj_ic, bicb[, n_graph_handle])¶ Purpose of this subroutine is to write inner core magnetic field onto graphic output file. If the inner core is insulating (l_cond_ic=false) the potential field is calculated from the outer core field at r=r_cmb. This version assumes that the fields are fully local on the rank which is calling this routine (usually rank 0).
- Parameters
b_ic (*,*) [complex ,in]
db_ic (*,*) [complex ,in]
aj_ic (*,*) [complex ,in]
bicb (*) [complex ,in]
- Options
n_graph_handle [integer ,in,]
- Called from
- Call to
movie.f90
¶
Quick access
- Variables
frames
,licfield
,lstoremov
,movie
,movie_const
,movie_file
,moviedipcolat
,moviediplon
,moviedipstrength
,moviedipstrengthgeo
,n_frame_work
,n_md
,n_movie_const
,n_movie_field_start
,n_movie_field_stop
,n_movie_field_type
,n_movie_fields
,n_movie_fields_ic
,n_movie_fields_max
,n_movie_file
,n_movie_surface
,n_movie_type
,n_movies
,n_movies_max
- Routines
finalize_movie_data()
,get_movie_type()
,initialize_movie_data()
,movie_gather_frames_to_rank0()
Needed modules
parallel_mod
: This module contains the blocking informationprecision_mod
: This module controls the precision used in MagICtruncation
(n_r_max()
,n_theta_max()
,n_phi_max()
,minc()
,n_r_ic_max()
,n_r_tot()
): This module defines the grid points and the truncationlogic
(l_store_frame()
,l_save_out()
,l_movie()
,l_movie_oc()
,l_geosmovie()
,l_movie_ic()
,l_htmovie()
,l_dtbmovie()
): Module containing the logicals that control the runradial_data
(nrstart()
,nrstop()
,n_r_icb()
,n_r_cmb()
,radial_balance()
): This module defines the MPI decomposition in the radial direction.radial_functions
(r_cmb()
,r_icb()
,r()
,r_ic()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)horizontal_data
(theta_ord()
,phi()
,n_theta_ord2cal()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderoutput_data
(n_log_file()
,log_file()
,tag()
): This module contains the parameters for output controlcharmanip
(capitalize()
,delete_string()
,dble2str()
): This module contains several useful routines to manipule character stringsuseful
(logwrite()
,abortrun()
): This module contains several useful routines.constants
(pi()
,one()
): module containing constants and parameters used in the code.mem_alloc
(bytes_allocated()
): This little module is used to estimate the global memory allocation used in MagIC
Variables
-
movie_data/
frames
(*) [real,allocatable/public]¶
-
-
movie_data/
licfield
(30) [logical,public]¶
-
-
movie_data/
lstoremov
(30) [logical,public]¶
-
-
movie_data/
movie
(30) [character(len=80),public]¶ Only for input
-
-
movie_data/
movie_const
(30) [real,public]¶
-
-
movie_data/
movie_file
(30) [character(len=72),public]¶
-
-
movie_data/
moviedipcolat
[real,public]¶
-
-
movie_data/
moviediplon
[real,public]¶
-
-
movie_data/
moviedipstrength
[real,public]¶
-
-
movie_data/
moviedipstrengthgeo
[real,public]¶
-
-
movie_data/
n_frame_work
[integer,public]¶
-
-
movie_data/
n_md
[integer,public]¶
-
-
movie_data/
n_movie_const
(30) [integer,public]¶
-
-
movie_data/
n_movie_field_start
(6,30) [integer,public]¶
-
-
movie_data/
n_movie_field_stop
(6,30) [integer,public]¶
-
-
movie_data/
n_movie_field_type
(6,30) [integer,public]¶
-
-
movie_data/
n_movie_fields
(30) [integer,public]¶
-
-
movie_data/
n_movie_fields_ic
(30) [integer,public]¶
-
-
movie_data/
n_movie_fields_max
[integer,parameter=6]¶ Max no. of fields per movie
-
-
movie_data/
n_movie_file
(30) [integer,public]¶
-
-
movie_data/
n_movie_surface
(30) [integer,public]¶
-
-
movie_data/
n_movie_type
(30) [integer,public]¶
-
-
movie_data/
n_movies
[integer,public]¶
-
-
movie_data/
n_movies_max
[integer,parameter=30]¶ Max no. of different movies
-
Subroutines and functions
-
subroutine
movie_data/
initialize_movie_data
()¶ This routine is called during the initialization of the code. It allows to:
Estimate the required memory imprint and allocate the arrays accordingly
Open the requested movie files
- Called from
- Call to
-
subroutine
movie_data/
get_movie_type
()¶ Purpose of this subroutine is to identify the different movie types from the input string movies(*). Note that generally blanks are not interpreted and that the interpretation is not case sensitive. In general two informations are needed:
A word FIELDINFO that identifies the field to be plotted (e.g. Br for radial magnetic field, see list below) Possible keywords are (optional text in brackets):
B r[adial] : radial magnetic field
B t[heta] : theta component
B p[hi] : azimuthal component
B h[orizontal] : the two horizontal components
B a[ll] : all three components
FIELDLINE[S] : field lines of axisymmetric or FL poloidal field for phi=constant
AX[ISYMMETRIC] B or AB : axisymmetric phi component of the magnetic field for phi=constant
V r[adial] : radial velocity field
V t[heta] : theta component
V p[hi] : azimuthal component
V h[orizontal] : the two horizontal components
V a[ll] : all three components
STREAMLINE[S] : field lines of axisymmetric or SL : poloidal field for phi=constant
AX[ISYMMETRIC] V or AV : axisymmetric phi component of the velocity field for phi=constant
V z : z component of velocity at equator and z component of the vorticity at the equator (closest point to equator)
Vo z : z-component of vorticity
Vo r : r-component of vorticity
Vo p : phi-component of vorticity
T[emperature] : sic
AX[ISYMMETRIC] T or AT : axisymmetric T field for phi=constant
Heat t[ransport]: radial derivative of T
C[omposition] : sic
AX[ISYMMETRIC] C or AC : axisymmetric C field for phi=constant
FL Pro : axisymmetric field line stretching
FL Adv : axisymmetric field line advection
FL Dif : axisymmetric field line diffusion
AB Pro : axisymmetric (tor.) Bphi production
AB Dif : axisymmetric (tor.) Bphi diffusion
Br Pro : Br production
Br Adv : Br advection
Br Dif : Br diffusion
Jr : Jr production
Jr Pro : Jr production + omega effects
Jr Adv : Jr advection
Jr Dif : Jr diffusion
Bz Pol : poloidal Bz
Bz Pol Pro : poloidal Bz production
Bz Pol Adv : poloidal Bz advection
Bz Pol Dif : poloidal Bz diffusion
Jz Tor : poloidal Jz
Jz Tor Pro : poloidal Jz production
Jz Tor Adv : poloidal Jz advection
Jz Tor Dif : poloidal Jz diffusion
Bp Tor : toriodal Bphi
Bp Tor Pro : toriodal Bphi production
Bp Tor Adv : toriodal Bphi advection
Bp Tor Dif : toriodal Bphi diffusion
HEL[ICITY] : sic
AX[ISYMMETRIC HELICITY] or AHEL : axisymmetric helicity
Bt Tor : toroidal Btheta
Pot Tor : toroidal Potential
Pol Fieldlines : toroidal Potential
Br Shear : azimuthal Shear of Br
Lorentz[force] : Lorentz force (only phi component)
Br Inv : Inverse field apperance at CMB
A second information that identifies the coordinate to be kept constant (surface). E.g. r=number for surface r=constant with number given in units of the total core radius or theta/phi=number with number given in degrees Four keywords are also possible:
CMB : core mantle boundary
EQ[UATOR] : equatorial plane
SUR[FACE] : Earth surface (only magnetic field)
3[D] : 3D field throughout the OC [and IC for B]
On output the necessary information is coded into integers and is used in this form by further subroutines:
n_movies = total number of movies
n_type(n_movie) = movie type:
= 1 : Radial magnetic field
= 2 : Theta component of magnetic field
= 3 : Azimuthal magnetic field
= 4 : Horizontal magnetic field
= 5 : Total magnetic field (all compnents)
= 8 : Axisymmetric azimuthal magnetic field (phi=constant)
= 9 : 3d magnetic field
= 11 : Radial velocity field
= 12 : Theta component of velocity field
= 13 : Azimuthal velocity field
= 14 : Horizontal velocity field
= 15 : Total velocity field (all compnents)
= 17 : Scalar field whose contours are the stream lines of the axisymm. poloidal velocity field (phi=constant)
= 18 : Axisymmetric azimuthal velocity field (phi=constant)
= 19 : 3d velocity field
= 20 : z component of vorticity
= 21 : Temperature field
= 22 : radial conv. heat transport
= 23 : helicity
= 24 : axisymmetric helicity
= 25 : phi component of vorticity
= 26 : radial component of vorticity
= 28 : axisymmetric Temperature field for phi=const.
= 29 : 3d temperature field
= 30 : Scalar field whose contours are the fieldlines of the axisymm. poloidal magnetic field (phi=constant)
= 31 : field line production
= 32 : field line advection
= 33 : field line diffusion
= 40 : Axisymmetric azimuthal magnetic field (phi=constant)
= 41 : Axis. Bphi production + omega eff.
= 42 : Axis. Bphi advection
= 43 : Axis. Bphi diffusion
= 44 : Axis. Bphi str.,dyn.,omega,diff.
= 50 : Bz
= 51 : Bz production
= 52 : Bz advection
= 53 : Bz diffusion
= 60 : toroidal Bphi
= 61 : toroidal Bphi production + omega eff.
= 62 : toroidal Bphi advection
= 63 : toroidal Bphi diffusion
= 71 : Br production
= 72 : Br advection
= 73 : Br diffusion
= 80 : Jr
= 81 : Jr production
= 82 : Jr advection
= 83 : Jr diffusion
= 90 : poloidal Jz pol.
= 91 : poloidal Jz pol. production
= 92 : poloidal Jz advection
= 93 : poloidal Jz diffusion
= 94 : z component of velovity
= 95 : toroidal Btheta
= 96 : toroidal Potential
= 97 : Function for Poloidal Fieldlines
= 98 : azimuthal shear of Br
= 99 : phi component of Lorentz force
=101 : Stress fields
=102 : Force fields
=103 : Br Inverse appearence at CMB
=110 : radial heat flow
=111 : Vz and Vorz north/south correlation
=112 : axisymm dtB tersm for Br and Bp
=114 : Cylindrically radial magnetic field
=115 : Composition field
=116 : axisymmetric Vs
=117 : axisymmetric Composition field
=118 : axisymmetric phase field
=121 : phase field for phi=const.
n_movie_surface(n_movie) = defines surface
n_movie_surface = 1 : r=constant:
2 : theta=constant
3 : phi=constant
-1 : r=constant, Earth surface
0 : 3d volume
n_movie_fields(n_movie) = no. of fields for outer core
n_movie_fields_ic(n_movie) = no. of fields for inner core
n_movie_field_type(n_field,n_movie) = defines field
n_movie_field_type:
= 1 : radial magnetic field
= 2 : theta comp. of the magnetic field
= 3 : azimuthal magnetic field
= 4 : radial velocity field
= 5 : theta comp. of the velocity field
= 6 : azimuthal velocity field
= 7 : temperature field
= 8 : scalar field for field lines
= 9 : axisymm. toroidal mag. field
=10 : scalar field for stream lines
=11 : axisymm. v_phi
=12 : axisymm. T
=13 : z-comp. of poloidal Bz
=14 : z-comp. of poloidal Jz
=15 : z-comp. of velocity
=16 : z-comp. of vorticity
=17 : radial derivative of T * vr
=18 : helicity
=19 : axisymmetric helicity
=20 : axisymm field-line production
=21 : axisymm field-line advection
=22 : axisymm field-line diffusion
=23 : axisymm Bphi production
=24 : axisymm Bphi omega effect
=25 : axisymm Bphi advection
=26 : axisymm Bphi diffusion
=27 : Br production
=28 : Br advection
=29 : Br diffusion
=30 : Jr
=31 : Jr production
=32 : Jr omega effect
=33 : Jr advection
=34 : Jr diffusion
=35 : poloidal Bz production
=36 : poloidal Bz advection
=37 : poloidal Bz diffusion
=38 : poloidal Jz production
=39 : poloidal Jz omega effect
=40 : poloidal Jz advection
=41 : poloidal Jz diffusion
=42 : toroidal Bp
=43 : toroidal Bp production
=44 : toroidal Bp omega effect
=45 : toroidal Bp advection
=46 : toroidal Bp diffusion
=47 : phi-comp. of vorticity
=48 : r-comp. of vorticity
=49 : toroidal Bp omega effect
=50 : toroidal Bt
=51 : toroidal Potential
=52 : poloidal Fieldlines in theta=const
=53 : Br dr ( vp/(r sin(theta))
=54 : phi Lorentz force
=61 : AS phi reynolds stress force
=62 : AS phi advective stress force
=63 : AS phi viscous stress force
=64 : AS phi Lorentz force
=66 : time derivative of axisym. v phi
=67 : relative strength of axisym. v phi
=81 : Br inverse appearence at CMB
=91 : radial derivative of T
=92 : Vz north/south correlation
=93 : Vorz north/south correlation
=94 : Hel north/south correlation
=101: AS poloidal Br production
=102: AS poloidal Br dynamo term
=103: AS poloidal Br diffusion
=104: AS toroidal Bp production
=105: AS toroidal Bp dynamo term
=106: AS toroidal Bp omega effect
=107: AS toroidal Bp diffusion
=108: Bs
=109: composition field
=110: axisymm. composition
=111: axisymm. phase
=112: phase field
n_movie_field_start(n_field,n_movie) = defines where first element of a field is stored in
frames(*)
n_movie_field_stop(n_field,n_movie) = defines where last element of a field is stored in
frames(*)
The subroutine also defines appropriate file names for the movie files. These generally have the form TYPE_mov.TAG
- Called from
- Call to
-
subroutine
movie_data/
movie_gather_frames_to_rank0
()¶ MPI communicators for movie files
- Called from
- Call to
out_movie_file.f90
¶
Quick access
- Routines
get_b_surface()
,get_fl()
,get_sl()
,store_fields_3d()
,store_fields_p()
,store_fields_r()
,store_fields_sur()
,store_fields_t()
,store_movie_frame()
,write_movie_frame()
Needed modules
precision_mod
: This module controls the precision used in MagICparallel_mod
(rank()
): This module contains the blocking informationgeos
(cyl()
,n_s_max()
,write_geos_frame()
): 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 alsocommunications
(gt_oc()
,gather_all_from_lo_to_rank0()
): This module contains the different MPI communicators used in MagIC.truncation
(n_phi_max()
,n_theta_max()
,minc()
,lm_max()
,l_max()
,n_m_max()
,lm_maxmag()
,n_r_maxmag()
,n_r_ic_maxmag()
,n_r_ic_max()
,n_r_max()
,nlat_padded()
): This module defines the grid points and the truncationmovie_data
(frames()
,n_movie_fields()
,n_movies()
,n_movie_surface()
,n_movie_const()
,n_movie_field_type()
,n_movie_field_start()
,n_movie_field_stop()
,moviedipcolat()
,moviediplon()
,moviedipstrength()
,moviedipstrengthgeo()
,n_movie_type()
,lstoremov()
,n_movie_file()
,n_movie_fields_ic()
,movie_file()
,movie_const()
)radial_data
(n_r_icb()
,n_r_cmb()
): This module defines the MPI decomposition in the radial direction.radial_functions
(orho1()
,orho2()
,or1()
,or2()
,or3()
,or4()
,beta()
,r_surface()
,r_cmb()
,r()
,r_ic()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(lffac()
,radratio()
,ra()
,ek()
,pr()
,prmag()
): Module containing the physical parametersnum_param
(vscale()
,tscale()
): Module containing numerical and control parametersblocking
(lm2l()
,lm2()
,llmmag()
,ulmmag()
): Module containing blocking informationhorizontal_data
(o_sin_theta()
,sintheta()
,costheta()
,n_theta_cal2ord()
,o_sin_theta_e2()
,phi()
,theta_ord()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderfields
(w_rloc()
,b_rloc()
,b_ic()
,bicb()
): 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….logic
(l_save_out()
,l_cond_ic()
,l_mag()
): Module containing the logicals that control the runconstants
(zero()
,one()
,two()
): module containing constants and parameters used in the code.output_data
(runid()
): This module contains the parameters for output controluseful
(abortrun()
): This module contains several useful routines.
Variables
Subroutines and functions
-
subroutine
out_movie/
store_movie_frame
(n_r, vr, vt, vp, br, bt, bp, sr, drsr, xir, phir, dvrdp, dvpdr, dvtdr, dvrdt, cvr, cbr, cbt)¶ Controls output of movie frames. Usually called from radialLoop.
- Parameters
n_r [integer ,in] :: radial grid point no.
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
br (*,*) [real ,in]
bt (*,*) [real ,in]
bp (*,*) [real ,in]
sr (*,*) [real ,in]
drsr (*,*) [real ,in]
xir (*,*) [real ,in]
phir (*,*) [real ,in]
dvrdp (*,*) [real ,in]
dvpdr (*,*) [real ,in]
dvtdr (*,*) [real ,in]
dvrdt (*,*) [real ,in]
cvr (*,*) [real ,in]
cbr (*,*) [real ,in]
cbt (*,*) [real ,in]
- Called from
- Call to
store_fields_sur()
,store_fields_3d()
,store_fields_r()
,store_fields_t()
,store_fields_p()
-
subroutine
out_movie/
write_movie_frame
(n_frame, time, b_lmloc, db_lmloc, aj_lmloc, dj_lmloc, b_ic, db_ic, aj_ic, dj_ic, omega_ic, omega_ma)¶ Writes different movie frames into respective output files. Called from rank 0 with full arrays in standard LM order.
- Parameters
n_frame [integer ,in]
time [real ,in]
b_lmloc (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
db_lmloc (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
aj_lmloc (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
dj_lmloc (ulmmag-(llmmag)+1,n_r_maxmag) [complex ,in]
b_ic (lm_maxmag,n_r_ic_maxmag) [complex ,in]
db_ic (lm_maxmag,n_r_ic_maxmag) [complex ,in]
aj_ic (lm_maxmag,n_r_ic_maxmag) [complex ,in]
dj_ic (lm_maxmag,n_r_ic_maxmag) [complex ,in]
omega_ic [real ,in]
omega_ma [real ,in]
- Called from
- Call to
gather_all_from_lo_to_rank0()
,abortrun()
,write_geos_frame()
,write_dtb_frame()
-
subroutine
out_movie/
store_fields_sur
(n_store_last, n_field_type, bcmb)¶ Purpose of this subroutine is to store movie frames for surfaces r=const. into array frame(,)
- Parameters
n_store_last [integer ,in] :: Start position for storing -1
n_field_type [integer ,in] :: Defines field type
bcmb (lm_max) [complex ,in]
- Called from
- Call to
-
subroutine
out_movie/
store_fields_r
(vr, vt, vp, br, bt, bp, sr, drsr, xir, phir, dvrdp, dvpdr, dvtdr, dvrdt, cvr, n_r, n_store_last, n_field_type)¶ Purpose of this subroutine is to store movie frames for surfaces r=const. into array frame(,)
- Parameters
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
br (*,*) [real ,in]
bt (*,*) [real ,in]
bp (*,*) [real ,in]
sr (*,*) [real ,in]
drsr (*,*) [real ,in]
xir (*,*) [real ,in]
phir (*,*) [real ,in]
dvrdp (*,*) [real ,in]
dvpdr (*,*) [real ,in]
dvtdr (*,*) [real ,in]
dvrdt (*,*) [real ,in]
cvr (*,*) [real ,in]
n_r [integer ,in]
n_store_last [integer ,in] :: Start position in frame(*)-1
n_field_type [integer ,in] :: Defines field type
- Called from
-
subroutine
out_movie/
store_fields_p
(vr, vt, vp, br, bp, bt, sr, drsr, xir, phir, dvrdp, dvpdr, dvtdr, dvrdt, cvr, cbr, cbt, n_r, n_store_last, n_field_type, n_phi_const, n_field_size)¶ Purpose of this subroutine is to store movie frames for surfaces phi=const. into array frames(,)
- Parameters
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
br (*,*) [real ,in]
bp (*,*) [real ,in]
bt (*,*) [real ,in]
sr (*,*) [real ,in]
drsr (*,*) [real ,in]
xir (*,*) [real ,in]
phir (*,*) [real ,in]
dvrdp (*,*) [real ,in]
dvpdr (*,*) [real ,in]
dvtdr (*,*) [real ,in]
dvrdt (*,*) [real ,in]
cvr (*,*) [real ,in]
cbr (*,*) [real ,in]
cbt (*,*) [real ,in]
n_r [integer ,in] :: No. of radial point
n_store_last [integer ,in] :: Start position in frame(*)-1
n_field_type [integer ,in] :: Defines field type
n_phi_const [integer ,in] :: No. of surface phi
n_field_size [integer ,in] :: Size of field
- Called from
- Call to
-
subroutine
out_movie/
store_fields_t
(vr, vt, vp, br, bt, bp, sr, drsr, xir, phir, dvrdp, dvpdr, dvtdr, dvrdt, cvr, cbt, n_r, n_store_last, n_field_type, n_theta)¶ Purpose of this subroutine is to store movie frames for surfaces r=const. into array frame(,)
- Parameters
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
br (*,*) [real ,in]
bt (*,*) [real ,in]
bp (*,*) [real ,in]
sr (*,*) [real ,in]
drsr (*,*) [real ,in]
xir (*,*) [real ,in]
phir (*,*) [real ,in]
dvrdp (*,*) [real ,in]
dvpdr (*,*) [real ,in]
dvtdr (*,*) [real ,in]
dvrdt (*,*) [real ,in]
cvr (*,*) [real ,in]
cbt (*,*) [real ,in]
n_r [integer ,in] :: No. of radial grid point
n_store_last [integer ,in] :: Position in frame(*)-1
n_field_type [integer ,in] :: Defines field
n_theta [integer ,in] :: No. of theta in block
- Called from
-
subroutine
out_movie/
store_fields_3d
(vr, vt, vp, br, bt, bp, sr, drsr, xir, phir, dvrdp, dvpdr, dvtdr, dvrdt, cvr, cbr, cbt, n_r, n_store_last, n_field_type)¶ Purpose of this subroutine is to store movie frames for surfaces r=const. into array frame(,)
- Parameters
vr (*,*) [real ,in]
vt (*,*) [real ,in]
vp (*,*) [real ,in]
br (*,*) [real ,in]
bt (*,*) [real ,in]
bp (*,*) [real ,in]
sr (*,*) [real ,in]
drsr (*,*) [real ,in]
xir (*,*) [real ,in]
phir (*,*) [real ,in]
dvrdp (*,*) [real ,in]
dvpdr (*,*) [real ,in]
dvtdr (*,*) [real ,in]
dvrdt (*,*) [real ,in]
cvr (*,*) [real ,in]
cbr (*,*) [real ,in]
cbt (*,*) [real ,in]
n_r [integer ,in] :: No. of radial grid point
n_store_last [integer ,in] :: Position in frame(*)-1
n_field_type [integer ,in] :: Defines field
- Called from
-
subroutine
out_movie/
get_sl
(sl, n_r)¶ Return field sl whose contourlines are the stream lines of the axisymmetric poloidal velocity field.
\[s(r,\theta) = \dfrac{1}{r}\dfrac{\partial}{\partial \theta} u(r,\theta,m=0)\]- Parameters
sl (*) [real ,out] :: Field for field lines
n_r [integer ,in] :: No. of radial grid point
- Called from
- Call to
-
subroutine
out_movie/
get_fl
(fl, n_r, l_ic)¶ Return field fl whose contourlines are the fields lines of the axisymmetric poloidal mangetic field.
\[f(r,\theta) = \dfrac{1}{r}\dfrac{\partial}{\partial \theta} b(r,\theta,m=0)\]This routine is called for l_ic=.true. only from rank 0 with full field b_ic in standard lm ordering available. The case l_ic=.false. is called from all ranks and uses b_Rloc.
- Parameters
fl (*) [real ,out] :: Field for field lines
n_r [integer ,in] :: No. of radial grid point
l_ic [logical ,in] :: =true if inner core field
- Called from
- Call to
-
subroutine
out_movie/
get_b_surface
(b_r, b_t, b_p, bcmb)¶ Upward continuation of laplacian field to Earths surface. Field is given by poloidal harmonic coefficients b at CMB. Spherical harmonic transforms of upward continued field to r/theta/phi vector components for all logitudes and latitude are returned in br/bt/bp. Note that this routine given the real components of the magnetic fields while other transforms in the code provide only: \(r^2 B_r\), \(r^2 \sin\theta B_\theta\), \(r^2 \sin\theta B_\phi\)
- Parameters
b_r (*,*) [real ,out] :: Radial magnetic field in (theta,phi)-space
b_t (*,*) [real ,out] :: Latitudinal magnetic field
b_p (*,*) [real ,out] :: Azimuthal magnetic field.
bcmb (*) [complex ,in]
- Called from
- Call to
store_movie_IC.f90
¶
Quick access
- Routines
Needed modules
precision_mod
: This module controls the precision used in MagICtruncation
(minc()
,lm_maxmag()
,n_r_maxmag()
,n_r_ic_maxmag()
,n_phi_max()
,lm_max()
,n_r_ic_max()
,l_max()
,n_theta_max()
,nlat_padded()
): This module defines the grid points and the truncationradial_data
(n_r_icb()
): This module defines the MPI decomposition in the radial direction.radial_functions
(r_ic()
,r_icb()
,o_r_ic2()
,o_r_ic()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)physical_parameters
(lffac()
): Module containing the physical parametershorizontal_data
(n_theta_cal2ord()
,o_sin_theta()
): Module containing functions depending on longitude and latitude plus help arrays depending on degree and orderlogic
(l_cond_ic()
): Module containing the logicals that control the runmovie_data
(frames()
,n_movie_field_stop()
,n_movie_field_start()
,n_movie_type()
,n_movie_const()
,n_movie_fields_ic()
,n_movie_surface()
,n_movies()
,n_movie_field_type()
,n_movie_fields()
)constants
(one()
): module containing constants and parameters used in the code.
Variables
Subroutines and functions
-
subroutine
out_movie_ic/
store_movie_frame_ic
(bicb, b_ic, db_ic, ddb_ic, aj_ic, dj_ic)¶ Controls storage of IC magnetic field in movie frame.
- Parameters
bicb (lm_maxmag) [complex ,in]
b_ic (lm_maxmag,n_r_ic_maxmag) [complex ,in]
db_ic (lm_maxmag,n_r_ic_maxmag) [complex ,in]
ddb_ic (lm_maxmag,n_r_ic_maxmag) [complex ,in]
aj_ic (lm_maxmag,n_r_ic_maxmag) [complex ,in]
dj_ic (lm_maxmag,n_r_ic_maxmag) [complex ,in]
- Called from
- Call to
out_coeff.f90
¶
Description
This module contains the subroutines that calculate the Bcmb files, the [B|V|T]_coeff_r files and the [B|V|T]_lmr files
Quick access
- Variables
b_r_file
,n_b_r_file
,n_b_r_sets
,n_t_r_file
,n_t_r_sets
,n_v_r_file
,n_v_r_sets
,n_xi_r_file
,n_xi_r_sets
,t_r_file
,v_r_file
,xi_r_file
- Routines
finalize_coeff()
,initialize_coeff()
,write_bcmb()
,write_coeff_r()
,write_coeffs()
,write_pot()
,write_pot_mpi()
Needed modules
precision_mod
: This module controls the precision used in MagICparallel_mod
: This module contains the blocking informationmem_alloc
(bytes_allocated()
): This little module is used to estimate the global memory allocation used in MagIClogic
(l_r_field()
,l_cmb_field()
,l_save_out()
,l_average()
,l_cond_ic()
,l_r_fieldt()
,l_r_fieldxi()
,l_mag()
): Module containing the logicals that control the runradial_functions
(r()
,rho0()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)radial_data
(nrstart()
,nrstop()
): This module defines the MPI decomposition in the radial direction.physical_parameters
(ra()
,ek()
,pr()
,prmag()
,radratio()
,sigma_ratio()
,raxi()
,sc()
): Module containing the physical parametersnum_param
(tscale()
): Module containing numerical and control parametersblocking
(lm2()
,llm()
,ulm()
): Module containing blocking informationtruncation
(lm_max()
,l_max()
,minc()
,n_r_max()
,n_r_ic_max()
,m_min()
,m_max()
): This module defines the grid points and the truncationcommunications
(gather_from_lo_to_rank0()
,gather_all_from_lo_to_rank0()
,gt_ic()
,gt_oc()
): This module contains the different MPI communicators used in MagIC.output_data
(tag()
,n_coeff_r()
,n_r_array()
,n_r_step()
,l_max_r()
,n_coeff_r_max()
): This module contains the parameters for output controlconstants
(two()
,half()
): module containing constants and parameters used in the code.
Variables
-
out_coeff/
b_r_file
(*) [character(len=72),private/allocatable]¶
-
-
out_coeff/
filehandle
[integer,private]¶
-
-
out_coeff/
n_b_r_file
(*) [integer,private/allocatable]¶
-
-
out_coeff/
n_b_r_sets
(*) [integer,private/allocatable]¶
-
-
out_coeff/
n_t_r_file
(*) [integer,private/allocatable]¶
-
-
out_coeff/
n_t_r_sets
(*) [integer,private/allocatable]¶
-
-
out_coeff/
n_v_r_file
(*) [integer,private/allocatable]¶
-
-
out_coeff/
n_v_r_sets
(*) [integer,private/allocatable]¶
-
-
out_coeff/
n_xi_r_file
(*) [integer,private/allocatable]¶
-
-
out_coeff/
n_xi_r_sets
(*) [integer,private/allocatable]¶
-
-
out_coeff/
t_r_file
(*) [character(len=72),private/allocatable]¶
-
-
out_coeff/
v_r_file
(*) [character(len=72),private/allocatable]¶
-
-
out_coeff/
xi_r_file
(*) [character(len=72),private/allocatable]¶
-
Subroutines and functions
-
subroutine
out_coeff/
initialize_coeff
()¶ - Called from
-
subroutine
out_coeff/
finalize_coeff
()¶ - Called from
-
subroutine
out_coeff/
write_bcmb
(time, b_lmloc, l_max_cmb, n_cmb_sets, cmb_file, n_cmb_file)¶ Each call of this subroutine writes time and the poloidal magnetic potential coefficients b at the CMB up to degree and order l_max_cmb at the end of output file cmb_file. The parameters l_max_cmb, minc and the number of stored coeffs are written into the header of cmb_file. Each further set contains:
Real and imaginary part of b(*) for all orders m<=l are written for a specific degree l, then for the degrees l+1, l+2, l_max_cmb.
- Parameters
time [real ,in] :: Time
b_lmloc (ulm-(llm)+1) [complex ,in] :: Poloidal field potential
l_max_cmb [integer ,inout] :: Max degree of output
n_cmb_sets [integer ,inout] :: Total no. of cmb sets,
cmb_file [character(len=*),in] :: Name of output file
n_cmb_file [integer ,inout] :: Output unit for $cmb_file
- Called from
- Call to
-
subroutine
out_coeff/
write_coeffs
(w_lmloc, dw_lmloc, ddw_lmloc, z_lmloc, b_lmloc, db_lmloc, ddb_lmloc, aj_lmloc, s_lmloc, xi_lmloc, timescaled)¶ This routine handles the writing of coefficients at a given depth
- Parameters
w_lmloc (*,*) [complex ,in]
dw_lmloc (*,*) [complex ,in]
ddw_lmloc (*,*) [complex ,in]
z_lmloc (*,*) [complex ,in]
b_lmloc (*,*) [complex ,in]
db_lmloc (*,*) [complex ,in]
ddb_lmloc (*,*) [complex ,in]
aj_lmloc (*,*) [complex ,in]
s_lmloc (*,*) [complex ,in]
xi_lmloc (*,*) [complex ,in]
timescaled [real ,in]
- Called from
- Call to
-
subroutine
out_coeff/
write_coeff_r
(time, w_lmloc, dw_lmloc, ddw_lmloc, z_lmloc, r, l_max_r, n_sets, file, n_file, nvbs)¶ Each call of this subroutine writes time and the poloidal and toroidal coeffitients w,dw,z at a specific radius up to degree and order l_max_r at the end of output file $file. If the input is magnetic field (nVBS=2) ddw is stored as well. If the input is entropy field (nVBS=3) only ddw=s is stored. The parameters l_max_r, minc, the number of stored coeffs and radius in the outer core are written into the first line of $file. Each further set contains:
Real and imaginary part of w(*) for all orders m<=l are written for a specific degree l, then for the degrees l+1, l+2, l_max_r.
- Parameters
time [real ,in] :: Time
w_lmloc (ulm-(llm)+1) [complex ,in] :: Poloidal field potential
dw_lmloc (ulm-(llm)+1) [complex ,in] :: dr of Poloidal field potential
ddw_lmloc (ulm-(llm)+1) [complex ,in] :: dr^2 of Poloidal field potential
z_lmloc (ulm-(llm)+1) [complex ,in] :: Toroidal field potential
r [real ,in] :: radius of coeffs
l_max_r [integer ,inout] :: Max degree of output
n_sets [integer ,inout] :: Total no. of cmb sets,
file [character(len=*),in] :: Name of output file
n_file [integer ,inout] :: Output unit for $file
nvbs [integer ,in] :: 1 if flow, 2 if magnetic field and 3 if temperature or composition
- Called from
- Call to
-
subroutine
out_coeff/
write_pot_mpi
(time, b, aj, b_ic, aj_ic, npotsets, root, omega_ma, omega_ic)¶ This routine stores the fields in (lm,r) space using MPI-IO
- Parameters
time [real ,in] :: Time
b (lm_max,nrstop-(nrstart)+1) [complex ,in] :: Poloidal potential
aj (lm_max,nrstop-(nrstart)+1) [complex ,in] :: Toroidal potential
b_ic (ulm-(llm)+1,n_r_ic_max) [complex ,in]
aj_ic (ulm-(llm)+1,n_r_ic_max) [complex ,in]
npotsets [integer ,in]
root [character(len=*),in]
omega_ma [real ,in]
omega_ic [real ,in]
- Called from
- Call to
-
subroutine
out_coeff/
write_pot
(time, b, aj, b_ic, aj_ic, npotsets, root, omega_ma, omega_ic)¶ This routine stores the fields in spectral and radial space
- Parameters
time [real ,in] :: Output time
b_ic (ulm-(llm)+1,n_r_ic_max) [complex ,in]
aj_ic (ulm-(llm)+1,n_r_ic_max) [complex ,in]
npotsets [integer ,in]
root [character(len=*),in] :: File prefix
omega_ma [real ,in]
omega_ic [real ,in]
- Call to
field_average.f90
¶
Description
This module is used when one wants to store time-averaged quantities
Quick access
- Variables
aj_ave_lmloc
,aj_ave_rloc
,aj_ic_ave
,b_ave_lmloc
,b_ave_rloc
,b_ic_ave
,bicb
,p_ave_lmloc
,p_ave_rloc
,phi_ave_lmloc
,phi_ave_rloc
,s_ave_lmloc
,s_ave_rloc
,w_ave_lmloc
,w_ave_rloc
,xi_ave_lmloc
,xi_ave_rloc
,z_ave_lmloc
,z_ave_rloc
- Routines
fields_average()
,finalize_fields_average_mod()
,initialize_fields_average_mod()
Needed modules
truncation
: This module defines the grid points and the truncationprecision_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
(get_global_sum()
,gather_from_lo_to_rank0()
,gather_all_from_lo_to_rank0()
,gt_oc()
,gt_ic()
): This module contains the different MPI communicators used in MagIC.radial_data
(n_r_cmb()
,n_r_icb()
,nrstart()
,nrstop()
): This module defines the MPI decomposition in the radial direction.radial_functions
(chebt_ic()
,chebt_ic_even()
,r()
,dr_fac_ic()
,rscheme_oc()
,l_r()
): This module initiates all the radial functions (transport properties, density, temperature, cheb transforms, etc.)blocking
(lm2()
,llm()
,ulm()
,llmmag()
,ulmmag()
): Module containing blocking informationlogic
(l_mag()
,l_conv()
,l_save_out()
,l_heat()
,l_cond_ic()
,l_chemical_conv()
,l_phase_field()
,l_onset()
): Module containing the logicals that control the runkinetic_energy
(get_e_kin()
): 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.TAGoutput_data
(tag()
,n_log_file()
,log_file()
,n_graphs()
,l_max_cmb()
): This module contains the parameters for output controlparallel_mod
(rank()
): This module contains the blocking informationconstants
(zero()
,vol_oc()
,vol_ic()
,one()
): module containing constants and parameters used in the code.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 filesspectra
(spectrum()
): 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….graphout_mod
(graphout_mpi()
,graphout_mpi_header()
): This module contains the subroutines that store the 3-D graphic files.radial_der
(get_dr()
): Radial derivatives functionsfieldslast
(dwdt()
,dpdt()
,dzdt()
,dsdt()
,dxidt()
,dbdt()
,djdt()
,dbdt_ic()
,djdt_ic()
,domega_ma_dt()
,domega_ic_dt()
,dphidt()
,lorentz_torque_ic_dt()
,lorentz_torque_ma_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….storecheckpoints
: This module contains several subroutines that can be used to store the checkpoint_#.tag filestime_schemes
(type_tscheme()
): This module defines an abstract class type_tscheme which is employed for the time advance of the code.
Variables
-
fields_average_mod/
aj_ave_lmloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
aj_ave_rloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
aj_ic_ave
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
b_ave_lmloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
b_ave_rloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
b_ic_ave
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
bicb
(*) [complex,private/allocatable]¶
-
-
fields_average_mod/
p_ave_lmloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
p_ave_rloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
phi_ave_lmloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
phi_ave_rloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
s_ave_lmloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
s_ave_rloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
w_ave_lmloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
w_ave_rloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
xi_ave_lmloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
xi_ave_rloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
z_ave_lmloc
(*,*) [complex,private/allocatable]¶
-
-
fields_average_mod/
z_ave_rloc
(*,*) [complex,private/allocatable]¶
-
Subroutines and functions
-
subroutine
fields_average_mod/
fields_average
(simtime, tscheme, nave, l_stop_time, time_passed, time_norm, omega_ic, omega_ma, w, z, p, s, xi, phi, b, aj, b_ic, aj_ic)¶ This subroutine averages fields b and v over time.
- Parameters
simtime [real ,in]
tscheme [real ]
nave [integer ,in] :: number for averaged time steps
l_stop_time [logical ,in] :: true if this is the last time step
time_passed [real ,in] :: time passed since last log
time_norm [real ,in] :: time passed since start of time loop
omega_ic [real ,in]
omega_ma [real ,in]
b (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]
aj_ic (ulmmag-(llmmag)+1,n_r_ic_maxmag) [complex ,in]
- Called from
- Call to
get_ddrns_even()
,get_drns_even()
,spectrum()
,get_e_kin()
,get_e_mag()
,open_graph_file()
,graphout_mpi_header()
,gather_from_lo_to_rank0()
,torpol_to_spat()
,scal_to_spat()
,graphout_mpi()
,gather_all_from_lo_to_rank0()
,graphout_ic()
,close_graph_file()
,write_bcmb()
,write_pot_mpi()
,store_mpi()