[ncl-talk] [ncl- talk] regridding 2x2 degree data

Will Hobbs will.hobbs at utas.edu.au
Wed Apr 3 02:39:46 MDT 2019


I would guess this is the relevant error message:
‘fatal:Eq: Dimension size, for dimension number 0, of operands does not match, can't continue’

You’ve assigned a 4d array (rf) to an attribute that expects a 2d array:
Opt at SrcMask2D = where(.not.ismissing(rf),1,0)

I assume you meant to type rf1 rather than rf……




From: ncl-talk <ncl-talk-bounces at ucar.edu> on behalf of Smrati Purwar <ritipurwar at gmail.com>
Date: Wednesday, 3 April 2019 at 7:32 PM
To: Ncl-talk <ncl-talk at ucar.edu>
Subject: [ncl-talk] [ncl- talk] regridding 2x2 degree data

Hello all,
   i have .5 degree data . i am trying to regrid it in 2 degree data .But it is giving error. Please help


Variable: rf1
Type: float
Total Size: 69660 bytes
            17415 values
Number of Dimensions: 2
Dimensions and sizes: [lat | 129] x [lon | 135]
Coordinates:
            lat: [6.5..38.5]
            lon: [66.5..100]
Number Of Attributes: 4
  _FillValue : -999
  long_name : GRIDDED RAINFALL
  average_op_ncl : dim_avg_n over dimension(s): sfc
  missing_value : -999
fatal:Eq: Dimension size, for dimension number 0, of operands does not match, can't continue

fatal:["Execute.c":8640]:Execute: Error occurred at or near line 1639 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl

fatal:["Execute.c":8640]:Execute: Error occurred at or near line 1847 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl

fatal:["Execute.c":8640]:Execute: Error occurred at or near line 3910 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl

fatal:["Execute.c":8640]:Execute: Error occurred at or near line 4042 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl

fatal:["Execute.c":8640]:Execute: Error occurred at or near line 18 in file grid.ncl

fatal:Variable (rf_regrid) is undefined
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 19 in file grid.ncl

fatal:Variable (rf_regrid) is undefined
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 22 in file grid.ncl



Here is my script
load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"
f = addfile("rainfall2013.nc<http://rainfall2013.nc>","r")
time = f ->time
rf = f->rf(0:30,:,:,:)                      ; {7:36},{68:100})
;printVarSummary(rf)
rf1 = dim_avg_n_Wrap(dim_avg_n_Wrap(rf,0),0)
printVarSummary(rf1)
;print(rf1&lat)
Opt = True
Opt at SrcMask2D = where(.not.ismissing(rf),1,0)
Opt at Overwrite = True
Opt at DstLLCorner = (/8.00d,68.00d/)
Opt at DstURCorner = (/36.00d,100.00d/)
Opt at DstGridType = "2deg"
Opt at InterpMethod = "bilinear"
rf_regrid = ESMF_regrid(rf,Opt)
printVarSummary(rf_regrid)
system("rm -rf regrid_bilinear2X2.nc")
fout = addfile("regrid_bilinear2X2.nc", "c")
fout->rf = rf_regrid

--
With Thanks & Regards
Smrati Purwar
Ph.D Scholar(CSIR-JRF)
CSIR- 4th Paradigm Institute(CMMACS)
NAL Belur Campus, Wind tunnel road
Bangalore, India-560037


University of Tasmania Electronic Communications Policy (December, 2014).
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190403/b53589a8/attachment.html>


More information about the ncl-talk mailing list