Model Output
More...
|
subroutine, public | output_init (domain, options) |
|
Initialize the output module More...
|
|
subroutine, public | write_domain (domain, options, timestep, inputfilename) |
|
Simple routine to write all domain data from this current time step to the output file. More...
|
|
|
integer, parameter | ndims = 4 |
|
integer, parameter | number |
|
integer, parameter | of |
|
integer, parameter | dimensions |
|
integer, parameter | in |
|
integer, dimension(x, y, z, t),
parameter | output |
|
integer, parameter | nvars = 37 |
|
integer, parameter | current |
|
integer, parameter | vars = 37 |
|
integer | ncid |
| This will be the netCDF ID for the file and data variable. More...
|
|
integer | temp_id |
|
integer | t_id |
| dimension IDs More...
|
|
integer | x_id |
|
integer | y_id |
|
integer | xu_id |
|
integer | yv_id |
|
integer | soil_id |
|
integer, dimension(ndims) | dimids |
| arrays to store dims for a given variable More...
|
|
integer, dimension(2) | dimtwo |
|
integer, dimension(3) | dimtwo_time |
|
integer | lat_id |
| variable IDs More...
|
|
integer | lon_id |
|
integer | time_id |
|
integer, dimension(nvars) | varid |
| array to store ALL var ids More...
|
|
integer, parameter | time_steps_per_file = 24 |
| the number of time steps to save in each file More...
|
|
integer, parameter | every_step = 0 |
|
integer, parameter | monthly_frequency = 2 |
|
integer, parameter | daily_frequency = 1 |
|
integer | output_frequency = DAILY_FREQUENCY |
|
integer | current_step |
|
character(len=255) | filename = "default_output.nc" |
|
integer, dimension(4) | start_three_d = [1,1,1,1] |
|
integer, dimension(3) | start_two_d = [1,1,1] |
|
integer, dimension(1) | start_scalar = [1] |
|
real, dimension(:,:), allocatable | last_rain |
|
logical | surface_io_only |
|
integer | nx |
|
integer | ny |
|
integer | nz |
|
integer | i |
|
integer | nsoil |
|
Model Output
Writes all model data to a (mostly?) CF compliant netcdf file. Eventually this should be updated to work with generic data structures rather than specifying / hard codeing every possible variable name and attribute.
- Author
- Ethan Gutmann (gutma.nosp@m.nn@u.nosp@m.car.e.nosp@m.du)
subroutine output::create_file |
( |
character(len=255), intent(in) |
filename, |
|
|
type(options_type), intent(in) |
options |
|
) |
| |
|
private |
Creates a new NetCDF output file
Creates a new file including all variables, dimensions, and attributes
- Parameters
-
filename | name of NetCDF output file to be created |
options | model wide options so the correct output can be created
|
subroutine, public output::output_init |
( |
type(domain_type), intent(in) |
domain, |
|
|
type(options_type), intent(in) |
options |
|
) |
| |
Initialize the output module
Set up module level variables nx,ny,nz,nsoil and last_rain Sets output frequency (daily, monthly, or every step)
- Parameters
-
[in] | domain | model domain datatype, fields must be initialized |
[in] | options | model options datatype, fields must be initialized
|
subroutine output::setup_varids |
( |
integer, intent(in) |
ncid, |
|
|
type(options_type), intent(in) |
options |
|
) |
| |
|
private |
Set up the varids for an existing NetCDF file by searching for the variable name
Querys an existing NetCDF file, and setups of the variable ids for all variables in the varids array. In some ways it would be better to have it create variables if they don't exist, but this way there is an implicit check that a restarted model has consistent physics options.
Stops if a variable is missing from the NetCDF file
- Parameters
-
ncid | Specifies the existing file by NetCDF ID |
options | Model options to determine which varids to look for setup
|
subroutine output::tip_precip_to_buckets |
( |
type(domain_type), intent(inout) |
domain | ) |
|
|
private |
Keeps accumulated precip variables in reasonable bounds with a "bucket"
Check if precip variables have exceeded kPRECIP_BUCKET_SIZE and if so, "tip" into the bucket i.e. add one to the bucket and subtract kPRECIP_BUCKET_SIZE from the precip variable and repeat while precip variable > kPRECIP_BUCKET_SIZE
- Parameters
-
domain | only: rain, crain, snow, graupel and their respective buckets
|
subroutine, public output::write_domain |
( |
type(domain_type), intent(inout) |
domain, |
|
|
type(options_type), intent(in) |
options, |
|
|
integer, intent(in) |
timestep, |
|
|
character(len=*), intent(in), optional |
inputfilename |
|
) |
| |
Simple routine to write all domain data from this current time step to the output file.
Checks if the file needs to be created or simply checked for required variables. Writes the actual data to the file (calls helper routines to create or set up the file as necessary). Note these are mostly instantaneous output fields, precip etc are accumulated fluxes.
- Parameters
-
domain | Full model domain to write to the file |
options | Model options to decipher what to write |
timestep | Only used to permit -1 to be specified to write a file with the restarted conditions |
inputfilename | OPTIONAL: specify the output filename (otherwise optionsoutput_file + date_time)
|
integer, parameter output::current |
|
private |
integer output::current_step |
|
private |
integer, parameter output::daily_frequency = 1 |
|
private |
integer, parameter output::dimensions |
|
private |
integer, dimension(ndims) output::dimids |
|
private |
arrays to store dims for a given variable
integer, dimension(2) output::dimtwo |
|
private |
integer, dimension(3) output::dimtwo_time |
|
private |
integer, parameter output::every_step = 0 |
|
private |
character(len=255) output::filename = "default_output.nc" |
|
private |
integer, parameter output::in |
|
private |
real, dimension(:,:), allocatable output::last_rain |
|
private |
integer, parameter output::monthly_frequency = 2 |
|
private |
This will be the netCDF ID for the file and data variable.
integer, parameter output::ndims = 4 |
|
private |
integer parameter output::number |
|
private |
integer, parameter output::nvars = 37 |
|
private |
integer parameter output::of |
|
private |
integer, dimension (x,y,z,t), parameter output::output |
|
private |
integer output::output_frequency = DAILY_FREQUENCY |
|
private |
integer, dimension(1) output::start_scalar = [1] |
|
private |
integer, dimension(4) output::start_three_d = [1,1,1,1] |
|
private |
integer, dimension(3) output::start_two_d = [1,1,1] |
|
private |
logical output::surface_io_only |
|
private |
integer, parameter output::time_steps_per_file = 24 |
|
private |
the number of time steps to save in each file
integer, dimension(nvars) output::varid |
|
private |
array to store ALL var ids
integer, parameter output::vars = 37 |
|
private |
The documentation for this module was generated from the following file: