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]
  • graphout_mod/write_one_field [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()

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

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

movie.f90

Quick access

Variables:

frames, get_movie_type, 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(), initialize_movie_data(), movie_gather_frames_to_rank0()

Needed modules

Variables

  • movie_data/frames (*) [real,allocatable/public]
  • movie_data/get_movie_type [private]
  • movie_data/licfield (30) [logical,public]
  • movie_data/lstoremov (30) [logical,public]
  • movie_data/movie (30) [character(len=80),public]

  • 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

subroutine  movie_data/finalize_movie_data()

Close movie files

Called from:

magic

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

Variables:

get_b_surface, get_sl, store_fields_3d, store_fields_p, store_fields_r, store_fields_sur, store_fields_t

Routines:

get_fl(), store_movie_frame(), write_movie_frame()

Needed modules

Variables

  • out_movie/get_b_surface [private]
  • out_movie/get_sl [private]
  • out_movie/store_fields_3d [private]
  • out_movie/store_fields_p [private]
  • out_movie/store_fields_r [private]
  • out_movie/store_fields_sur [private]
  • out_movie/store_fields_t [private]

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]

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

Call to:

toraxi_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, write_coeff_r, xi_r_file

Routines:

finalize_coeff(), initialize_coeff(), write_bcmb(), 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/write_coeff_r [private]
  • 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 (1 - llm + ulm) [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()

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

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

  • b_ic (1 - llm + ulm,n_r_ic_max) [complex ,in]

  • aj_ic (1 - llm + ulm,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()