Norwegian Service Centre for Climate Modelling -> Format Conversion Tools -> nyfelt User Guide
 
 

 

     

Creation of a new FELT-file

The program nyfelt was written by Anstein Foss at DNMI. The program generates a new FELT-file based on the input parameters found in the input file.

Usage:

nyfelt inputfile

PURPOSE:
Create FELT file.
Copy fields from one FELT file to another.

Basic document on FELT files:

FILE STRUKTUR FOR "SANNTIDS" LAGRING AV GRID-DATA Forskningsavdeling DNMI, oktober 1982

FELT file types:

STANDARD
one basic date/time (analysis or reference) all fields stored with forecast lengths (positive, zero or negative) relative to this date/time
ARCHIVE
several basic date/time's (and forecast lengths as 'standard')
CYCLIC_ARCHIVE
'archive' where the oldest date/time will be removed when writing a new date/time to the file (NYFELT has options to do such update)

Specifications for NYFELT is given in a 'nyfelt.input' file when running the program. This file is given to the program as a command line argument, e.g.:

     nyfelt nyfelt.input
or with a more describing file name:
     nyfelt nyfelt.lam50s
or print help lines in the 'nyfelt.input' file (if such exists):
     nyfelt nyfelt.lam50s ?

NYFELT.INPUT:

Consists of two sections (which may be repeated):

  1. General specifications
    (file name, date/time, grid, file type etc.)
  2. Field identifications
    (forecast_lengths, levels, parameters)

Comment lines are expected to be found before each section and also between each 'loop' in the 'field identification' section. Comment lines start with a * in column one. The last comment line before 'real' program input has *> in the two first columns. Help lines are identified with *=> in the three first columns.

General specification section:

Consists of keywords with and without user values. Syntax is 'KEYWORD=value' or 'KEYWORD'. (Keywords are always converted to uppercase letters, and is everything in front of a = sign. Several keywords may be written on one line separated by a ; sign. The maximum line length is 80 characters.) There are two ways to use variables here, instead of editing the 'user values' in the 'nyfelt.input' file:

  • environment variables, starting with a $ sign (e.g. 'FILE=$feltfile')
  • command line arguments, starting with a # sign and followed by the argument no. (e.g. 'FILE=#2'), remember that argument no. 1 (#1) always is the name of the 'nyfelt.input' file.

There is no sequence rules for the keywords.

Keywords and user values (the second in <....>):

