Output
PinCFlow.Output
— ModuleOutput
Module for I/O of simulation data.
Provides functions for writing the model state and initializing the model with data from a previous simulation.
See also
PinCFlow.Output.create_output
— Functioncreate_output(state::State)
Create an HDF5 output file with one dataset for each variable.
The dimensions of the datasets are set to those of the domain, whereas the chunks are set to the dimensions of the MPI subdomains, in preparation for parallel output. Datasets for the grid, i.e. the fields x
, y
and zc
of state.grid
, the time and the fields of state.atmosphere
are always created, regardless of the specifications in state.namelists.output
. The one exception to this is the Boussinesq mode, in which no datasets are created for the fields of state.atmosphere
, since they do not have a spatial dependence.
Arguments
state
: Model state.
PinCFlow.Output.read_input!
— Functionread_input!(state::State)
Read initial values for all prognostic variables from an HDF5 input file.
Arguments
state
: Model state.
PinCFlow.Output.write_output
— Functionwrite_output(
state::State,
time::AbstractFloat,
iout::Integer,
machine_start_time::DateTime,
)::Integer
Write the current simulation state to a previously created HDF5 output file and return the advanced output counter iout
.
The output is written in parallel, using the chunking prepared by create_output
. The grid, i.e. the fields x
, y
and zc
of state.grid
, as well as the fields of state.atmosphere
are only written if iout == 1
(which should only be the case for the initial output). In Boussinesq mode, the fields of state.atmosphere
do not have a spatial dependence and are therefore not written at all. In compressible mode, the mass-weighted potential temperature and squared buoyancy frequency have a temporal dependence and are therefore written even if iout != 1
. Any other field is only written if it is listed in state.namelists.output.output_variables
or if it is essential for restarts and state.namelists.output.prepare_restart == true
.
The list of available output variables (as specified in state.namelists.output.output_variables
) is as follows.
:rhop
: Density fluctuations (restart variable).:u
: Zonal wind.:us
: Staggered zonal wind (restart variable).:v
: Meridional wind.:vs
: Staggered meridional wind (restart variable).:w
: Vertical wind (computed withcompute_vertical_wind
).:ws
: Staggered vertical wind (computed withcompute_vertical_wind
).:wt
: Transformed vertical wind.:wts
: Staggered transformed vertical wind (restart variable).:thetap
: Potential-temperature fluctuations.:pip
: Exner-pressure fluctuations (restart variable).:dudt
: Zonal-momentum drag due to unresolved gravity waves.:dvdt
: Meridional-momentum drag due to unresolved gravity waves.:dthetadt
: Mass-weighted potential-temperature tendency due to unresolved gravity waves.:dchidt
: Leading-order tracer impact of unresolved gravity waves.:uchi
: Zonal tracer fluxes due to unresolved gravity waves.:vchi
: Meridional tracer fluxes due to unresolved gravity waves.:wchi
: Vertical tracer fluxes due to unresolved gravity waves.
An output of all ray-volume properties is provided if state.namelists.output.save_ray_volumes == true
and/or state.namelists.output.prepare_restart == true
.
All output variables are re-dimensionalized with the scale parameters stored in state.constants
.
Arguments
state
: Model state.time
: Simulation time.iout
: Output counter. This is the temporal index of the output. It is advanced before the output is written, so that the first call ofwrite_output
should receiveiout = 0
.machine_start_time
: Wall-clock start time.
See also