Re: linint2_Wrap

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 19 2013 - 22:46:09 MST

The error message is telling you that the input lon/lat (xi/yi)
and/or the output lon/lat (xo/yo) are not monotonically
increasing.

What does

  printVarSummary(temp)

You reorder temp so there is a second printout.
Look at the lon and lat ranges. That is what printVarSummary
if for.

==
You invoke the function via

newtemp=linint2_Wrap(a&lon,a&lat,temp,True,newlon,newlat,0)

Where is the variable 'a' ... it is nowhere to be seen.

Did you mean

newtemp=linint2_Wrap(temp&lon,temp&lat,temp,True,newlon,newlat,0)

On 2/19/13 5:16 PM, Montane Caminal, Francesc wrote:
> Hello NCL,
>
> I need to perform spatial interpolation on my data from 0.5x0.5 (lat = 360 and lon=720) to 1x1 spatial resolution (lat =180 and lon=360), and I am using the “linint2_Wrap” function.
> However, when I ran my script, I got some error messages (not found in the “Error messages“ section of your FAQ) and several warning messages (see pic below).
> I have uploaded my data file to ftp folder (incoming) and attached the script here.
> Any help will be very appreciated!
>
> Thanks,
>
> Francesc
>
> Error messages:
>
> [cid:6e85507d-98ac-466f-b935-cbef9c1b99eb]
>
>
> NCL script:
>
>
> 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
>
>
>
> print("reading the variables")
>
> setfileoption("nc","MissingToFillValue",False)
>
>
>
> a = addfile ("/home/ecolab/CABLE_forcing1/cruncep_tair_2010.nc", "r")
>
> setfileoption("nc","Format","LargeFile")
>
>
>
> temp=a->tair
>
> printVarSummary(temp)
>
> temp = temp (:,::-1,:)
>
> printVarSummary(temp)
>
>
>
> ;create a sequence for the new values of time, which has to be a double precision variable
>
> newtime=fspan(21600.00,31536000.00,1460)
>
> ;create a sequence for the new values of lat
>
> newlat=fspan(-89.50,89.50,180)
>
> ;create a sequence for the new values of lon
>
> newlon=fspan(-179.50,179.50,360)
>
> newtime@units = "seconds since December 31, 2009 21:00:00"
>
> newlat@units = "degrees_east"
>
> newlon@units = "degrees_north"
>
> print("new values for long, lat and time created")
>
>  
>
> newtemp=linint2_Wrap(a&lon,a&lat,temp,True,newlon,newlat,0)
>
> printVarSummary(newtemp)
>
> print("newtemp: min="+min(newtemp)+" max="+max(newtemp))
>
>
>
> newtemp!0 = "time"
>
> newtemp!1 = "lat"
>
> newtemp!2 = "lon"
>
>
>
> newtemp&time = newtime
>
> newtemp&lat = newlat
>
> newtemp&lon = newlon
>
>
>
> fout=addfile("cruncep_tair_1x1_2010.nc","c")
>
> fout@title="Air temperature in K and interpolated into 1x1 spatial resolution"
>
> fout->tair=newtemp
>
>  
>
> end
>
>
>
>
> _______________________________________________
> 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 Tue Feb 19 22:46:19 2013

This archive was generated by hypermail 2.1.8 : Thu Feb 21 2013 - 11:26:43 MST