HOWTO flexible output
GETM offers two ways to configure the output: an old Fortran namelist based method in getm.inp, and a more flexible output system via output.yaml.
The Fortran namelist based method supports output frequency and a limited selection of variables. It only supports saving full fields – i.e. it is not possible to save different smaller areas/stations with different frequency. It is also not possible to save strided fields – e.g only surface or bottom fields. The ‘2d’ file saves all 2D related fields like elevation, meteorological forcing and depth-integrated velocities. The ‘3d’ files saves all 3D related fields like temperature and salinity. The 'mean' file saves variables averaged over a specified interval. For details see the io_spec namelist at the end of getm.inp.
A much more flexible system is based on a metadata repository where the model registers available variables for output and a YAML-based configuration format. GETM checks for an optional configuration file output.yaml, which can define several output files and the associated content. Here is an example output.yaml that defines the output to a file flexout.nc:
allow_missing_fields: true # do not stop if requested field is not registered [default=false]
flexout: # path of output file, excluding extension
use: true # write output to this file [default=true]
title: estuarine circulation # title [default read from getm.inp]
time_unit: day # time unit [second, hour, day, month, year, dt=model timestep; default=day]
time_step: 1 # number of time units between output [default=1]
time_start: 2000-01-01 00:00:00 # start of output [yyyy-mm-dd HH:MM:SS; default=start of simulation]
time_stop: 2000-01-01 12:00:00 # end of output [yyyy-mm-dd HH:MM:SS; default=end of simulation]
i_start: 1 # global start index for i dimension [default=1]
i_stop: 1 # global stop index for i dimension [default=ih]
i_stride: 1 # stride for i dimension [default=1]
j_start: 1 # global start index for j dimension [default=1]
j_stop: 1 # global stop index for j dimension [default=jh]
j_stride: 1 # stride for j dimension [default=1]
k_start: 1 # start index for k dimension [default=0]
k_stop: 1 # stop index for k dimension [default=kmax]
k_stride: 1 # stride for k dimension [default=1]
time_method: 1 # treatment of time dimension [1=instantaneous, 2=mean, 3=integrated; default=1]
xtype: 5 # data type [5=32-bit float, 6=64-bit double; default=5]
time_reference: # reference date and time to use in time units [yyyy-mm-dd HH:MM:SS; default=first output time]
sync_interval: 1 # number of output steps between sychronization to disk (<= 0: sync on close only) [default=1]
variables: # check output of "getm -l" for list of all registered variables
- source: /* # name of requested variable (/* for all)
time_method: 1 # treatment of time dimension [1=instantaneous, 2=mean, 3=integrated; default=1]
xtype: 5 # data type [5=32-bit float, 6=64-bit double; default=5]
name: # name used in output (for fields) [default=registered field name]
prefix: # name prefix used in output (for categories) [default=]
postfix: # name postfix used in output (for categories) [default=]
output_level: 8 # output level (for categories) [0=none, 2=required, 32=debug; default=8]
Entries in bold are mandatory. Additional files can be defined by appending dedicated blocks similar to the flexout: block.
In parallel mode each subdomain is responsible for its own output to individual files (the process id is automatically included in the file name). This means that subdomains will do different types of output depending on if they have stations inside or not – or depending on if an output region is part of a subdomain or not.