Opened 16 years ago

Closed 16 years ago

#143 closed enhancement (fixed)

Pass on ROPP undefined netCDF Variables to Output File

Reported by: frae Owned by: Huw Lewis
Priority: normal Milestone: 3.0
Component: ropp_io Version: 1.2
Keywords: Cc:

Description

I mainly have this when running the thinner on a netCDF file that contains, in addition to the usual ROPP variables, some additional variables (e.g. info on the antenna viewing angle). The output thinned ROPP file currently always contains the standard netCDF ROPP variables, any additional info is lost. Hence this limits the current use of ROPP quite a bit when using it for semi-operational processing or data analysis.

Adding variables manually to the code is also rather cumbersome, since one must assure that the code runs will all possible netCDF permutations. Hence the optimal approach would be to pass these additional variables straight through to the thinned netCDF file (or other output files if deemed necessary). One could even have a default thinning if the additional variable is an array which would not fit into the thinned output.

Change history (4)

comment:1 by (none), 16 years ago

Milestone: 3.0

Milestone 3.0 deleted

comment:2 by Dave Offiler, 16 years ago

Milestone: 3.0

comment:3 by Dave Offiler, 16 years ago

Action on Ticket #7 - handling of aribitrary additional variables to/from netCDF - is a pre-requisite for (and implicitly includes the objective on) this ticket. We will need some guidance/advice/templating from Chris to progress this one.

Since this ticket is effectively a duplicate of #7, I propose to close this with a resolution of 'duplicate' unless anyone feels there is more to this ticket than is covered by #7?

comment:4 by Huw Lewis, 16 years ago

Resolution: fixed
Status: newclosed

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.

TICKET CLOSED. (See also tickets #7, #141 and #143)

Note: See TracTickets for help on using tickets.