[ncl-talk] sub: regrid error...

dale zuri dalezuri at gmail.com
Fri Sep 15 17:15:27 MDT 2017


Hi
I need help to regrid irregular two dimensional grid to regular. Could
someone help me to fix this issue?
I am getting this warning message

warning:linint2: xi, yi, xo, and yo must be monotonically increasing
I would appreciate any help and suggestions.

Thanks

begin
yr="2015"
;******************************************************
;;;;CFS begins;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a1    = addfile("/import/c1/NCARCCM/h/marchforecast/psa_mask_cfsv2.nc","r")
;print(a1)
mas1=a1->mask

;;;;;;;;;;;;0----LAnd only--1-20 PSA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mas1=where(mas1.ge.2,1,mas1 at _FillValue)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f1    = addfile("/import/c1/NCARCCM/h/marchforecast/mar1982-2010/
simpleWunit.2005031212.nc", "r")   ; note the "s" of addfile
T1    = f1->precSum                ; read T from all files
printVarSummary (T1)
latnew=f1->lat_0
lonnew=f1->lon_0
;---Mask the "ts" variable across all time steps and copy metadata.
 T_mask1 = mask(T1,mas1,1)
 copy_VarMeta(T1,T_mask1)
printVarSummary(T_mask1)
zAvgTime1=T_mask1
printVarSummary(zAvgTime1)
;****************************************************
;;;;;;ERA BEGINS;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a    = addfile("psa_wrf.nc","r")
print(a)
mas=a->mask
printVarSummary(mas)
printMinMax(mas,0)
;;;;;;;;;;;;0----LAnd only--1-20 PSA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mas=where(mas.ge.2,1,mas at _FillValue)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  iz = addfile("landsea2_wrf.nc","r")
  lat2d = iz->lat
  lon2d = iz->lon
 ;mas2=iz->mask
;;;;;;;;;;;;;;;;;;;;;;;;;;year selection;;;;;;;;;;;;;;;;;;;;;;;;;
   diri = "/import/c1/NCARCCM/h/era/yearsnotuse/"   ; input directory
   fils = systemfunc ("ls "+diri+"era-down_"+yr+"*.nc") ; file paths
   f    = addfiles (fils, "r")   ; note the "s" of addfile
   ListSetType (f, "cat")
   T    = f[:]->p                ; read T from all files
   printVarSummary (T)
  T!1="lon2d"
  T!2="lat2d"
  T at lon2d = lon2d
  T at lat2d = lat2d
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;---Mask the "ts" variable across all time steps and copy metadata.
 T_mask = mask(T,mas,1)
 copy_VarMeta(T,T_mask)
printVarSummary(T_mask)
zAvgTime=T_mask
zAvgTime_FillValue = -999
printVarSummary(zAvgTime)
printVarSummary(zAvgTime(0,:,0))
printVarSummary(lon2d)
printVarSummary(lat2d)
printMinMax(lon2d(0,:),0)
printMinMax(lat2d(:,0),0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;Interpolation Step;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
newsst = linint2(lon2d(:,0),lat2d(0,:),zAvgTime,True,lonnew,latnew,0)
return
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170915/4e6145f7/attachment.html>


More information about the ncl-talk mailing list