No much to go on here.
Why are you doing
lat = new((/nlat/), "float", -999)
lat(:) = (/slp(0,:,0)/)
Did you print lat after the above???
print(lat)
My guess is that you are assigning sea level pressure values
to 'lat'. I think that would be a problem, n'est ce pas?
also, no harm using lat(:) but better to use only 'lat'
If you did the following
f = addfile ("...", "r")
slp = f->slp
You should be able to use standard NCL syntax
lat = slp&lat
print(lat)
====
If you want to work with just a region, you can directly
read in just the region of interest. Good programming practice
is to use variables rather than hard wiring values.
latS = 15
latN = 75
lonL = 140
lonR = 250
f = addfile ("...", "r"0
slp = f->slp(:,{latS;latN},{lonL:lonR})
printVarSummary(slp)
lat = slp&lat
print(lat)
===
Finally, use 'printVarSummary' a lot!
Good luck
On 5/14/12 3:52 PM, Cece Borries wrote:
> Hello.
>
> I am receiving the following error when I run my script to calculate
> EOF's for sea level pressure:
>
> Warning! LAPACK routine returned eigenvalue <= 0.
> Setting it to zero...
>
> My code, following the examples online, is:
>
> lat = new((/nlat/), "float", -999)
> lat(:) = (/slp(0,:,0)/)
>
> wgt = sqrt(cos(lat*0.01745329))
>
> slp_re = slp(lat|:,lon|:,year|:)
> slp_w = slp_re
>
> slp_w = slp_re*conform(slp_re, wgt, 0)
>
> x = slp_w({15:75},{140:250},:)
>
> neval = 3
> eof = eofunc(x, neval, True)
>
> I have used the same code for a different variable and received no
> errors, so I am guessing that something is wrong with my SLP data. Does
> anyone have any suggestions?
>
> Thanks so much!
>
> Cece
>
> --
> Cecilia Borries
>
> Graduate Student
> International Arctic Research Center
> Department of Atmospheric Sciences
>
> Teaching Assistant
> Department of Physics
> University of Alaska Fairbanks
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 14 16:13:39 2012
This archive was generated by hypermail 2.1.8 : Thu May 17 2012 - 13:42:02 MDT