[ncl-talk] ESMF regrid for large array data

Anil Kumar - NOAA Affiliate anil.kumar at noaa.gov
Wed Mar 23 07:17:18 MDT 2022


Hi All,
I am using ncl script for esmf regrid and converting unstructured onto WRF
grid.
There is nothing wrong with the script, it was working fine with the
previous unstructured grid nodes ( node = 1813443).
Now I am facing issues running these scripts for new unstructured data
nodes ( node = 6057307). It is taking a long time and CPU time terminates
the script and even job_script takes more than 8 hours and time limitation
issues with job_scripts.
Any suggestions to resolve this issue? Below is my script

However, when I run script, it says
 This can be VERY slow if you have a large array.
(0)                           To speed up code, provide your own edge
vertices via the
(0)                           'ElementVertices' option.
How to use ElementVertices?

*******************************************************
 src_file = "../fort.63.nc"
 sfile = addfile(src_file,"r")
 lat1D = sfile->y
 lon1D = sfile->x
 var = sfile->zeta(89,:)

 dst_file = "../geo_em.d01.nc"
 dfile    = addfile(dst_file,"r")
  Opt                = True

;---"bilinear" is the default. "patch" and "conserve" are other options.
    Opt at InterpMethod     = "neareststod"        ;;---Change (maybe)
    Opt at WgtFileName      = "unstruct_to_rect_2906_D1.nc"
    Opt at SrcGridLat       = lat1D
   Opt at SrcGridLon       = lon1D
    Opt at SrcRegional      = False            ;;--Change (maybe)
    Opt at SrcInputFileName = src_file          ; optional, but good idea

    Opt at SrcMask2D        = where(.not.ismissing(var),1,0) ; Necessary if has
                                                          ; missing values.

    dst_lat              = dfile->XLAT_M(0,:,:)    ; Be sure to use
appropriate names
    dst_lon              = dfile->XLONG_M(0,:,:)   ; here.
    Opt at DstGridLon       = dst_lon
    Opt at DstGridLat       = dst_lat
    Opt at DstRegional      = True            ;;--Change (maybe)
    Opt at ForceOverwrite   = True
    Opt at Debug            = True
    Opt at PrintTimings     = True
    var_regrid = ESMF_regrid(var,Opt)     ; Do the regridding
    printVarSummary(var_regrid)

-- 
Dr. Anil Kumar
Environmental Modeling Center/NCEP/NWS/NOAA
College Park, MD, USA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220323/1ccda177/attachment.html>


More information about the ncl-talk mailing list