[ncl-talk] Question about the function of "ESMF_regrid" ?

Hoffman Cheung hoffmancheung at gmail.com
Wed Dec 7 10:21:02 MST 2016


Hi Lin,

In your script, the dimension of Opt at SrcMask2D does not match the dimension
of latitude (or longitude), which cause an error in L1614 of
ESMF_regridding.ncl

(here is L1614 to 1620 of ESMF_regridding.ncl)

      if(.not.all(dimsizes(Opt@$grid_mask_name$).eq.latlon_dims)) then
        print("curvilinear_to_SCRIP: Opt@" + grid_mask_name + \
              " is not the correct dimensionality")
        exit
      else
        grid_mask = Opt@$grid_mask_name$
      end if

As you set the masking based on thetao (L58 in your attached script), which
is a 3-dimensional array with the time dimension, you have to reduce this
dimension to solve the problem.

P.S. As mentioned in the NCL document, you are suggested to use SrcGridMask
instead of SrcMask2D.

Cheers,
Hoffman


2016-12-07 17:44 GMT+01:00 林祥 <xianglin72 at icloud.com>:

> Hi, all
>
>      I want to regrid some curvilinear data using the function
> "ESMF_regrid” , the corresponding codes were listed as below (while the
>
> whole scripts was also attached with this mail) .
>
>   125    printVarSummary(thetao)
>   126    thetao_regrid = ESMF_regrid(thetao,Opt)
>   127    printVarSummary(thetao_regrid)                   ( the scripts
> was derived from example of ESMF_regrid_6.ncl )
>
>
>      However, something wrong were reported as below:
>
> Variable: thetao
> Type: float
> Total Size: 808704000 bytes
>             202176000 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 1872] x [j | 300] x [i | 360]
> Coordinates:
>             time: [675348.5..732295.5]
>             j: [0..299]
>             i: [0..359]
> Number Of Attributes: 14
>   lon2d : <ARRAY of 108000 elements>
>   lat2d : <ARRAY of 108000 elements>
>   standard_name : sea_ice_area_fraction
>   long_name : Sea Ice Area Fraction
>   comment : fraction of grid cell covered by sea ice.
>   units : %
>   original_units : 1
>   history : 2012-01-17T03:16:49Z altered by CMOR: Converted units from
> '1' to '%'. 2012-01-17T03:16:49Z altered by CMOR: replaced missing value
> flag (1e+30) with standard missing value (1e+20).
>   cell_methods : time: mean
>   cell_measures : area: areacello
>   missing_value : 1e+20
>   _FillValue : 1e+20
>   associated_files : baseURL: http://cmip-pcmdi.llnl.gov/
> CMIP5/dataLocation gridspecFile: gridspec_seaIce_fx_ACCESS1-0_
> historical_r0i0p0.nc areacello: areacello_fx_ACCESS1-0_
> historical_r0i0p0.nc
>   coordinates : lat lon
>
>  fatal:Eq: Dimension size, for dimension number 0, of operands does not
> match, can't continue
>
>
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 1614 in
> file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
>
>
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 3853 in
> file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
>
>
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 3983 in
> file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
>
>
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 126 in
> file /Users/linx/Data/CMIP5_SIC/sic/esmf_regrid_6_sic.ncl
>
>
>      According the introduction of “ESMF_regrid”,  the “thetao" can be any
> dimensionality. So  I can not find out where is the problem.
>
> Anyone can show me  a hand?  Thanks!
>
>
>
> Lin
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161207/6b697764/attachment.html 


More information about the ncl-talk mailing list