[ncl-talk] ESMF_Regrid for Coarse to Fine Spatial Resolution, two errors

Mary Haley haley at ucar.edu
Fri Mar 31 14:28:55 MDT 2017


All,

Dennis and I took this discussion with Greg offline for a bit and have come
to a solution. (Greg, thanks for providing the script and data!)

I'm posting back to ncl-talk so others can benefit.

There were four issues:

1)  The "conserve" method requires "grid corners" to be input. If they are
not, then NCL uses an internally developed "bounding box method".
Generally it works well, but can be problematic because NCL can't guess at
the structure of your grid. We switch to using the "bilinear" method:

Opt at InterpMethod = "bilinear"    ; the default

2) The destination grid is rather large (6144 x 6144) which causes large (>
3 GB) NetCDF files to be generated. You need to set:

Opt at SrcLargeFile   = True
Opt at DstLargeFile   = True
Opt at WgtLargeFile   = True

so that large file support is turned on.

3) Dennis added calls to the "where" function to set all negative values to
missing, and to create a source grid mask:

  CDR_Conc = where (CDR_Conc.lt.0, CDR_Conc at _FillValue, CDR_Conc)

  Opt at SrcMask2D  = where(ismissing(CDR_Conc),0,1)

4) The output files were so large, we had to use a scratch directory where
there was enough disk space.

Attached is the modified script and png output.

--Mary


On Tue, Mar 28, 2017 at 7:31 PM, Dennis Shea <shea at ucar.edu> wrote:

