[ncl-talk] ESMF Regridding: one less latitude band in the destination file

Tabish Ansari tabishumaransari at gmail.com
Tue Nov 15 05:34:34 MST 2022


Hi Laura,

Your method worked smoothly - thank you. Here's the updated script I used:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"

begin
    sfile =
addfile("/data/nosync/emissions/HTAPv3-Fluxes-tan/edgar_HTAPv3_2018_NOx.nc","r")
    dfile = addfile("/data/sync/modelinput/CAMS-Emissions-tbu/
HTAP_transient_1.9x2.5_emis_NO_20201217.nc","r")

    nox_htap  = sfile->HTAPv3_1_International_Shipping(0,:,:)
    printVarSummary(nox_htap)

    nox_cams = dfile->glseas(0,:,:)
    printVarSummary(nox_cams)

    htaplat = nox_htap&lat
    htaplon = nox_htap&lon

    camslat = nox_cams&lat
    camslon = nox_cams&lon

    Opt                = True
    Opt at ForceOverwrite = True
    Opt at InterpMethod   = "conserve"
;    Opt at DstGridType    = "1.9x2.5"
;    Opt at DstURCorner    = (/  90, 360/)
;    Opt at DstLLCorner    = (/ -90,   0/)
   Opt at SrcGridLon        = htaplon
   Opt at SrcGridLat        = htaplat
   Opt at DstGridLon        = camslon
   Opt at DstGridLat        = camslat

   nox_regrid = ESMF_regrid(nox_htap,Opt)
   printVarSummary(nox_regrid)

end


best regards,

Tabish
-------------------------------
Dr Tabish Ansari
Research Associate
Air Quality Modelling Group
IASS-Potsdam
Germany


On Mon, 14 Nov 2022 at 23:21, Laura Fowler <laura at ucar.edu> wrote:

> Hi Tabish:
>
> When I use ESMF_regrid, I usually specify the longitudes and latitudes of
> the source (1800x3600) and destination (96x144 grid points) files. So
> instead of using
>
>
>
>
> *    Opt at DstGridType    = "1.9x2.5"    Opt at DstURCorner    = (/  90,
> 357.5/)     Opt at DstLLCorner    = (/ -90,   0/)*
>
> I use:
>
>    opt at SrcGridLon        = lonCellSrc ; source grid longitude input.
>
>    opt at SrcGridLat        = latCellSrc ; source grid latitude input.
>
>
>    opt at DstGridLon        = lonDst ; destination grid longitude input.
>
>    opt at DstGridLat        = latDst ; destination grid latitude input.
>
> If this does not work, you can also try the default InterpMethod instead
> of using "conserve". Just a couple of suggestions.
>
> Hope this will help,
> Laura
>
>
> On Mon, Nov 14, 2022 at 10:12 AM Tabish Ansari via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>> Hi
>>
>> I have two global emissions datasets: one at a lower resolution of
>> 1.9x2.5 degrees (96x144 grid points) and another at a higher resolution of
>> 0.1x0.1 degrees (1800x3600 grid points).
>>
>> I want to regrid the second dataset to the coarse resolution of the first
>> one. I generated a weights file and followed the recommended procedure
>> using the ESMF regridding function within NCL to achieve the desired output:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"load
>> "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"begin    sfile =
>> addfile("/data/sync/modelinput/HTAPv3-Emissions-tan/edgar_HTAPv3_2018_NOx.nc","r")
>>   nox  = sfile->HTAPv3_1_International_Shipping(0,:,:)
>> printVarSummary(nox)    Opt                = True    Opt at ForceOverwrite =
>> True    Opt at InterpMethod   = "conserve"    Opt at DstGridType    = "1.9x2.5"
>>   Opt at DstURCorner    = (/  90, 357.5/)     Opt at DstLLCorner    = (/ -90,
>> 0/)    nox_regrid = ESMF_regrid(nox,Opt)    printVarSummary(nox_regrid)end*
>>
>> This leads to a resulting variable with *95x144* grid points, however
>> the first dataset has *96x144* grid points. I have supplied all the
>> information of the first grid through the grid type and corner options
>> here. Still, the resultant grid has one less latitude band. Please let me
>> know if something is obviously wrong here. Perhaps something to do with
>> grid staggering?
>>
>> Thanks a lot.
>>
>> with best regards,
>>
>> Tabish
>>
>>
>> -------------------------------
>> Dr Tabish Ansari
>> Research Associate
>> Air Quality Modelling Group
>> IASS-Potsdam
>> Germany
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at mailman.ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> --
>
> !-------------------------------------------------------------------------------------------------------------
> Laura D. Fowler
>
> Mesoscale and Microscale Meteorology Division (MMM)
> National Center for Atmospheric Research
> P.O. Box 3000, Boulder CO 80307-3000
>
> e-mail: laura at ucar.edu
> phone: 303-497-1628
>
>
> !-------------------------------------------------------------------------------------------------------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20221115/f01c37e1/attachment.htm>


More information about the ncl-talk mailing list