The Intermediate Complexity Atmospheric Research model (ICAR)
A computationally efficient atmospheric model for downscaling.
 All Classes Files Functions Variables
Public Member Functions | Private Member Functions | Private Attributes | List of all members
output Module Reference


Model Output More...

Public Member Functions

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

 

Private Member Functions

subroutine tip_precip_to_buckets (domain)
 

Keeps accumulated precip variables in reasonable bounds with a "bucket" More...

 
subroutine create_file (filename, options)
 

Creates a new NetCDF output file More...

 
subroutine setup_varids (ncid, options)
 

Set up the varids for an existing NetCDF file by searching for the variable name More...

 

Private Attributes

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(ndimsdimids
 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(nvarsvarid
 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
 

Detailed Description


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)

Member Function/Subroutine Documentation

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
filenamename of NetCDF output file to be created
optionsmodel wide options so the correct output can be created

Here is the call graph for this function:

Here is the caller graph for this function:

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]domainmodel domain datatype, fields must be initialized
[in]optionsmodel options datatype, fields must be initialized

Here is the caller graph for this function:

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
ncidSpecifies the existing file by NetCDF ID
optionsModel options to determine which varids to look for setup

Here is the call graph for this function:

Here is the caller graph for this function:

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
domainonly: rain, crain, snow, graupel and their respective buckets

Here is the caller graph for this function:

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
domainFull model domain to write to the file
optionsModel options to decipher what to write
timestepOnly used to permit -1 to be specified to write a file with the restarted conditions
inputfilenameOPTIONAL: specify the output filename (otherwise optionsoutput_file + date_time)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

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 output::i
private
integer, parameter output::in
private
real, dimension(:,:), allocatable output::last_rain
private
integer output::lat_id
private

variable IDs

integer output::lon_id
private
integer, parameter output::monthly_frequency = 2
private
integer output::ncid
private

This will be the netCDF ID for the file and data variable.

integer, parameter output::ndims = 4
private
integer output::nsoil
private
integer parameter output::number
private
integer, parameter output::nvars = 37
private
integer output::nx
private
integer output::ny
private
integer output::nz
private
integer parameter output::of
private
integer, dimension (x,y,z,t), parameter output::output
private
integer output::output_frequency = DAILY_FREQUENCY
private
integer output::soil_id
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 output::t_id
private

dimension IDs

integer output::temp_id
private
integer output::time_id
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
integer output::x_id
private
integer output::xu_id
private
integer output::y_id
private
integer output::yv_id
private

The documentation for this module was generated from the following file: