We just updated NCO to 4.9.7 and mro is not working correctly.
ncra --mro -d time,,,12,12 in.nc out.nc
The command runs but out.nc has only 1 time slice, the average of all the time slices (and the value of the average is correct). I'm really hoping to use the per_record_weights option offered by 4.9.7! How could we troubleshoot this?
Is the input file somehow not structured right? It looks like this:
netcdfin{dimensions:lat=1;lon=1;time=UNLIMITED;//(1140currently)variables:doublelat(lat);//snipdoublelon(lon);//snipdoubletime(time);time:units="days since 1900-01-01 00:00:00";time:long_name="time";time:calendar="standard";time:missing_value=1.00000001504747e+30;time:bounds="time_bnds";time:axis="T";time:standard_name="time";time:cell_methods="time: mean";floattmin(time,lat,lon);tmin:_FillValue=1.e+30f;tmin:missing_value=1.00000001504747e+30;tmin:units="K";}
Returning from a hiatus... so am feeling a little rusty. Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First, I discovered that mro works OK on some of my files. So I compared the metadata of the working & non-working files and could not find any difference. I also tried extracting smaller slabs and -- weirdly -- some of the small slabs worked with mro and some didn't.
I then tried running "ncra --mro" with the debug flag "-D 3", and compared the debug info between the working and non-working files. With the non-working file, debug info showed all the input time slices going into one output time slice, but it did not hint at the cause.
Finally, I tried exporting a small slab (for which mro did not work) into cdl and re-create an nc file from that using ncgen, and mro worked on the resulting file! That gave me the idea that something must be corrupt in my nc file. So I ran "ncks -3" on the file to convert it to netcdf3, thinking not so much that the version is important, but having NCO write the file out itself is important. Then I ran "ncra --mro" on the resulting file, and it's working. Phew!
Just documenting in case others run into a similar problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We just updated NCO to 4.9.7 and mro is not working correctly.
The command runs but out.nc has only 1 time slice, the average of all the time slices (and the value of the average is correct). I'm really hoping to use the per_record_weights option offered by 4.9.7! How could we troubleshoot this?
Is the input file somehow not structured right? It looks like this:
Returning from a hiatus... so am feeling a little rusty. Thank you.
Found a workaround after a lot of voodoo!
First, I discovered that mro works OK on some of my files. So I compared the metadata of the working & non-working files and could not find any difference. I also tried extracting smaller slabs and -- weirdly -- some of the small slabs worked with mro and some didn't.
I then tried running "ncra --mro" with the debug flag "-D 3", and compared the debug info between the working and non-working files. With the non-working file, debug info showed all the input time slices going into one output time slice, but it did not hint at the cause.
Finally, I tried exporting a small slab (for which mro did not work) into cdl and re-create an nc file from that using ncgen, and mro worked on the resulting file! That gave me the idea that something must be corrupt in my nc file. So I ran "ncks -3" on the file to convert it to netcdf3, thinking not so much that the version is important, but having NCO write the file out itself is important. Then I ran "ncra --mro" on the resulting file, and it's working. Phew!
Just documenting in case others run into a similar problem.
Thanks for the input. NCO 5.1.9 had a fix to --mro that might help your use-case. I suggest updating to the latest stable version, 5.3.6.