Hi Gabrielle,
When using linint2 / linint2_Wrap, the input/output latitudes and
longitudes must be monotonically increasing. Looking at your ncdump
output, your .4ºx.4º latitudes run north to south. So you need to flip
the latitudes of your input .nc file:
a=addfile("/home/mhcosta/gabrielle/graciela/RATE02_0.40g.200101.SA.nc","r")
b = a->NEE(:,::-1,:)
lon = a->lon
lat = a->lat(::-1)
Also, looking at your code, you shouldn't have to assign any metadata to
the new_inmatrix array, as all metadata should have been transferred
since you are using the _Wrap version of linint2. Finally, your data
isn't cyclic, so you should set the cyclic option in linint2_Wrap to
False. Taking all of that into account:
a=addfile("/home/mhcosta/gabrielle/graciela/RATE02_0.40g.200101.SA.nc","r")
b = a->NEE(:,::-1,:)
new_lon = fspan(-99.5, -30.5, 70)
new_lat = fspan(-59.5, 19.5, 80)
new_inmatrix = linint2_Wrap(b&lon,b&lat,b,False,new_lon,new_lat,0)
c = addfile("/home/mhcosta/gabrielle/graciela/RATE_200101_1.0.nc", "c")
c->NEE = new_inmatrix
Adam
Gabrielle Ferreira Pires wrote:
> Hello there!
>
> I have a 0.40ºx0.40º file and I want to turn it into 1.0ºx1.0º grid. I
> get the correct coordinates, but when I try to open the netcdf file I
> created, there's no value for the variable.
> I also get the warnings:
>
> warning:linint2: xi, yi, xo, and yo must be monotonically increasing
> warning:Dimension (0) has not been defined
> I'm sending my script and the ncdump of my 0.40ºx0.40º file, of my
> 1.0ºx1.0º file, in case it'll help! Thanks!!
>
>
> --------------------------------------------------------------------------------------------------------------------------------
> 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
>
> a = addfile("/home/mhcosta/gabrielle/graciela/RATE02_0.40g.200101.SA.nc
> <http://rate02_0.40g.200101.sa.nc/>" ,"r")
> b = a->NEE
> lon = a->lon
> lat = a->lat
> c = addfile("/home/mhcosta/gabrielle/graciela/RATE_200101_1.0.nc
> <http://rate_200101_1.0.nc/>", "c")
>
> new_lon = fspan(-99.5, -30.5, 70)
> new_lat = fspan(-59.5, 19.5, 80)
>
>
> new_inmatrix = linint2_Wrap(lon,lat,b,True,new_lon,new_lat,0)
> new_inmatrix!0 ="time"
> new_inmatrix!1 ="lat"
> new_inmatrix!2 = "lon"
> new_inmatrix&lat = new_lat
> new_inmatrix&lon = new_lon
> new_inmatrix&lat_at_units <mailto:new_inmatrix&lat_at_units> =
> "degrees_north"
> new_inmatrix&lon_at_units <mailto:new_inmatrix&lon_at_units> = "degrees_east"
>
>
> c->NEE = new_inmatrix
> end
> ----------------------------------------------------------------------------------------------------------------------------
> --
> ---------------------------------------------------------
> Gabrielle Ferreira Pires
> Graduanda em Engenharia Ambiental
> Universidade Federal de Viçosa
> ---------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-- -------------------------------------------------------------- Adam Phillips asphilli_at_ucar.edu National Center for Atmospheric Research tel: (303) 497-1726 ESSL/CGD/CAS fax: (303) 497-1333 P.O. Box 3000 Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Tue Mar 17 2009 - 10:20:04 MDT
This archive was generated by hypermail 2.2.0 : Wed Mar 18 2009 - 14:50:21 MDT