[Thread Prev][Thread Next][Index]

Re: [ferret_users] append does not work on K axis



Hi jean,
This is a feature of NetCDF files.  Only one axis can be appended to; it is called the "record axis". In the netCDF standard that Ferret uses, if there is a record axis it's always the T axis. 

You can append in K, but you need to first set up the K axis with the full length that it will have when all the levels are added. This is discussed here,  (look up "append, slabs to netCDF file" in the index to the documentation).

http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/converting-to-netcdf/SIMPLE-CONVERSIONS-USING-FERRET#_VPINDEXENTRY_1071

Where the crucial step is that first you do a SAVE/KLIMITS=

and then you can SAVE/APPEND/K=

--Ansley

On 1/11/2013 9:55 AM, jean li wrote:
Hi All:

I have a script to apply mask to a 3D array  with dimension (I,J,K) at each k level. However, I found that the "append" command cannot save all the data at k levels. It only saves the last K index. The append works fine if the array is at (I,J,L) dimension, i.e., on L index. Below is my script:

let num=3022*12*30;
use "/home/liz/tgtbox_scripts/mask_osra_mod.nc"
repeat/range=2000:2006/name=m (use "/data/CP_GOM/cp_map_ann_`m`.nc";\
repeat/k=1:30 (let cp_ann=cp*mask2[d=1]/num;\
save/append/clobber/file="/data/CP_GOM/cp_map_ann_`m`_v2.nc" cp_ann;))

Thanks for your help!

Jean
 

--- On Thu, 1/10/13, Ansley Manke <ansley.b.manke@xxxxxxxx> wrote:

From: Ansley Manke <ansley.b.manke@xxxxxxxx>
Subject: Re: [ferret_users] SIGDIG hysteresis!
To: "Ryo Furue" <furue@xxxxxxxxxx>
Cc: ferret_users@xxxxxxxx
Date: Thursday, January 10, 2013, 7:52 PM

Hi Ryo,
Well that's interesting (and what a wonderful word, hysteresis). I imagine there are un-initialized variables somewhere, or something along those lines. Fortran does some unexpected things saving values between one pass through a piece of code and the next.  Actually /SIGDIG (which comes from the old PPLUS syntax nsig) is a big of a misnomer isn't it. We're changing the number of digits not the number of significant digits.

Thank you for the report.  I'll have a look.

Ansley

Thank you for the report.

On 1/10/2013 1:57 PM, Ryo Furue wrote:
Ferret developers,

I'm trying to control the format of contour labels
and I'm bewildered by the SIGDIG qualifier.  I suppose
there is a bug there.

I did this test:

  yes? set data levitus_climatology
  yes? set region/y=60s:40s
  yes? contour/lev=(5,15,1)/k=1 temp          !--(0)
  yes? contour/lev=(5,15,1)/k=1/sigdig=1 temp !--(1)
  yes? contour/lev=(5,15,1)/k=1/sigdig=2 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=3 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=4 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=5 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=4 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=3 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=2 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=1 temp
  yes? contour/lev=(5,15,1)/k=1  temp
  !. . . Go back to (1) . . .

The results are

Without SIGDIG:"5.0",   "6.0",   . . . , "12.0"
SIGDIG=1 gives "5.0",   "6.0",   . . . , "12.0"
SIGDIG=2 gives "5",     "6",     . . . , "12"
SIGDIG=3 gives "5.0",   "6.0",   . . . , "12.0"
SIGDIG=4 gives "5.00",  "6.00",  . . . , "12.00"
SIGDIG=5 gives "5.000", "6.000", . . . , "12.000"
SIGDIG=4 gives "5.0000","6.0000",. . . , "12.0000"
SIGDIG=3 gives "5.000", "6.000", . . . , "12.000"
SIGDIG=2 gives "5.00",  "6.00",  . . . , "12.00"
SIGDIG=1 gives "5.0",   "6.0",   . . . , "12.0"
Without SIGDIG:"5",     "6",     . . . , "12"

As you can see, there is "hysteresis"!  I've verified
that the above cycle exactly repeats.

Since at least I've found the pattern, I can exactly
control the format of my contour labels. :-)

FERRET v6.81  
Linux 2.6.32-279.1.1.el6.x86_64 32-bit
 - 07/23/12 10-Jan-13 11:48     

Cheers,
Ryo



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

Privacy Policy | Disclaimer | Accessibility Statement