[Thread Prev][Thread Next][Index]

Re: [ferret_users] arithmetics not working on a variable (broken netCDF file?)



Hi Ryo,

The netCDF file has a few "interesting" features that are confusing ferret, as you can see from the warning messages that it generates during your session:

 *** NOTE: Ignored modulo length exceeding axis length: lont
 *** NOTE: Ignored modulo length exceeding axis length: lonv
 *** NOTE: Evenly spaced axis has edges definition: dept - ignored

In particular, you are specifying modulo lengths for the axes lont and lonv, even though these are only of length one.

You are then trying to shade a 1D region. The variable tdmb has dimensions 1x100x40x1, so tdmb[k=1,l=1] has dimensions 1x100. When you enter the command

shade/k=1/l=1 tdmb

the modulo attribute on the axis lont appears to be confusing ferret into thinking that this is really a 2D region, so the shade command succeeds. However, when you enter the command

shade/k=1/l=1 tdmb*10

ferret realises that it's a 1D region, and so the shade command fails.

I tried generating a netCDF file that's identical to yours, but without the modulo attribute on the axis lont. Now both shade commands fail, as they should:

yes? shade/k=1/l=1 tdmb
 **ERROR: dimensions improperly specified: must be a 2D region
          shade/k=1/l=1 tdmb
yes? shade/k=1/l=1 10*tdmb
 **ERROR: dimensions improperly specified: must be a 2D region
          shade/k=1/l=1 10*tdmb

Hope this helps!

Cheers,
Steven

Hi Ferret users,

I seem to have created a strange netCDF file:

 http://iprc.soest.hawaii.edu/~furue/tmp/tmp.nc

with which you can plot the variable

 shade/k=1/l=1 tdmb

but not if you do some arithmetics with it

 shade/k=1/l=1 tdmb*10
**ERROR: dimensions improperly specified: must be a 2D region
         shade/k=1/l=1 tdmb*10

If you define a new variable

 let a = tdmb*10

that can be plotted.  I'm attaching a complete listing below.

There must be something "interesting" about the file,
but I don't know what it is.

Regards,
Ryo
====================================
$ ferret
       NOAA/PMEL TMAP
       FERRET v6.2
       Linux(g77) 2.4.21-32 - 05/19/09
       25-Aug-09 15:49

set mode grat:dash
set memory/size=400
Cached data cleared from memory
keymark 1
yes? set data tmp.nc
*** NOTE: Ignored modulo length exceeding axis length: lont
*** NOTE: Ignored modulo length exceeding axis length: lonv
*** NOTE: Evenly spaced axis has edges definition: dept - ignored
yes? show data
    currently SET data sets:
   1> ./tmp.nc  (default)
name     title                             I         J         K         L
TDMB                                      1:1       1:100     1:40      1:1

yes? shade/k=1/l=1 tdmb
yes? shade/k=1/l=1 tdmb*10
**ERROR: dimensions improperly specified: must be a 2D region
         shade/k=1/l=1 tdmb*10
yes? let a = tdmb*10
yes? shade/k=1/l=1 a
yes?

--
Dr Steven J Phipps

Climate Change Research Centre
Faculty of Science
University of New South Wales
Sydney
NSW 2052
Australia

Tel  +61 2 9385 8957
Fax  +61 2 9385 8969


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement