HWRF  trunk@4391
Static Public Attributes | List of all members
hwrf.namelist.NamelistInserter Class Reference

Insert config file data into a Fortran namelist file. More...

Detailed Description

Insert config file data into a Fortran namelist file.

This class parses an input file that contains a partial namelist, inserting missing values of the format <s:cycle> with values from a ConfigParser-like object. The <s:cycle> sorts of text follow a specific format:

<d:varname> – the conf variable is converted to a datetime.datetime using hwrf.numerics.to_datetime, and then to a string of the format "YYYY-MM-DD_HH:MM:SS". If atime is specified to the parse subroutine, then the value is allowed to be a difference relative to the atime (as accepted by hwrf.numerics.to_datetime_rel).

<u:varname> – convert the conf variable to a string, and dump its value unquoted. This is used, for example, to have the name of a namelist variable be generated from a conf file.

You can also specify angle braces without a type:

<varname>

to ask for the variable to be converted by guessing the type that was intended in the conf file. For example:

This conf file:

1 [conf]
2 var=T,F,T

With this namelist:

1 &nl
2  myvar=@<var@> /

will produce:

1 &nl
2  myvar=.true., .false., .true. /

As for variables, one can request a subitem of a variable:

for subscriptable types. This is mainly intended for vitals.

Definition at line 154 of file namelist.py.

Inheritance diagram for hwrf.namelist.NamelistInserter:

Static Public Attributes

tuple find_ltgt = re.compile()
 regular expression that finds namelist insertion data <...>
 
tuple nlfalse = re.compile('\A(?i)(?:f.*|.false.|n|no|0*[1-9][0-9]*)\Z')
 regular expression that matches false values
 
tuple nltrue = re.compile('\A(?i)(?:t.*|.true.|y|yes|0)\Z')
 regular expression that matches true values
 

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