> I have looked at this using NCL 6.3.0 (MAC OS)
>
> From: PET0.RegridWeightGen.Log
>
> The error is "Concave Element Detected"
>
> ***Someone else will have to suggest a work around.***
> ---
>
> 20170328 173330.778 INFO             PET0 Running with ESMF Version
> 6.3.0rp1
> 20170328 173734.737 INFO             PET0 Running with ESMF Version
> 6.3.0rp1
> 20170328 174808.719 ERROR         ~~~~~~~~~~~~~~~~~~ Concave Element
> Detected ~~~~~~~~~~~~~~~~~~
> 20170328 174808.723 ERROR            PET0   concave elem. id=24017
> 20170328 174808.723 ERROR            PET0
> 20170328 174808.723 ERROR            PET0   concave elem. coords (lon
> [-180 to 180], lat [-90 to 90]) (x,y,z)
> 20170328 174808.723 ERROR            PET0   ------------------------------
> -----------------------------------
> 20170328 174808.723 ERROR            PET0     0  (179.815179,  42.405261)
> (-0.738390, 0.002382, 0.674370)
> 20170328 174808.723 ERROR            PET0     1  (179.627955,  42.541923)
> (-0.736767, 0.004784, 0.676129)
> 20170328 174808.723 ERROR            PET0     2  (89.813369,  42.680222)
> (0.002395, 0.735145, 0.677906)
> 20170328 174808.723 ERROR            PET0     3  (-89.999394,  42.542971)
> (0.000008, -0.736770, 0.676143)
> 20170328 174808.723 ERROR            PET0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 20170328 174808.723 ERROR            PET0 ESMCI_Regrid_F.C:149
> c_esmc_regrid_create() Invalid argument - Src contains a concave cell
> 20170328 174808.727 ERROR            PET0 ESMCI_Regrid_F.C:434
> c_esmc_regrid_create() Invalid argument Internal subroutine call returned
> Error
> 20170328 174808.727 ERROR            PET0 ESMF_Regrid.F90:321
> ESMF_RegridStore Invalid argument - Internal subroutine call returned Error
> 20170328 174808.727 ERROR            PET0 ESMF_FieldRegrid.F90:1008
> ESMF_FieldRegridStoreNX Invalid argument - Internal subroutine call
> returned Error
> 20170328 174808.727 ERROR            PET0 ESMF_RegridWeightGen.F90:1152
> ESMF_RegridWeightGenFile Invalid argument - Internal subroutine call
> returned
>
> =======
> /glade/p/work/shea/ESMF/CDR_NSIDC>dir
>
> -rw-r--r-- 1 shea ncar 3170894556 Mar 28 19:12 destination_grid_file.nc
> -rw-r--r-- 1 shea ncar       4277 Mar 28 17:55 g02202_Regrid_v01.ncl
> -rw-r--r-- 1 shea ncar       1868 Mar 28 19:12 g02202_Regrid_v01.ncl_orig
> -rw-r--r-- 1 shea ncar  528585368 Mar 28 19:24 masiemask_ims4km.nc
> -rw-r--r-- 1 shea ncar       7033 Mar 28 18:44 OUT_g02202.txt
> -rw-r--r-- 1 shea ncar       1849 Mar 28 17:59 PET0.RegridWeightGen.Log
> -rw-r--r-- 1 shea ncar    3738850 Mar 28 19:24
> seaice_conc_daily_nh_f13_20060101_v02r00.nc
> -rw-r--r-- 1 shea ncar   11440924 Mar 28 19:12 source_grid_file.nc
>
> =========
> On Tue, Mar 28, 2017 at 2:47 PM, Greg Deemer <greg.deemer at nsidc.org>
> wrote:
>
>> Hello,
>>
>> I’m attempting to regrid sea-ice concentrations from a coarse spatial
>> resolution onto a higher-resolution grid. Both grids are NSIDC Sea Ice
>> Polar Stereographic North with a WGS84 reference datum. The coarse product (
>> https://nsidc.org/data/g02202) is 448X304, or a 25km nominal resolution.
>> The higher-resolution product (http://nsidc.org/data/docs/no
>> aa/g02186_masie/index.html) is 6144x6144, or a 4km nominal resolution.
>>
>> The grid for the high-res product is a little funky in that it extends
>> well beyond the equator, from the polar view (for added context, it is the
>> 4km variant of the 24km grid handled here: http://www.ncl.ucar.edu/
>> Applications/nic_ims.shtml). I’m wondering if this is causing some error
>> in the ESMF_regrid routine, which is throwing two errors:
>>
>> 1. nonsensical values to the minimum Extlon2d and minimum
>> ExtGridCenter_Lon, as seen in the processing log
>>
>> (0) get_src_grid_info: source lat dims = (448,304)
>> (0) get_src_grid_info: source lon dims = (448,304)
>> (0) get_src_grid_info: source grid type is 'curvilinear'
>> (0) curvilinear_to_SCRIP: calculating grid corners...
>> (0) curvilinear_to_SCRIP: no lat values are at the poles, so
>> (0)       calculating grid corners using
>> (0)       calc_SCRIP_corners_noboundaries...
>> (0) calc_SCRIP_corners_noboundaries
>> (0)     min/max original lat: 31.1026717524309/89.8368159996152
>> (0)     min/max original lon: -180/179.813975395493
>> (0) calc_SCRIP_corners_noboundaries
>> (0)     min/max Extlat2d: 30.8580632088782/89.8368159996152
>> (0)     min/max Extlon2d: -539.812759557033/180.001207917857
>> (0) calc_SCRIP_corners_noboundaries
>> (0)     min/max ExtGridCenter_lat: 30.98047461780758/89.8368159996152
>> (0)     min/max ExtGridCenter_lon: -269.812759557033/179.8151793919093
>> (0) =====> CPU Elapsed Time: curvilinear_to_SCRIP: 0.109368 seconds
>> <=====
>> (0) get_dst_grid_info: destination lat dims = (6144,6144)
>> (0) get_dst_grid_info: destination lon dims = (6144,6144)
>> (0) curvilinear_to_SCRIP: calculating grid corners...
>> (0) curvilinear_to_SCRIP: no lat values are at the poles, so
>> (0)       calculating grid corners using
>> (0)       calc_SCRIP_corners_noboundaries...
>> (0) calc_SCRIP_corners_noboundaries
>> (0)     min/max original lat: -21.4848/89.9729
>> (0)     min/max original lon: -180/180
>> (0) calc_SCRIP_corners_noboundaries
>> (0)     min/max Extlat2d: -21.5023/89.9729
>> (0)     min/max Extlon2d: -539.995/180
>> (0) calc_SCRIP_corners_noboundaries
>> (0)     min/max ExtGridCenter_lat: -21.4935/89.9729
>> (0)     min/max ExtGridCenter_lon: -269.988/179.989
>>
>> And a second error:
>> 2. NetCDF: One or more variable sizes violate format constraints
>>
>> I tried converting  longitudes to monotonic, but the output log still
>> spit out large negative values (e.g. <<0). I’ve also added Opt at srcLargeFile
>> and Opt at dstLargFile lines within the code as I see the resulting ‘
>> destination-grid-file.nc’ is on the order of 3.15Gb in size.
>>
>> Please find script attached. The data files in use for this script can be
>> found here:
>> Coarse: ftp://sidads.colorado.edu/pub/DATASETS/NOAA/G02202_v
>> 2/north/daily/2006/seaice_conc_daily_nh_f13_20060101_v02r00.nc
>> Fine: ftp://sidads.colorado.edu/DATASETS/NOAA/G02186/ancilla
>> ry/masiemask_ims4km.nc
>>
>> Thank you for the attention to this question and for any help.
>>
>> --
>>
>> *Greg Deemer*
>> User Services Office
>> National Snow and Ice Data Center
>> (303) 735-8068
>> http://nsidc.org
>> Twitter: @NSIDC
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> 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/20170331/52e25e59/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g02202_Regrid_v01_mod.ncl
Type: application/octet-stream
Size: 3970 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170331/52e25e59/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g02202_regrid_trim.png
Type: image/png
Size: 204640 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170331/52e25e59/attachment-0001.png 


More information about the ncl-talk mailing list