'FILE=<output_FELT_file>'
name of the output file
'TIME=<year,month,day,hour>'
date/time when creating a file, for Archive files this is the first date/time on the file (but after creation the last date/time will be used as the file's date/time), for Cyclic_Archive files this is the last date/time.
'TIME.FILE_IN'
date/time as the input file when creating a file (as above for Archive files).
'FILE_IN=<input_FELT_file>'
input file, for date/time and/or field copy.
'TIME_STEP=<nstep, year_step,month_step,day_step,hour_step>'
used when creating Archive or Cyclic_Archive files, nstep is the number of timesteps followed by the step in years,months,days and hours, 3 of these must be 0.
'FELT.STANDARD'
output FELT file type is Standard.
'FELT.ARCHIVE'
output FELT file type is Archive.
'FELT.CYCLIC_ARCHIVE'
output FELT file type is Cyclic_Archive.
'DATA_GAPS.ON'
each field will occupy a whole number of records, and always start in the first word of a record (default) (this option is ignored if the file is not created)
'DATA_GAPS.OFF'
field data will not occupy more space than necessary, there will be no unused space between two fields (this option is ignored if the file is not created)
'MODE.CREATE'
the output file is created (if the file exists, and the file name is not a 'link', the existing file will be removed).
'MODE.CREATE+COPY'
the output file is created and all fields in the 'field identification' section wil be copied from the input file (if they exist).
'MODE.COPY'
copy fields from the input to the output file, output file must exist (it is not created).
'MODE.UPDATE'
for Archive and Cyclic_Archive files. copy fields from the (Standard type) input file, no 'field identification' section is needed as nyfelt uses the existing 'content list' in the file, only one date/time is copied and for Cyclic_Archive files the date/time will be 'cycled' if necessary (removing the oldest date/time).
'MODE.UPDATE_ALL'
for Archive and Cyclic_Archive files. if the input file is a Archive or Cyclic_Archive file all timesteps will be copied using the existing 'content list' (use this to regenerate a file after changing 'content list')
'GRID=<producer,grid,grid_type>'
the producer no., grid no. and grid type for all fields in the following 'field identifications', this option may be repeated, giving the same field identifications for all 'grids'.
'OVER_WRITE.ON'
allow overwrite of existing fields when fields are copied (default).
'OVER_WRITE.OFF'
prevent overwrite of existing fields when fields are copied.
'CHECK_TIME.ON'
check date/time of fields before copy (current version of WFELT routine will as default use the output file's date/time) (default)
'CHECK_TIME.OFF'
not check date/time (useful when copying fields which really are independant of time).
'INFO.ON'
print messages about missing fields during copy (default).
'INFO.OFF'
not print messages about missing fields during copy.
'PROG_LIMIT=<min_prog_hour,max_prog_hour>'
used to decrease the number of forecast lengths given in the following 'field identification' section (when this is made to cover a maximum length forecast) (default is no limit, i.e. -32767,+32767)
'DEFINE.LOOP= <identifier>,<value1>,<value2>,...'
when the 'identifier' value is found the time/level/parameter section, the identifier element is replaced with all these values, identifiers should be in the range -32767 - +32767 and have a value not used anywhere else.
'DEFINE.LOOP.FROM.TO.STEP= <identifier>,<first>,<last>,<step>'
as above, except that values are specified by the first, last and increment (step) value.
'CONTINUE'
end of this 'general specification' section, but another will follow (usually after a 'field identification' section)
'END'
end of the last (and usually only) 'general specification' section. for MODE.CREATE, MODE.CREATE+COPY and MODE.COPY a 'field identification' section must follow.

Note: There is no default for FELT file type (FELT.xxx) and the action to be done (MODE.xxx). When more than one producer is defined (in GRID=...) they must be given in increasing order (FELT file sequence rule). If more than one 'general spec.' section is used, the previous defined 'grid(s)' will be 'forgotten' if at least one grid is specified.

Field identification section:

This section defines the field identifications to be created or the fields to be copied. Date/time and producer,grid and grid type is given in the 'general spec.' section above, as they (in almost all cases) will be constant here, but also the part of field id.'s which most frequently changes ('variables' are not allowed in the field id. section). The organization of this section is more strict than FELT file rules. It defines 'loops' where the outer loop is forecast lengths, then levels and with parameters as the inner loop. Several of these trippel loops may be needed to store fields with different forecast lengths (different time steps) and combinations of levels and parameters. Note that for some reason the vertical coordinate is paired with parameter numbers and not levels. In front of each trippel loop is one or more comment lines. The easiest way to explain this is an example:

   ** Comments:
   **
   **   4 forecast lengths
   **      4 pairs of datatype and forecast length
   **  11 levels
   **     11 pairs of level_1 and level_2    (level_2 is usually 0)
   **   5 parameters
   **      5 pairs of vertical coordinate and parameter
   **
   *>
   4
   1,0, 3,0, 2,6, 2,12
   11
   100,0, 150,0, 200,0, 250,0, 300,0, 400,0, 500,0,
          700,0, 850,0, 925,0, 1000,0
   5
   1,1, 1,2, 1,3, 1,10, 1,18
To terminate the sequence of trippel loops:
   ** Comments:
   **    end of forecast length / level / parameter loops
   *>    0 forecast lengths
   0

If more than one grid is defined (in GRID=...), there will be a 'grid loop' on the outside of all the trippel loops explained above. For Archive and Cyclic_Archive there is an extreme outer loop (also outside all field id. sections) on date/time.

EXAMPLE 1. Create a file for LAM analysis and some model output

======================================================================
*** nyfelt.lam50s  ('nyfelt.input')
***
*=> Create FELT file for LAM50S.
*=>
*=> Environment var:
*=>    none
*=> Command format:
*=>    nyfelt  nyfelt.lam50s  1992,8,25,0  +12  felt00.dat
***
***----------------------------------------------------------------
**
** Option list:
**-------------
** FILE=<output_FELT_file>
** TIME=<year,month,day,hour>
** TIME.FILE_IN
** TIME_OFFSET=<years,months,days,hours>
** FILE_IN=<input_FELT_file>
** TIME_STEP=<nstep, year_step,month_step,day_step,hour_step>
** FELT.STANDARD
** FELT.ARCHIVE
** FELT.CYCLIC_ARCHIVE
** DATA_GAPS.ON  ............................... (default)
** DATA_GAPS.OFF
** MODE.CREATE
** MODE.CREATE+COPY
** MODE.COPY
** MODE.UPDATE
** MODE.UPDATE_ALL
** GRID=<producer,grid,grid_type> .............. (repeatable)
** OVER_WRITE.ON  .............................. (default)
** OVER_WRITE.OFF
** CHECK_TIME.ON  .............................. (default)
** CHECK_TIME.OFF
** INFO.ON  .................................... (default)
** INFO.OFF
** PROG_LIMIT=<min_prog_hour,max_prog_hour> .... (default = no limit)
** DEFINE.LOOP= <identifier>,<value1>,<value2>,...
** DEFINE.LOOP.FROM.TO.STEP= <identifier>,<first>,<last>,<step>
** CONTINUE
** END
**
**+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
** Options (for CREATE of STANDARD file)     Remember '....' syntax.
** ($... = environment var. ;  #n = command line arg. no. n)
*>
'FILE= #4'
'TIME= #2'
'PROG_LIMIT= -32767,#3'             ..... or 'PROG_LIMIT=-32767,+48'
'GRID= 88,1814,1'                   ..... or 'GRID= 88,$grid_no,1'
'FELT.STANDARD'
'MODE.CREATE'
'END'
**+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
**
*> ..... P LEVELS: Z(1) U(2) V(3) RH(10) POT.TEMP.(18)
4
1,0, 3,0,  2,6, 2,12
11
100,0, 150,0, 200,0, 250,0, 300,0, 400,0, 500,0,
       700,0, 850,0, 925,0, 1000,0
5
1,1, 1,2, 1,3, 1,10, 1,18
**
*> ..... SIGMA LEVELS: U(2) V(3) POT.TEMP.(18) Q(9) OMEGA(13)
3
3,0, 2,6, 2,12
18
1,0,  2,0,  3,0,  4,0,  5,0,  6,0,  7,0,  8,0,  9,0, 10,0, 11,0,
     12,0, 13,0, 14,0, 15,0, 16,0, 17,0, 18,0
5
2,2, 2,3, 2,18, 2,9, 2,13
** .....
** ..... SURFACE:
*> ..... MSLP(58) T2M(31) U10M(33) V10M(34)
5
3,0, 2,3,  2,6,  2,9,  2,12
1
1000,0
4
2,58, 2,31, 2,33, 2,34
**
*> ..... end of time/level/parameter section
0
======================================================================

EXAMPLE 2. Create file and copy LAM analysis fields.

======================================================================
*** nyfelt.copyana  ('nyfelt.input')
***
*=> Create FELT file and copy LAM analysis
*=>
*=> Environment var:
*=>    none
*=> Command format:
*=>    nyfelt  nyfelt.copyana  felt1.dat  1814  felt2.dat
*=>                            <input>   <grid>  <output>
***
***----------------------------------------------------------------
**
** Option list:
**-------------
** FILE=<output_FELT_file>
** TIME=<year,month,day,hour>
** TIME.FILE_IN
** TIME_OFFSET=<years,months,days,hours>
** FILE_IN=<input_FELT_file>
** TIME_STEP=<nstep, year_step,month_step,day_step,hour_step>
** FELT.STANDARD
** FELT.ARCHIVE
** FELT.CYCLIC_ARCHIVE
** DATA_GAPS.ON  ............................... (default)
** DATA_GAPS.OFF
** MODE.CREATE
** MODE.CREATE+COPY
** MODE.COPY
** MODE.UPDATE
** MODE.UPDATE_ALL
** GRID=<producer,grid,grid_type> .............. (repeatable)
** OVER_WRITE.ON  .............................. (default)
** OVER_WRITE.OFF
** CHECK_TIME.ON  .............................. (default)
** CHECK_TIME.OFF
** INFO.ON  .................................... (default)
** INFO.OFF
** PROG_LIMIT=<min_prog_hour,max_prog_hour> .... (default = no limit)
** DEFINE.LOOP= <identifier>,<value1>,<value2>,...
** DEFINE.LOOP.FROM.TO.STEP= <identifier>,<first>,<last>,<step>
** CONTINUE
** END
**
**+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
** Options (for CREATE of STANDARD file)     Remember '....' syntax.
** ($... = environment var. ;  #n = command line arg. no. n)
*>
'FILE= #4'
'FILE_IN= #2'
'TIME.FILE_IN'
'GRID= 88,#3,1'                     ..... or 'GRID= 88,1814,1'
'FELT.STANDARD'
'MODE.CREATE+COPY'
'END'
**+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
**
** ..... Analysis.
*> ..... P LEVELS: Z(1) U(2) V(3) RH(10)
1
1,0
11
100,0, 150,0, 200,0, 250,0, 300,0, 400,0, 500,0,
       700,0, 850,0, 925,0, 1000,0
4
1,1, 1,2, 1,3, 1,10
**
*> ..... end of time/level/parameter section
0
======================================================================

*********************************************************************

=====================================================================
 FILE=<output_FELT_file>
 TIME=<year,month,day,hour>
 TIME.FILE_IN
 TIME_OFFSET=<years,months,days,hours>
 FILE_IN=<input_FELT_file>
 TIME_STEP=<nstep, year_step,month_step,day_step,hour_step>
 FELT.STANDARD
 FELT.ARCHIVE
 FELT.CYCLIC_ARCHIVE
 DATA_GAPS.ON  ............................... (default)
 DATA_GAPS.OFF
 MODE.CREATE
 MODE.CREATE+COPY
 MODE.COPY
 MODE.UPDATE
 MODE.UPDATE_ALL
 GRID=<producer,grid,grid_type> ................. (repeatable)
 OVER_WRITE.ON  ................................. (default)
 OVER_WRITE.OFF
 CHECK_TIME.ON  ................................. (default)
 CHECK_TIME.OFF
 INFO.ON  ....................................... (default)
 INFO.OFF
 PROG_LIMIT=<min_prog_hour,max_prog_hour> ....... (default = no limit)
 DEFINE.LOOP= <identifier>,<value1>,<value2>,...
 DEFINE.LOOP.FROM.TO.STEP= <identifier>,<first>,<last>,<step>
 CONTINUE
 END
=====================================================================

 

Send comments to webmaster