[ncl-talk] Error in "cremapbin": Could not map global lat array into grid array.
Dennis Shea
shea at ucar.edu
Thu Feb 28 18:56:03 MST 2019
Bonjour Adriana,
The *area_conserve_remap *and *area_conserve_remap_Wrap* have been
*deprecated*.
The* ESMF regrid* <http://www.ncl.ucar.edu/Applications/ESMF.shtml> library
is the recommended replacement. It uses a superior methodology.
The *source* and *destination* grids are both *rectilinear*.
I modified one of the rectilinear-to-rectilinear grid examples.
Attached is a sample script that uses ESMF conservative remapping. It
creates:
[1] An ESMF weight file that can be used on subsequent regrid variables.
[2] A netCDF file containing the regridded emissions variable.
[3] A panel plot showing the source and regridded variables at an arbitrary
level and time.
NOTE: Volcano emission(s) are point source(s) so the plots won't show
much.
You can copy and modify the attached file to interpolate (regrid) to
different resolutions.
====
*%>* ncl adriana.esmf_regrid_1.ncl
Cheers
D
On Thu, Feb 28, 2019 at 8:05 AM <adriana.bossolasco at cnrs-orleans.fr> wrote:
> Hi all!
>
> I write because I don't understand what happen now with my regridding. I
> am trying to regrid an emission file from 0.9x1.9 lat/lon to a grid
> 1.9x2.5 lat/lon.
> I did with successful before, but now I have a file with more verticals
> levels and doesn't work and I get the following Error message:
>
> Error in "cremapbin":
> Could not map global lat array into grid array
> Aborted (core dumped)
>
> I will copy part of my code:
>
>
> ;*************************************************************
> ; read
> ;*************************************************************
>
> srcFileName =
> "emissions-cmip6_so4_a1_contvolcano_vertical_2000-2015.nc"
> f = addfile(srcFileName, "r")
>
> x = f->emiss_volcanoes
>
> printVarSummary(x)
> printMinMax(x, True)
> ;*************************************************************
> ; get dimension sizes and other information
> ;*************************************************************
> dimx = dimsizes( x )
> ntim = dimx( 0 )
> nlev = dimx( 1 )
> nlat = dimx( 2 ) ; [0.9 x 1.9 ]
> mlon = dimx( 3 ) ;
>
> latS = x&lat(0) ; south extent of input grid
> latN = x&lat(nlat-1) ; north extent
>
> dimx = dimsizes( x )
> ntim = dimx( 0 )
> nlev = dimx( 1 )
> nlat = dimx( 2 ) ;
> mlon = dimx( 3 ) ;
>
> latS = x&lat(0) ; south extent of input grid
> latN = x&lat(nlat-1) ; north extent
>
>
> nlati = 192 ; global extent of input grid
> [180/0.5]
>
> ;*************************************************************
> ; perform conservative remapping to two different grid resolutions
> ;*************************************************************
>
> opt = True
>
>
> ; ---
> NLAT25x19= 96 ; RES = "2.5x1.9"
> MLON25x19= 144
> LAT25x19 = latGau (NLAT25x19, "lat", "latitude" , "degrees_north")
> LON25x19 = lonGlobeFo(MLON25x19, "lon", "longitude", "degrees_east" )
>
> opt at NLATo = NLAT25x19
> LAT_REG25x19= LAT25x19({latS:latN})
> X25x19 = area_conserve_remap_Wrap (x&lon, x&lat, x ,LON25x19,
> LAT_REG25x19, opt)
>
>
>
> printVarSummary(X25x19)
> printMinMax(X25x19, True)
>
>
> And I get this Summary of my variables
>
> Variable: x
> Type: float
> Total Size: 1274019840 bytes
> 318504960 values
> Number of Dimensions: 4
> Dimensions and sizes: [time | 192] x [altitude | 30] x [lat | 192] x
> [lon | 288]
> Coordinates:
> time: [91325..97138]
> altitude: [0.125..7.375]
> lat: [-90..90]
> lon: [ 0..358.75]
> Number Of Attributes: 3
> units : molecules/cm3/s
> long_name : Continuously outgassing volcano SO4 = (0.025*SO2)*0.5
> emissions
> molecular_weight : 115
> (0)
> (0) Continuously outgassing volcano SO4 = (0.025*SO2)*0.5 emissions
> (molecules/cm3/s) : min=0 max=2.19543e+06
>
>
> Variable: latS
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> Number Of Attributes: 2
> units : degrees_north
> long_name : Latitude
> (0) -90
>
>
> Variable: latN
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> Number Of Attributes: 2
> units : degrees_north
> long_name : Latitude
> (0) 90
> Error in "cremapbin":
> Could not map global lat array into grid array
> Aborted (core dumped)
>
>
>
> I really appreciate any help. I tried a lot of things but nothing work.
>
> For the other hand I run the same code for other file and works. The
> other file have 8 altitude levels and this 30. So I was thinking maybe
> is to big the file, but I try to select just two o three levels and I
> get the same error.
>
> Thanks
>
> Adriana
> --
> Adriana Bossolasco
> LPC2E UMR 7328 (CNRS, Université d'Orléans)
> 3A avenue de la Recherche Scientifique
> 45071 Orléans Cedex 2 - FRANCE
> Tel +33 (0)2 38 25 52 85
> e-mail: adriana.bossolasco at cnrs-orleans.fr
> _______________________________________________
> 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/20190228/f00da28d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: adriana.esmf_regrid_1.ncl
Type: application/octet-stream
Size: 6505 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190228/f00da28d/attachment.obj>
More information about the ncl-talk
mailing list