Re: obj_anal_ic

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 18 2010 - 07:41:38 MST

The bug is not in contributed.ncl, but rather in the C code that
"wraps" the Fortran code. The
only way you can get a fix (other than the work-around I gave you) is
to get a newly compiled
version of NCL.

If you can use the work-around, please do so. If you really need a
whole new binary, this
may take me a couple of days as I have other higher priority items to
work on.

Thanks,

--Mary

On Nov 17, 2010, at 6:20 PM, flyyks wrote:

> i tried obj_anal_ic(without wrap), and met the similar problem.
>
> I found some lines about obj_anal_ic_wrap in "contributed.ncl".
> is that bug among these lines?
> it is very slow for my calculation using function
> obj_anal_ic_deprecated
>
> my script as follw, thank you.
>
> ;stn559 to grid 0.25, using obj_
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> ;**********************************
> begin
> nst=559
> ndy=1
> ;==================================
> ; station longitude and latitude
> f2 = "stn559.lst"
> dat = asciiread(f2, -1, "float")
> stn_sta=dat(0::3)
> lat_sta=dat(1::3)
> lon_sta=dat(2::3)
> ;;print(lat_sta+" "+lon_sta+" "+stn_sta)
> ;------
> ;station pr, binary file
> f1 = "test.bin"
> pr = fbindirread (f1, 0, (/nst,ndy/), "float")
> print("pr: min="+min(pr)+" max="+max(pr))
> pr@long_name = "station precipitation"
> pr@units = "?mm?"
> pr@_FillValue = -999.9
> print("pr: min="+min(pr)+" max="+max(pr))
>
> dims = dimsizes (pr)
> print(dims)
> time = fspan(0,ndy-1,ndy)
> station = stn_sta
> time!0 = "time"
> time@units = "days since 1956-01-01 00:00"
> time&time = time
> station!0 = "station"
> station&station=station
> pr!0 = "station" ; name dimensions if not already done
> pr!1 = "time" ; must be named to reorder
> pr&time = time
> pr&station = stn_sta
> printVarSummary(pr)
> printMinMax(pr,True)
> ;==================
> ; aphro lat and lon
> f3 = addfile("grid.nc","r")
> lon_g = dble2flt(f3->longitude)
> lat_g = dble2flt(f3->latitude)
> nlon = dimsizes(lon_g)
> nlat = dimsizes(lat_g)
> printVarSummary(lat_g)
> printVarSummary(lon_g)
> ;----------------
> ; interpolate
> rscan = (/3., 2., 1., 0.5/)
> ;rscan = (/7, 4, 2, 1/)
> ;rscan = (/5, 3, 2, 1/)
> pr_stn1 = new((/1,nlat,nlon/),float,pr@_FillValue) ; For
> reconstration
> ;dims
> pr_stn1!0 = "time"
> pr_stn1!1 = "lat"
> pr_stn1!2 = "lon"
> pr_stn1&time = time(0:0)
> pr_stn1&lat = lat_g
> pr_stn1&lon = lon_g
> printVarSummary(pr_stn1)
> printVarSummary(lon_sta)
> printVarSummary(lat_sta)
> do i=0,0
> pr_stn1(i,:,:) = obj_anal_ic(lon_sta,lat_sta,pr(time|
> i,station|:), lon_g, lat_g, rscan, False)
> ;;pr_stn1(i,:,:) = obj_anal_ic_deprecated(lon_sta,lat_sta,pr(time|
> i,station|:), lon_g, lat_g, rscan, False)
> end do
> printVarSummary(pr_stn1)
> printMinMax(pr_stn1,True)
> pr_stn1 = where(pr_stn1.lt.0.,pr_stn1@_FillValue,pr_stn1)
> printMinMax(pr_stn1,True)
>
>
> 2010-11-18
> flyyks
> 发件人: Mary Haley
> 发送时间: 2010-11-17 21:09:12
> 收件人: flyyks
> 抄送: ncl-talk
> 主题: Re: [ncl-talk] obj_anal_ic
> This is due to a bug in the wrapper code. The work-around is to make
> the missing values for your lat/lon arrays and the data value the
> same before you call this routine.
>
> --Mary
>
> On Nov 17, 2010, at 7:37 AM, flyyks wrote:
>
>> Thank you very much.
>>
>> info. as follow,
>> (1) ncl -V
>> NCAR Command Language Version 5.2.1
>> (2) uname -a
>> Linux node1 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007
>> x86_64 x86_64 x86_64 GNU/Linux
>> (3) file names
>> test_obj_anal.zip
>>
>>
>>
>> 2010-11-17
>> flyyks
>> 发件人: Dennis Shea
>> 发送时间: 2010-11-17 14:52:20
>> 收件人: flyyks
>> 抄送: ncl-talk
>> 主题: Re: [ncl-talk] obj_anal_ic
>> It should recognize missing values.
>> Do you have a *simple, clean* version of your NCL script and the
>> data?
>> If so you can ftp bothe to
>> ftp ftp.cgd.ucar.edu
>> anonymous
>> Use your email address for the password
>> cd incoming
>> put ...
>> put ...
>> quit
>> Send us an email with the following information:
>> * The names of the files after you have successfully completed
>> the
>> transfer.
>> We cannot look at the ftp/incoming directory for security
>> reasons.
>> * The version of NCL you are running (ncl -V).
>> * The type of system you are on (uname -a).
>> On 11/17/10 5:18 AM, flyyks wrote:
>> > it seems this "obj_anal_ic" in v5.2 cannot recognize missing
>> values.
>> > the missing values in my station data is -999.9. after the
>> calculation,
>> > some points have value like -997.
>> > i change missing value to 1e+20, then the result is 9.99533e+19.
>> > 2010-11-17
>> >
>> ------------------------------------------------------------------------
>> > flyyks
>> >
>> ------------------------------------------------------------------------
>> > *发件人:* Dennis Shea
>> > *发送时间:* 2010-07-06 19:10:02
>> > *收件人:* "羘gel_G._Mu駉z"
>> > *抄送:* ncl-talk
>> > *主题:* Re: [ncl-talk] obj_anal_ic
>> > OK ... I see the issue.
>> > The v5.1.0 contributed.ncl had
>> > http://www.ncl.ucar.edu/Document/Functions/Contributed/obj_anal_ic.shtml
>> > This *NCL language* function was *slow* when a large number of
>> values
>> > were input. Hence, I replaced it with a fortran version.
>> > The fortran had several additional features including the ability
>> > to 'blend' different iterations. Likely, that is where the
>> differences
>> > occurred.
>> > ===
>> > You can still use the original function by using the undocumented
>> > function in contributed.ncl called
>> > function obj_anal_deprecated (....)
>> > This is te original v5.1.0 version .... just a different name.
>> > ===
>> > Also, you may wish to look at the Application URL "Random data to
>> grid"
>> > http://www.ncl.ucar.edu/Applications/rdm2grid.shtml
>> > It shows several different interpolations.
>> > ===
>> > Good luck
>> > D
>> > On 07/06/2010 11:33 AM, Mary Haley wrote:
>> > > Hi,
>> > >
>> > > The obj_anal_ic routine wasn't available until version 5.2.0,
>> so I'm
>> > > not sure what you mean by using it in version 5.1.0.
>> > >
>> > > When you type "ncl -V" with the ncl that appears to be
>> working, does
>> > > it actually say "5.1.0"?
>> > >
>> > > --Mary
>> > >
>> > > On Jul 6, 2010, at 10:58 AM, Ángel G. Muñoz wrote:
>> > >
>> > >> Hi there
>> > >>
>> > >> Can anyone explain me what is the new algorithm for the
>> > >> obj_anal_ic(_Wrap) function in version 5.2. I have been using
>> the
>> > >> one in 5.1.0 (which corresponds to a Cressman analysis) and
>> there
>> > >> are differences in the final output. I want to understand the
>> new
>> > >> methodology.
>> > >>
>> > >> Thanks
>> > >>
>> > >>
>> > >> <agmunoz.vcf>_______________________________________________
>> > >> 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
>> > --
>> > ======================================================
>> > Dennis J. Shea tel: 303-497-1361 |
>> > P.O. Box 3000 fax: 303-497-1333 |
>> > Climate Analysis Section |
>> > Climate & Global Dynamics Div. |
>> > National Center for Atmospheric Research |
>> > Boulder, CO 80307 |
>> > USA email: shea 'at' ucar.edu |
>> > ======================================================
>> > _______________________________________________
>> > 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
>> _______________________________________________
>> 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 18 07:41:47 2010

This archive was generated by hypermail 2.1.8 : Fri Nov 19 2010 - 11:51:06 MST