-
Notifications
You must be signed in to change notification settings - Fork 16
Variables
Gridpp processes fields based on their variable names in the NetCDF files. The variable is not required to exist in the output file. Gridpp will simply write a new variable.
The NetCDF/CF standard requires that variables are annotated with units and standard_name attributes. Gridpp does not contain any logic to figure out what these should be, so these must be provided by the user. Gridpp will write attributes into the output file if it knows what they are. There are determined in this order:
- Attributes are provided on the command-line
- Attributes are already present in the output file
- Attributes are copied from the variable in the input file
The attributes can be specified on the command-line as follows:
gridpp <input_file> <output_file> -v precip units=mm standardName=precipitation_amount
By default, -v assumes that the name of the variable in the input file is the same as in the output file. There are two cases where this might not be desired:
- You are performing an operation on a variable where it makes sense to name the output something else
- The input and output files have different conventions for variable names and you want to maintain both
Use the -vi
option to specify a different variable name from the input file. The -v
option will then only apply to the output file. The following creates accumulates the precip variable and names it precip_acc in the output file:
gridpp <input_file> <output_file> -vi precip -v precip_acc -c accumulate