check_for_y_lat_coord

From: Larry McDaniel <mcdaniel_at_nyahnyahspammersnyahnyah>
Date: Thu, 29 Nov 2007 13:24:39 -0700

hello

below are the messages I'm getting when the attached ncl script is run.
please advise.

Larry

Variable: season1avg
Type: float
Total Size: 1036800 bytes
            259200 values
Number of Dimensions: 2
Dimensions and sizes: [lon | 720] x [lat | 360]
Coordinates:
            lon: [-180..180]
            lat: [-90..90]
Number Of Attributes: 1

Variable: lat (coordinate)
Type: float
Total Size: 1440 bytes
            360 values
Number of Dimensions: 1
Dimensions and sizes: [lat | 360]
Coordinates:
Number Of Attributes: 1
  units : degrees north
(0) check_for_y_lat_coord: Warning: Data either does not contain a
valid latitude coordinate array or doesn't contain one at all.
(0) A valid latitude coordinate array should have a 'units'
attribute equalto one of the following values:
(0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees
north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg
north'
(0) check_for_lon_coord: Warning: Data either does not contain a
valid longitude coordinate array or doesn't contain one at all.
(0) A valid longitude coordinate array should have a 'units'
attribute equal to one of the following values:
(0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'

-- 
Larry R. McDaniel mcdaniel_at_ucar.edu Phone: 303 497 8128
Institute for the Study of Society and Environment
NCAR P.O. Box 3000
Boulder, CO  80307

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"

; ================================================;
begin

first = "cru_ts_2_10.1971-1980.pre.grid"
p1 = asciiread(first,(/12, 10, 720, 360/),"float")
second = "cru_ts_2_10.1981-1990.pre.grid"
p2 = asciiread(second,(/12, 10, 720, 360/),"float")
third = "cru_ts_2_10.1991-2000.pre.grid"
p3 = asciiread(third,(/12, 10, 720, 360/),"float")

pre = new((/12,21,720,360/),"float")
pre(:,0:1,:,:) = p1(:,8:9,:,:) / 10
pre(:,2:11,:,:) = p2(:,0:9,:,:) / 10
pre(:,12:20,:,:) = p3(:,0:8,:,:) / 10
pre!0 = "month"
pre!1 = "year"
pre!2 = "lon"
pre!3 = "lat"

delete(p1)
delete(p2)
delete(p3)
spri = new((/21,720,360/),float,-999.)
summ = new((/21,720,360/),float,-999.)
fall = new((/21,720,360/),float,-999.)
wint = new((/21,720,360/),float,-999.)
xwint = new((/21,720,360,12/),float,-999.)

do i = 0, 20
   spri(i,:,:) = dim_avg(pre(year|i,lon|:,lat|:,month|2:4))
   summ(i,:,:) = dim_avg(pre(year|i,lon|:,lat|:,month|5:7))
   fall(i,:,:) = dim_avg(pre(year|i,lon|:,lat|:,month|8:10))
   if (i.eq.1) then
      xwint(i,:,:,0:2) = pre(year|i,lon|:,lat|:,month|0:2)
      xwint(20,:,:,11:11) = pre(year|i,lon|:,lat|:,month|11:11)
   end if
   if (i.ne.1) then
      xwint(i,:,:,0:2) = pre(year|i,lon|:,lat|:,month|0:2)
      xwint(i,:,:,11:11) = pre(year|i,lon|:,lat|:,month|11:11)
   end if
end do

do i = 0, 20
   wint(i,:,:) = dim_avg(xwint(i,:,:,:))
end do

spri!0 = "year21"
spri!1 = "lon"
spri!2 = "lat"
summ!0 = "year21"
summ!1 = "lon"
summ!2 = "lat"
fall!0 = "year21"
fall!1 = "lon"
fall!2 = "lat"
wint!0 = "year21"
wint!1 = "lon"
wint!2 = "lat"

season1avg = new((/720,360/),float,-999)
season2avg = new((/720,360/),float,-999)
season3avg = new((/720,360/),float,-999)
season4avg = new((/720,360/),float,-999)
   season1avg(:,:) = dim_avg(spri(lon|:,lat|:,year21|:))
   season2avg(:,:) = dim_avg(summ(lon|:,lat|:,year21|:))
   season3avg(:,:) = dim_avg(fall(lon|:,lat|:,year21|:))
   season4avg(:,:) = dim_avg(wint(lon|:,lat|:,year21|:))

dlon = fspan(-180,180,720)
dlat = fspan(-90,90,360)

dlat_at_units="degrees north"
dlon_at_units="degrees east"

season1avg!0 = "lon"
season1avg!1 = "lat"
season1avg&lat = dlat
season1avg&lon = dlon
season2avg!0 = "lon"
season2avg!1 = "lat"
season2avg&lat = dlat
season2avg&lon = dlon
season3avg!0 = "lon"
season3avg!1 = "lat"
season3avg&lat = dlat
season3avg&lon = dlon
season4avg!0 = "lon"
season4avg!1 = "lat"
season4avg&lat = dlat
season4avg&lon = dlon
res = True

   res_at_mpProjection = "Mercator"
   res_at_gsnAddCyclic = False

    ;; map boundaries [tweak!]
   res_at_mpLimitMode = "Corners"
   res_at_mpLeftCornerLatF = 10
   res_at_mpLeftCornerLonF = -140
   res_at_mpRightCornerLatF = 60
   res_at_mpRightCornerLonF = -60
; res_at_mpLeftCornerLatF = -90
; res_at_mpLeftCornerLonF = -180
; res_at_mpRightCornerLatF = 90
; res_at_mpRightCornerLonF = 180

    ;; general plotting stuff

    res_at_mpFillOn = False

    res_at_gsnMaximize = True

    res_at_cnFillOn = True
    res_at_cnLinesOn = False

; res_at_cnLevelSelectionMode = "ManualLevels"
; res_at_cnMinLevelValF = 1
; res_at_cnMaxLevelValF = 13
; res_at_cnLevelSpacingF = 1

res_at_cnLevelSelectionMode = "ExplicitLevels"
res_at_cnLevels = (/ 0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 /)

;res_at_cnLevelSelectionMode = "ExplicitLevels" res_at_cnLevels = (/-3,-2,-1,-.5,0,.5,1,2,3,4,5/) res_at_cnFillColors = (/82,92,102,112,122,132,142,152,162,172,182,192/)

    res_at_lbLabelAutoStride = True
    res_at_lbBoxLinesOn = False

    res_at_gsnSpreadColors = True

   ;; create the plots

    res_at_tiMainString = "CRU 0.5 degree spring"
    wks = gsn_open_wks("ps", "spring")
    gsn_define_colormap(wks,"narccap-precip")
printVarSummary(season1avg)
printVarSummary(season1avg&lat)
    plot = gsn_csm_contour_map(wks, season1avg, res)

; res_at_tiMainString = "CRU 0.5 degree summer"
; wks = gsn_open_wks("ps", "summer")
; gsn_define_colormap(wks,"narccap-precip")
; plot = gsn_csm_contour_map(wks, season2avg, res)

; res_at_tiMainString = "CRU 0.5 degree fall"
; wks = gsn_open_wks("ps", "fall")
; gsn_define_colormap(wks,"narccap-precip")
; plot = gsn_csm_contour_map(wks, season3avg, res)

; res_at_tiMainString = "CRU 0.5 degree winter"
; wks = gsn_open_wks("ps", "winter")
; gsn_define_colormap(wks,"narccap-precip")
; plot = gsn_csm_contour_map(wks, season4avg, res)
end

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 29 2007 - 13:24:39 MST

This archive was generated by hypermail 2.2.0 : Fri Nov 30 2007 - 10:55:48 MST