Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

The general usage is the following:

Volet

Convert from NetCDF to RPN format:

    cdf2rpn   -rpn RPN_standard_file    -cdf NetCDF_file    -attr attribut_list 

Convert from RPN to NetCDF format - one needs to add the key '-dir' (for 'direction'):

    cdf2rpn   -rpn RPN_standard_file    -cdf NetCDF_file    -attr attribut_list    -dir

Notes:

  • If you do not add a path to the output file name the file will end up in $TMPDIR!!!
  • All fields in a file must have the same "type" of leveltimesteps and levels.  
    You cannot have i.e. sigma, hybrid, arbitrary and pressure levels in the same file!!! Nor can there be, for example, a field on 20 pressure levels and another on only 1 pressure level. If your RPN input file contains fields with different types or numbers of fields levels you can select the fields your want to convert with 'r.diag' and/or 'editfst' - see above.
  • If converting RPN to NetCDF make sure your RPN file contains all necessary grid descriptors ('^^', '>>', '^>', 'HY','!!')
  • All variables you want to convert need to be in the attribute list - see below.

Attribute list

The attribute list

...

is a file. It can be considered as a dictionary to translate between RPN ↔ netCDF.

You can find an example file on the UQAM servers under:   ~winger/Scripts/NetCDF_converter/attribut_netcdf.dat

The file consists of:

1) Documentation

At the beginning are several commented lines containing information about the file.

2) Coordinate variables

The first section of this file, after the comments, contains a list of coordinate variables. Do not modify this section!!! It is limited by 
    #---------------- Variables coordonnees (debut) (NE PAS MODIFIER) ---------------------
            :
    #---------------- Variables coordonnees (fin) (NE PAS MODIFIER) ------------------------

3) Global attributes

The second section contains the global attributes. Global attributes are related to the dataset as a whole and should be used to provide a description of the dataset.

4) Fields / Variables

The last section needs to contain an entry for each field/variable that is to be converted. Each entry starts with 'def_attribut' and needs to have the form below.
Make sure the factors are correct!!!


Volet

 def_attribut[ name; ccname; mult; add;
               nom_attribut = valeur_attribut;
               nom_attribut = valeur_attribut; N;
               nom_attribut = valeur_attribut; valeur_attribut; N; ]

Where:

   name: name of netCDF variable - mandatory
   cccname: name of RPN variable - mandatory
   mult: multiplication factor for units (type real) DEFAUT 1.0
   add: additive factor for units (type real) DEFAUT 0.0
   nom_attribut: name of the attribute
   valeur_attribut: value associated to "nom_attribut"
   N: integer vale defining the type of "valeur_attribut" (2=character, 3=integer*2, 5=real*4)

Notes: 

  • Unit conversion from RPN → netCDF:         unit(RPN) = mult*unit(netCDF)+add 
  • Unit conversion from netCDF → RPN :        unit(netCDF)= (unit(RPN)-add)/mult 
  • 'nom_attribut = ...' are only used for conversions to netCDF format.
  • Never put a space before the ";"!
  • "[", "]", "=" and ";" are reserved characters. Do not use them otherwise, for example in names or descriptionsMake sure that the factors are correct!!!  If one or more of your variables are not in this file, just take a copy and add the missing variables.