MAPL History
From Maplcode.org
MAPL_History is an internal MAPL gridded component used to manage output streams from a MAPL hierarchy. It uses MAPL_CFIO to write diagnostics from a MAPL hierarchy during the course of a run.
Output is organized into collections described in a configuration file (HISTORY.rc). Fields in a collection can come from the Export state of any component in the hierarchy.
The only user interface is through the configuration file (HISTORY.rc), which controls basic properties of a diagnostic history, such as which fields to output, how file collections are organized, the frequency of output, time averaging of the data, etc.
MAPL_History also provides a limited capability to produce data on horizontal and vertical grids other than the application's native grid.
Because it is written on top of MAPL_CFIO, each collection can consist of either self-describing format (netcdf or HDF) files or Grads flat binary files with the accompanying .ctl.
For details, see the "protex" documentation ( pdf ) from the code.
[edit] Wrting a HISTORY.rc file
1. The following is an example of HISTORY.rc file. It starts with a header containig
an experiment id, a more descriptive definition of the contents and a list of the
collections described in file. This is followed by a series
of collection blocks, each describing the contents of one of the collection in
the collection list.
EXPID: fvhs_example
EXPDSC: fvhs_(ESMF07_EXAMPLE)_5x4_Deg
COLLECTIONS:
'dynamics_vars_p'
::
dynamics_vars_p.template: '%y4%m2%d2_%h2%n2z.hdf',
dynamics_vars_p.format: 'CFIO',
dynamics_vars_p.frequency: 030000,
dynamics_vars_p.duration: 030000,
dynamics_vars_p.resolution: 72 45,
dynamics_vars_p.vscale: 100.0,
dynamics_vars_p.xyoffset: 3,
dynamics_vars_p.vunit: 'hPa',
dynamics_vars_p.vvars: 'log(PLE)' , 'FVDYNAMICS' ,
dynamics_vars_p.levels: 1000 900 850 750 500 300 250 150 100 70 50 30 20 10 7 5 2 1 0.7,
dynamics_vars_p.fields: 'T_EQ' , 'HSPHYSICS' ,
'U' , 'FVDYNAMICS' ,
'V' , 'FVDYNAMICS' ,
'T' , 'FVDYNAMICS' ,
'PLE' , 'FVDYNAMICS' ,
::
2. The following is a sample configuration file (HISORY.rc), which contains the arithmetic parsing expression of the output field. There are several rules needed to be applied to use arithmetic parsing operations of the output field. First, the main idea of the arithmetic parsing output is to reuse the given (or already defined) output variables so that the arithmetic parsing expression must be combination of the given output variables. The given output variables always should be placed prior to the arithmetic parsing output field expressions. Both the actual and alias output field variables can be mixed in the arithmetic parsing expression. Even the pre-defined arithmetic parsing output fields can also be reusable in the new arithmetic parsing expression of the output field. Second, the real number should be used with a radix point (i.e., decimal point or dot '.'). The integer number also needs to be accompanied with a radix point. For example, the integer 100 should be used as the real number 100.0 in the arithmetic parsing expression. Third, the arithmetic operations that can be used in the arithmetic parsing output are summation ('+'), subtraction ('-'), multiplication ('*'), division ('/'), and exponentiation ('^'). Also the round brackets or parentheses '()' can be used in the arithmetic parsing expression. Fourth, the actual and alias output field expression used in the arithmetic parsing expression can be lower and upper case characters, underscore (i.e., '_'), as well as the integer number but they should be case sensitive when reused. Finally, the type of field (i.e., the second component of the output field variable) used in the arithmetic parsing output field can be selected as a default type but it must be consistently matched with the variable used in the arithmetic parsing expression.
EXPID: fvhs_example
EXPDSC: fvhs_(ESMF07_EXAMPLE)_5x4_Deg
COLLECTIONS:
'dynamics_vars_p'
::
dynamics_vars_p.template: '%y4%m2%d2_%h2%n2z.hdf',
dynamics_vars_p.format: 'CFIO',
dynamics_vars_p.frequency: 030000,
dynamics_vars_p.duration: 030000,
dynamics_vars_p.resolution: 72 45,
dynamics_vars_p.vscale: 100.0,
dynamics_vars_p.xyoffset: 3,
dynamics_vars_p.vunit: 'hPa',
dynamics_vars_p.vvars: 'log(PLE)' , 'FVDYNAMICS' ,
dynamics_vars_p.levels: 1000 900 850 750 500 300 250 150 100 70 50 30 20 10 7 5 2 1 0.7,
dynamics_vars_p.fields: 'T_EQ' , 'HSPHYSICS' , 'Te',
'U' , 'FVDYNAMICS' , 'U1',
'V' , 'FVDYNAMICS' , 'U2',
'T' , 'FVDYNAMICS' , 'Tk',
'U*V' , 'FVDYNAMICS' , 'uv',
'U+V' , 'FVDYNAMICS' , 'UVsum',
'U^2.0' , 'FVDYNAMICS' , 'Upow',
'V^2.0' , 'FVDYNAMICS' , 'Vpow',
'Upow+Vpow', 'FVDYNAMICS' , 'UVpow_sum',
'(U^2.0+V^2.0)^0.5', 'FVDYNAMICS' , 'Vel',
'UVpow_sum^0.5-Vel', 'FVDYNAMICS' , 'Vel0',
'(Upow+Vpow+2.0*uv)-(U+V)^2.0+Vel', 'FVDYNAMICS', 'Vel1',
'(U^2.0+V^2.0-V^2.0)^0.5' , 'FVDYNAMICS', 'Vel2'
'(U+V)^2.0-V^2.0-2.0*U*V' , 'FVDYNAMICS', 'Upow2',
'((-U-V)^2.0)^0.5' , 'FVDYNAMICS', 'UVsum2',
'T-T_EQ' , 'FVDYNAMICS' , 'Tc',
'T+T+T' , 'FVDYNAMICS' , 'Tsum',
'T/T_EQ' , 'FVDYNAMICS' , 'Tnormal',
'T/273.0' , 'FVDYNAMICS' , 'Tn',
'Tn*273.0' , 'FVDYNAMICS' , 'To',
'(Tsum^2.0)^0.5', 'FVDYNAMICS' , 'Tsum_pow',
'(Tc+T_EQ)/273.0', 'FVDYNAMICS' , 'Tmix',
'1000.0*U*V*T', 'FVDYNAMICS' , 'UVT_scale',
'UVT_scale/1000.0', 'FVDYNAMICS' , 'UVT',
'UVT/uv' , 'FVDYNAMICS' , 'Tk1',
'(uv-T+T_EQ)/T_EQ', 'FVDYNAMICS' , 'UVT_mix',
'U+U*V-V^2.0-3.0*T*T_EQ+T_EQ^2.0', 'FVDYNAMICS', 'UVT_mix1',
'(U1^2.0+U2^2.0)^0.5*Tk/Te' ,FVDYNAMICS', 'UVT_mix2',
::
