fatal:natgrids: z cannot contain any missing values

From: LEO_ARIES <Leo_Aries_at_nyahnyahspammersnyahnyah>
Date: Wed, 11 Apr 2007 03:51:12 +0800

Hi, all
  
     I met a error when I read some scattered time series and want to derive a grid data before plotting. But I met a
error , with a message as noted below:

fatal:natgrids: z cannot contain any missing values
fatal:Execute: Error occurred at or near line 71 in file Anomaly.contour_Gridding.ncl

   I haven't set any variable with a name of "z", and I don;t know where and why my code cause error.

I also attached my script as below :

   ...........
  proxyindex = (/"21.2","30","28","27","24","22","52","53","01","02","77","13","70","14","11","51","36","40","45","44","46","530.25","530.28","530.18","530.19"/)
lon = (/87.,88.,81.5,82.5,87.2,93.,81.,85.1,90.,98.,92.5,96.2,100.6,98.6,100.1,96.,103.8,106.1,110.,110.5,112.5,103.9,105.8,106.3,109.5/)
lat = (/46.,48.,44.6,43.5,43.3,43.,35.,28.2,30.,30.,34.6,33.8,36.6,37.,38.9,38.,37.5,39.1,34.3,39.5,40.5,36.1,34.5,38.5,38.3/)

  ni = dimsizes(proxyindex)

  all_files = systemfunc ("ls " + "*10a.txt.nc")
  nf = dimsizes(all_files)

  y = new((/ni,50/),"float")
  y!0 = "proxyindex"
  y!1 = "time"
  y&time = fspan(1500,1990,50)
  y = -999.
  y@_FillValue = -999.

  do i = 0,ni-1 ; read all proxy data
     fi = addfile(all_files(i),"r")
     ;printVarSummary(fi)
     x = fi->px
     t1 = min(x&time)
     t2 = max(x&time)
     if(t1.lt.1500)then
        t1 = 1500
     end if
     y(i,{t1:t2}) = x({t1:t2})
     delete(x)
  end do
    

  mean = dim_avg(y(:,{1680:1970})) ; calculate the std anomalies for 1680-1970
  std = dim_stddev(y(:,{1680:1970}))
  print(mean)
  y_ano = new((/ni,50/),"float")
  do ii = 0,ni-1
     y_ano(ii,:) = (y(ii,:)-mean(ii))/std(ii)
  end do
     printVarSummary(y_ano)

        pgrid = new((/50,81,51/),"float") ; initialize the proxy gridded field
  do iy = 0,49
     ; =================================
     ; define new grid
     ; =================================
        nlon = fspan(75,115,81)
        nlon_at_long_name = "longitude"
        nlon_at_units = "degree_east"
        nlat = fspan(25,50,51)
        nlat_at_long_name = "latitude"
        nlat_at_units = "degree_north"
        time = fspan(1500,1990,50)
        time_at_long_name = "time"
        time_at_units = "year"
    ; =================================
    ; convert Proxy. --> lon-lat grid
    ; =================================
        pgrid(iy,:,:) = natgrids(lon,lat,y_ano(:,iy),nlon,nlat)
   end do
 
       ; =================================
       ; output to NetCDF file
       ; =================================
          pgrid!0 = "time"
          pgrid!1 = "lon"
          pgrid!2 = "lat"
          pgrid&time = time
          pgrid&lon = nlon
          pgrid&lat = nlat
          pgrid_at_long_name = "Decadal Standard Anomaly of PRCP"
          pgrid_at_units = " "
          system("rm -f p160.nc")
          f = addfile("Decadal_Std.Anomaly_proxy.PRCP_WestChina.nc","c")
          f->Pd = pgrid(time|:,lat|:,lon|:)

Thanks !

Lin

LEO_ARIES
2007-04-11

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Apr 10 2007 - 13:51:12 MDT

This archive was generated by hypermail 2.2.0 : Wed Apr 11 2007 - 08:36:47 MDT