Re: regrid and outputing nc file

From: Debasish PaiMazumder <debasish_at_nyahnyahspammersnyahnyah>
Date: Tue, 28 Jul 2009 09:45:21 -0400

Hello,

You defined LAT = ispan (-90,90,1) and LON = ispan (0,360,1) while
you use lat and lon for declaring dimension of tas. That is the
reason you got that error massage.
It should be
tas!1=¨LAT¨
tas!2=¨LON¨
tas&LAT=LAT
tas&LON=LON

Thanks

Debasish

On 09-07-28, at 09:25, yanling_1220 wrote:

> Hi,
>
> I have some problems when I used "linint2_wrap"function to regrided
> a guassian grid to a fixed grid(1°*1°),my script is attached.
>
> According to the regridding example regrid_1.ncl on the http://
> www.ncl.ucar.edu/Applications/regrid.shtml, I used "ispan"
> function to define LAT and LON,
> LAT = ispan (-90,90,1)
> LAT_at_units = "degrees_north"
> LON = ispan (0,360,1)
> LON_at_units = "degrees_east"
> and then use the LAT and LON to specify the X and Y coordinates of
> the return array from "linint2_wrap","tas" is the variable retured
> from the "linint2_wrap".
>
> "printVarSummary(tas)" I got the information :Dimensions and
> sizes: [time | 360] x [LAT | 181] x [LON | 361]. When I used the
> traditional method to output the regrid result into a nc file ,the
> problem come up.
>
> I used the lines below(line 36-39 in the script) to define the
> output coordinate varibles,
> tas!1 = "lat"
> tas!2 = "lon"
> tas&lat = LAT
> tas&lon = LON
> but it give me the error message:
> fatal:Variable (lat) is undefined
> fatal:Execute: Error occurred at or near line 75 in file
> a_runs_average_sresa2_nc_2001_2030_celsius_linint_1.0_2.ncl
> I think I have defined the "lat" in the line 36-39,but what happen?
>
> Then,the varible summary show that LAT and LON are the coordinate
> varible of the tas,so I tried to use the line 40-41 "lat = tas&LAT"
> "lon = tas&LON " instead of the the line 36-39,and it give me
> another error message:
> fatal:FileAddVar: Dimension (LAT) is not currently defined, can't
> add variable
> fatal:Execute: Error occurred at or near line 75 in file
> a_runs_average_sresa2_nc_2001_2030_celsius_linint_1.0_2.ncl
>
> At the same time,the content from the "print(LAT)" seem some odd
> in the last lines:
> (0) -90
> (1) -89
> (2) -88
> ....
> (179) 89
> (180) 90
> (0) changeCaseChar: this function has been deprecated.
> (0) Will use str_switch.
> (0) changeCaseChar: this function has been deprecated.
> (0) Will use str_switch.
> what does the message mean?Is it right that I used the
> LAT = ispan (-90,90,1)
> LON = ispan (0,360,1)
> to get 1°*1°grids?
> How can I solve these problems? Thanks!
>
> Regards,
> sunflowers
>
>
>
>
> 网易YEAH.NET免费邮箱:您的终身免费邮箱
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Debasish PaiMazumder, PhD
Hydrology & Climate Science
Postdoctoral Researcher at UQÀM/Ouranos
550, Sherbrooke west, 19th floor, west tower,
Montréal, QC, Canada H3A 1B9
Tel: (514) 282-6464-343
      (514) 937-0042 (R)
email: debasish_at_sca.uqam.ca

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 28 2009 - 07:45:21 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 29 2009 - 09:07:41 MDT