[Thread Prev][Thread Next][Index]

[ferret_users] RESHAPE and SAVE error - variable unknown



Hi,

I'm using Ferret 6.7.1.

I need to change the axes ( i to t, j to i, k to j & then reverse the new j values ) of a variable in a netcdf file and i'm using RESHAPE to do that. But on opening the new file i get an error about unknown variables. The commands and outputs are:

yes? use/order=yzx NPP_1982_nc3.nc
yes? sh da
     currently SET data sets:
    1> ./NPP_1982_nc3.nc  (default)
 name     title                             I         J         K         L
 NPP                                    1:1440  1:720    1:12      ...

yes? set variable/title="Net prim prod"/bad=-999 npp

yes? define axis/x=0:359.75:0.25/units=degrees xax
yes? define axis/y=90s:89.75n:0.25/units=degrees yax
yes? define axis/t=1:12:1/calendar=noleap/units=months tax
 *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days

yes? define grid/x=xax/y=yax/t=tax npp_grd

yes? let dummy = x[gx=npp_grd] + y[gy=npp_grd] + t[gt=npp_grd]

yes? let/title="New NPP" npp_new = reshape(npp,dummy)
yes? sh gr npp_new
    GRID NPP_GRD
 name            axis                 # pts     start              end
 XAX       LONGITUDE         1440mr     0E             0.25W
 YAX       LATITUDE               720 r     90S           89.75N
 normal    Z
 TAX       T (MONTHS(NOLE      12 r   1                    12

yes? fill npp_new[l=1] !! works correctly, but lat values are reversed in the same way as the original netcdf file ie continents are reversed

yes? save/clobber/file=myvar.nc npp_new
 LISTing to file myvar.n

yes? can da/all
 
yes? use myvar.nc
yes? sh da myvar.nc
     currently SET data sets:
    1> ./myvar.nc  (default)
 name              title                    I           J         K         L
 NPP_NEW  New NPP           1:1440    1:720     ...       1:12

yes? fill npp_new[l=1]
 **ERROR: variable unknown or not in data set: NPP
CONTOUR/FILL npp_new[l=1]
Command file, command group, or REPEAT execution aborted

---------

How do i make the reshape & save commands work correctly? Any other method to change the axes is fine.

Also how to reverse the values along the latitudes? Is using ncdump and ncgen the only way?

--
Thanks,
Samrat Rao.

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement