Re: ESMF regrid

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 05 2013 - 15:25:20 MST

Hi Noel,

What version of NCL are you using? It looks like a large file issue, so I think this should fix the problem:

Opt@SrcLargeFile = True
Opt@DstLargeFile = True

These are the defaults for Version 6.1.2.

--Mary

On Mar 5, 2013, at 1:01 PM, Noel Aloysius wrote:

> Hi NCL-talk,
>
> I want to regrid a high-resolution (~1km) MODIS GPP to a coarse resolution (1x1) grid using ESMF_regrid. The script is appended below.
> I get the following error messages,
>
> ncendef: ncid 131072: NetCDF: One or more variable sizes violate format constraints
> fatal:NetCDF: Operation not allowed in define mode: error attempting to write variable (grid_dims) to file (/home/fas/scratch/GPP_NPP_MODIS/src_SCRIP.nc)
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 1168 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 1277 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 2976 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 3089 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
> fatal:["Execute.c":7741]:Execute: Error occurred at or near line 27
>
> Thanks in advance for your help to resolve this issue,
> Noel
>
>
> ;**************************************************************************
> srcDir = "~/"
> srcFile = "MOD17A3_Science_GPP_2000.nc"
> srcFileName = str_concat((/srcDir,srcFile/))
>
> sfile = addfile(srcFileName,"r") ; source grid
> gpp = int2flt (sfile->MOD17A3_Science_GPP_2000)
> gpp = gpp(::-1,:) ; South -> North
>
> Opt = True
>
> Opt@SrcFileName = srcDir + "src_SCRIP.nc"
> Opt@DstFileName = srcDir + "dst_SCRIP.nc"
> Opt@WgtFileName = srcDir + "GPP1km_2_halfddeg.nc"
> Opt@ForceOverwrite = True
>
> Opt@DstGridType = "1x1"
> Opt@DstLLCorner = (/ -59.5, -179.5/)
> Opt@DstURCorner = (/ 79.5, 179.5/)
>
> gpp_regrid = ESMF_regrid(gpp,Opt)
> ;**************************************************************************
>
> printVarSummary(gpp),
>
> Variable: gpp
> Type: float
> Total Size: 2903040000 bytes
> 725760000 values
> Number of Dimensions: 2
> Dimensions and sizes: [lat | 16800] x [lon | 43200]
> Coordinates:
> lat: [-59.99583333334029..79.99583333333334]
> lon: [-179.9958333333333..179.9958333333346]
> Number Of Attributes: 6
> _FillValue : 1e+20
> long_name : MOD17A3_Science_GPP_2000
> esri_pe_string : GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
> coordinates : lon lat
> units : Degree
> missing_value : 0
>
> ncl 12> print(min(gpp))
> (0) 1
> ncl 13> print(max(gpp))
> (0) 65535
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 5 15:25:35 2013

This archive was generated by hypermail 2.1.8 : Thu Mar 07 2013 - 08:55:58 MST