Opened 19 years ago
Closed 16 years ago
#7 closed enhancement (fixed)
Reading of added variables
Reported by: | frcm | Owned by: | Dave Offiler |
---|---|---|---|
Priority: | normal | Milestone: | 3.0 |
Component: | ropp_io | Version: | 0.8 |
Keywords: | Cc: | dave.offiler@…, axel.vonengeln@… |
Description
The ropp_io package allows to extend the ROprof data type with additional variables; at present, there is no user interface to read this data. This needs to be added.
Change history (7)
comment:1 by , 19 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 19 years ago
Cc: | added |
---|---|
Milestone: | 0.9 → 1.0 |
Owner: | changed from | to
severity: | normal → major |
Status: | assigned → new |
Version: | 0.7 |
comment:3 by , 18 years ago
Version: | → 0.8 |
---|
comment:4 by , 17 years ago
Milestone: | 1.1 → 2.0 |
---|---|
Owner: | changed from | to
severity: | major → normal |
Status: | new → assigned |
Type: | defect → enhancement |
comment:5 by , 16 years ago
Milestone: | 2.0 |
---|
comment:6 by , 16 years ago
Milestone: | → 3.0 |
---|
comment:7 by , 16 years ago
Cc: | removed |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
See changeset [1797] - for ROPP release v2.0.
These updates now ensure a netCDF file with any number of additional variables (scalar 0-d, 1-d or 2-d data types) in read in and subsequently written out along with the anticipated variables defined by the ROPP interface file format.
Enhancements to the functionality of ropp_io_read_ncdf_get to enable undefined variables (i.e. not explicitly read using ncdf_getvar call) to be read from an input file, and written out again. i.e. additional variables are preserved on subsequent read/write.
Method:
- In ncdf_open the opened file is checked for the number of variables it contains, and this is saved to a ncdf module variable ncdf_nvars.
- The ncdf module has a new public variable ncdf_read. This is an array of logical statements, set to true in ncdf_getvar for each variable which is read.
- After all explicitly defined variables are read in ropp_io_read_ncdf_get, the ncdf_read variable is checked for each of the ncdf_nvars available variables. For those variables in the input file not yet read, a routine ropp_io_read_ncdf_get_vlistD#d is called, depending on the dimension of the variable to be read in.
- The vlist read routines (in file ropp_io_vlist_read) allocate an element of the Vlist data types in the ROprof structure, depending on the dimensions of the variable to be read. The variable name is found by doing a variable inquiry. Given the name and allocated variable structure, the additional data are read with a call to ncdf_getvar as before.
- Note udunits has been modified to allow output units to be set to input units if the output units are not previously set (e.g. for reading additional variables).
- Added variables are written out as before in ropp_io_write_ncdf_def and ropp_io_write_ncdf_put routines.
Note that it is not envisaged that ROPP will provide functionality to process additional variables - given we can't be expected to know what type of variables may be included. A simple addition to rangechecking procedures may be added however - I will write a new ticket to cover this idea.
ropp2ropp has been successfully tested using additional 1d and 2d data arrays, and cases with more than 1 added variable in a file.
Milestone 2.0 deleted