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

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

fields_average(), step_time()

Call to

mpiio_setup()

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

fields_average(), step_time()

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

fields_average(), radialloop()

Call to

write_one_field()

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

fields_average(), radialloop()

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

fields_average(), output()

Call to

torpol_to_spat_ic(), write_one_field()

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

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

magic

Call to

get_movie_type()

subroutine movie_data/finalize_movie_data()

Close movie files

Called from

magic

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:

  1. 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

  2. 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

initialize_movie_data()

Call to

delete_string(), capitalize(), abortrun(), dble2str()

subroutine movie_data/movie_gather_frames_to_rank0()

MPI communicators for movie files

Called from

output()

Call to

abortrun()

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

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

radialloop()

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

output()

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

store_movie_frame()

Call to

get_b_surface()

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

store_movie_frame()

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

store_movie_frame()

Call to

get_fl(), get_sl()

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

store_movie_frame()

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

store_movie_frame()

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

store_fields_p()

Call to

toraxi_to_spat()

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

store_fields_p(), store_movie_frame_ic()

Call to

toraxi_to_spat()

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

store_fields_sur()

Call to

torpol_to_spat()

store_movie_IC.f90

Quick access

Routines

store_movie_frame_ic()

Needed modules

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

output()

Call to

torpol_to_spat_ic(), torpol_to_curl_spat_ic(), get_fl()

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

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

initialize_output()

subroutine out_coeff/finalize_coeff()
Called from

finalize_output()

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

fields_average(), output()

Call to

gather_from_lo_to_rank0()

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

output()

Call to

write_coeff_r()

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

write_coeffs()

Call to

gather_from_lo_to_rank0()

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

fields_average(), output()

Call to

mpiio_setup(), gather_all_from_lo_to_rank0()

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

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

  • 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

gather_all_from_lo_to_rank0()

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

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

magic

subroutine fields_average_mod/finalize_fields_average_mod()
Called from

magic

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

output()

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