[ncl-talk] Sub -Natgrid function help

Adv advita6 at gmail.com
Mon Jan 25 12:31:04 MST 2016


Hi,
strll  = asciiread("stationmac.txt", -1, "string") ;
  print(strll)   ; STATION","STATION_NAME", "LAT", "LON"
  print("=====")

sloc = str_get_field(strll , 2, ",")
  lat  = tofloat( str_get_field(strll , 3, ",")  )
  lon  = tofloat( str_get_field(strll , 4, ",")  )
  print(sloc +" : "+lat+" "+lon)
mnlat=(min(lat))
mxlat=(max(lat))
mnlon=(min(lon))
mxlon=(max(lon))
printVarSummary(lon)
print(lon)
print(lat)
lon at _FillValue = -95.06125
lat at _FillValue = 46.80
print(lon)
print(lat)
print(mnlon)
print(mxlon)
print(mnlat)
print(mxlat)
mlon = 391
dlon = -90.35 / mlon
lonn  = fspan (-116, (mlon - 1) * dlon, mlon)
print(lonn)
mlat = 391
dlat = 49.0 / mlat
latt  = fspan (40.01, (mlat - 1) * dlat, mlat)
print(latt)
diri="dailysimms/prec-obs/"
z1 = asciiread(diri+"tmax_avg_Jan1965-2005",-1,"float")
;print(z1)
;printVarSummary(z1)
;a = (/1,2,3,4,5,6,7,8/)
;390 rows by 50 columns
;390 rows by 41 columns
a0 = onedtond(z1,(/391,41/))
;print(a0)
x=dim_avg_n(a0,1)
print(x)
diri1="dailysimms/prec-obs/"
z2 = asciiread(diri1+"tmin_avg_Jan1965-2005",-1,"float")
;print(z2)
;printVarSummary(z2)
;a = (/1,2,3,4,5,6,7,8/)
;390 rows by 50 columns
;390 rows by 41 columns
a1 = onedtond(z2,(/391,41/))
;print(a1)
y=dim_avg_n(a1,1)
print(y)
;tenth of degree celcius
s=(x+y)/20
printVarSummary(s)
print(s)
;return
fo = natgrid(lon,lat,s,lonn, latt)

The Error I encounter is fatal:natgrid: x cannot contain any missing values

I replaced the missing value with digits. Then also why would I get this
error? Could someone help me to fix this bug.

Thank you
Adv
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160125/ef78e4ff/attachment.html 


More information about the ncl-talk mailing list