[ncl-talk] Sub: gc_inout

dale zuri dalezuri at gmail.com
Mon Aug 21 00:10:38 MDT 2017


Hi ,
Could someone help me to fix this?

Thanks
Dz
fatal:gc_inout: the lat/lon arrays must have the same dimension sizes
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 57 in file

 f1       = addfile("mask_cfsv2.nc", "r")
printVarSummary (f1)
  mrb_lon = f1->lon
  mrb_lat = f1->lat
  nmrb    = dimsizes(mrb_lon)

  min_mrb_lat = min(mrb_lat)
  max_mrb_lat = max(mrb_lat)
  min_mrb_lon = min(mrb_lon)
  max_mrb_lon = max(mrb_lon)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f    = addfile("Concat_precSum_0Z_198203-201003.nc", "r")   ; note the "s"
of addfile
;T    = f[:]->precSum                ; read T from all files
T    =
f->var(:,{min_mrb_lat:max_mrb_lat},{min_mrb_lon:max_mrb_lon})
; read T from all files
lon1d    = f->lon_0                ; read T from all files
lat1d    = f->lat_0                ; read T from all files
printVarSummary (T)
printVarSummary (lat1d)
;printVarSummary (lon1d)
;printVarSummary (mrb_lon)
;print(lat1d-mrb_lat)
;print(lon1d-mrb_lon)
;return
 dimp= dimsizes(T)
  ntim    = dimp(0)
  nlat    = dimp(1)
  mlon    = dimp(2)
;;;;;;;;;;;;;;;;;;;;;

;---Create an array and initialize to _FillValue
  pmask   = new(dimsizes(T), typeof(T), T at _FillValue)
printVarSummary(pmask)
  copy_VarCoords(T,pmask)
;;;;;;;;;;;;;;;;;;;;;;;;;;
;---Keep only data within the polygon
;   Use NCL array syntax (:) to propagate to all times

  do nl=0,nlat-1
    do ml=0,mlon-1
      if(gc_inout(lat1d(nl),lon1d(ml),mrb_lat,mrb_lon)) then
return
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170820/89d0f2d7/attachment.html 


More information about the ncl-talk mailing list