#565 closed task (fixed)
Adding option to ropp2ropp that allows file merging [1 d]
| Reported by: | Ian Culverwell | Owned by: | Ian Culverwell |
|---|---|---|---|
| Priority: | normal | Milestone: | ROPP9.1 carry over |
| Component: | ropp_io | Version: | 9.0 |
| Keywords: | Cc: |
Description
Original changesets:
Adding option to ropp2ropp that allows file merging: https://trac.romsaf.org/ropp/changeset/5203/ropp_src/branches/dev/Share/dmi_trunk_8.1/ropp_io/tools/ropp2ropp.f90
Change history (5)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Changes merged in at r6239. Closing ticket.
comment:3 by , 6 years ago
ROPP IO User Guide updated with small note about the thinning options in ropp2ropp at r6244.
Cosmetic changes to ropp2ropp.f90 made at r6245.
Further cosmetic changes, including the suppression of notice of the --no-ranchk and --no-zapem options, made at r6246.
Man page for ropp2ropp updated to describe the -t, -c and -r options at r6247.
Change log updated to describe changes in #565, #567 and #573 at r6248.
comment:4 by , 6 years ago
Actually, there was a bug in this implementation, as revealed by trying to build with nagfor61. (Don't know why ifort16 and 17 allowed it.) Works OK in core tests. Committed at r6256.
comment:5 by , 6 years ago
In fact, practical use of the -c merge_file option (to update the reference files for the test folder) revealed a bug when applied to multifiles: it was only merging in the first profile of merge_file, not the one corresponding to the ingested profile. This has been corrected at r6267. It changes, for example,
prompt:> ncks -H -vgeop_refrac -ddim_lev2a,0 IT-PP-03_ref.nc
netcdf IT-PP-03_ref {
dimensions:
dim_lev2a = 1 ;
dim_unlim = UNLIMITED ; // (15 currently)
variables:
float geop_refrac(dim_unlim,dim_lev2a) ;
data:
geop_refrac =
280.4352,
280.4352,
280.4352,
280.4352,
280.4352,
280.4352,
280.4352,
280.4352,
280.4352,
280.4352,
280.4352,
280.4352,
280.4352,
280.4352,
280.4352 ;
to
prompt:> ncks -H -vgeop_refrac -ddim_lev2a,0 temp3.nc
netcdf temp3 {
dimensions:
dim_lev2a = 1 ;
dim_unlim = UNLIMITED ; // (15 currently)
variables:
float geop_refrac(dim_unlim,dim_lev2a) ;
data:
geop_refrac =
280.4352,
1450.956,
2122.305,
629.4737,
432.4224,
728.05,
311.9792,
1842.442,
414.9779,
359.7213,
284.2602,
1858.641,
297.7543,
953.9425,
829.5668 ;
as required.

We agreed to postpone the changes to the attribute reading (
-b attrb_fileetc). I think this includes the setting of theROdata%conf_file, a variable that is not in the official release. (It was introduced into the DMI trunk at r5179.) The remainder looks OK. (There is an illogicality inbut this will be corrected in #566.)
Note that the
-c cfileoption only overwrites missing or invalid data:To test it, therefore, we need some valid and invalid data on the same levels. Examples are provided by ropp_io/tests/ropp_test_2v.nc and ropp_io/tests/ropp_test_1i.nc respectively, which are produced by ropp_io/tools/test2ropp.f90.
Input:
ncks -H -Q -ddim_lev1b,0,2 -vbangle ropp_test_1i.nc data: bangle = 0.13138889674682, -0.0475448771942475, -0.0207153398964107 ;Default processing, with range-checking off, to disable the zapping of the invalid data:
../tools/ropp2ropp ropp_test_1i.nc -o ropp_test_2o.nc.old -u --no-ranchk --------------------------------------------------------------------- ROPP-to-ROPP generic netCDF tool --------------------------------------------------------------------- WARNING (from ropp2ropp): Range checking is disabled INFO (from ropp2ropp): Reading ropp_test_1i.nc INFO (from ropp2ropp): Profile 1 : OC_21859999999999_UNKN_U999_UNKN INFO (from ropp2ropp): Writing ropp_test_2o.nc.oldOutput:
ncks -H -Q -ddim_lev1b,0,2 -vbangle ropp_test_2o.nc data: bangle = 0.13138889674682, -0.0475448771942475, -0.0207153398964107 ;Matches the input, as expected.
When instead we merge in ropp_test_2v.nc, which contains
ncks -H -Q -ddim_lev1b,0,2 -vbangle ropp_test_2v.nc data: bangle = 0.0496550894346332, 0.0592796970093641, 0.0308653631498784 ;then we get
../tools/ropp2ropp ropp_test_1i.nc -c ropp_test_2v.nc -o ropp_test_2o.nc.new -u --------------------------------------------------------------------- ROPP-to-ROPP generic netCDF tool --------------------------------------------------------------------- INFO (from ropp2ropp): Reading ropp_test_1i.nc INFO (from ropp2ropp): Reading merging file ropp_test_2v.nc INFO (from ropp2ropp): Profile 1 : OC_99999999999999_UNKN_U999_UNKN INFO (from ropp2ropp): Writing ropp_test_2o.nc.newthe result of which contains
ncks -H -Q -ddim_lev1b,0,2 -vbangle ropp_test_2o.nc data: bangle = 0.0496550894346332, 0.0592796970093641, 0.0308653631498784 ;which is the same as the file that was merged in. Good.