regrid and outputing nc file

From: yanling_1220 <yanling_1220_at_nyahnyahspammersnyahnyah>
Date: Tue, 28 Jul 2009 21:25:43 +0800 (CST)

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
 

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

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