Re: ESMF Regridding

From: Travis, Katherine <ktravis_at_nyahnyahspammersnyahnyah>
Date: Wed Feb 20 2013 - 07:16:54 MST

Dennis,
Thanks. This variable was short, so I unpacked to float. However
conserve regridding still crashes on the destination corners of the grid.
You can see below I have the source corners, but not the destination. When
I try to provide corners, the program gives me this:

20130220 091610.975 ERROR PET0 ESMF_Grid.F90:5238
ESMF_GridCreateFrmScripDistGrd Wrong argument specified - - Bad corner
array in SCRIP file

netcdf air.2m.mon.mean {
dimensions:
        time = UNLIMITED ; // (402 currently)
        y = 277 ;
        x = 349 ;
        nbnds = 2 ;
variables:
        int Lambert_Conformal ;
                Lambert_Conformal:grid_mapping_name =
"lambert_conformal_conic" ;
                Lambert_Conformal:standard_parallel = 50., 50. ;
                Lambert_Conformal:longitude_of_central_meridian = -107. ;
                Lambert_Conformal:latitude_of_projection_origin = 50. ;
                Lambert_Conformal:false_easting = 5632642.22547 ;
                Lambert_Conformal:false_northing = 4612545.65137 ;
        short air(time, y, x) ;
                air:units = "K" ;
                air:long_name = "Monthly Air Temperature at 2 m" ;
                air:scale_factor = 0.003799786f ;
                air:add_offset = 275.5f ;
                air:unpacked_valid_range = 151.f, 400.f ;
                air:precision = 0.003799786f ;
                air:actual_range = 229.7579f, 310.9593f ;
Š
// global attributes:
                :standardpar1 = 50. ;
                :standardpar2 = 50.000001 ;
                :centerlon = -107. ;
                :centerlat = 50. ;
                :latcorners = 1.000001f, 0.897945f, 46.3544f, 46.63433f ;
                :loncorners = -145.5f, -68.32005f, -2.569891f, 148.6418f ;
                :stream = "s1" ;
                :title = "Monthly NARR" ;
                :Conventions = "CF-1.0" ;
                :history = "created 2005 by Jeff Whitaker" ;
                :institution = "National Centers for Environmental
Prediction" ;
                :platform = "Model" ;
                :references =
"http://wwwt.emc.ncep.noaa.gov/mmb/rreanl/index.html\n",
                   
"http://www.esrl.noaa.gov/psd/data/gridded/data.narr.html" ;
                :NCO = "4.0.0" ;

On 2/20/13 12:57 AM, "Dennis Shea" <shea@ucar.edu> wrote:

>Before proceeding, could you please do a
>
>%> ncdump -h air.2m.mon.mean.nc | less
>
>What numeric type is the variable "air" ?
>
>If it is type 'short', then you *must* unpack prior to use.
>Use 'short2flt' located in 'contributed.ncl'
>http://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml
>
> datAir = short2flt( sfile->air )
> printVarSummary(datAir)
> print("datAir: min="+min(datAir)+" max="+max(datAir))
>
>Perhaps you were getting the "large errors" cuz you did not unpack.
>
>
>
>On 2/19/13 5:20 PM, Travis, Katherine wrote:
>> Hi,
>> Could anyone who uses the ESMF_regridding.ncl routine tell me how to
>>properly set the following options?
>> I am trying to regrid sparse emissions data on a regional (US) 12km by
>>12km curvilinear grid to a 1x1degree grid, and the bilinear and path
>>methods give me large errors.
>> I am trying to use the conserve method, but I get the error that my
>>grid corners are bad. Here is how I am currently trying to set them up:
>>
>> srcFile = "air.2m.mon.mean.nc"
>> sfile = addfile(srcFile,"r")
>> datAir = sfile->air
>> lat = sfile->lat
>> lon = sfile->lon
>>
>> Opt@SrcGridCornerLat = (/min(lat(0,:)),min(lat(:,0)),
>>max(lat(0,:)),max(lat(:,0))/)
>> Opt@SrcGridCornerLon = (/min(lon(0,:)),min(lon(:,0)),
>>max(lon(0,:)),max(lon(:,0))/)
>> Opt@DstGridCornerLat = (/1,1,11,47/)
>> Opt@DstGridCornerLon = (/-144,-179,-68, 179/)
>>
>> Thank you,
>> --
>> Katherine R. Travis
>> PhD Student
>> Harvard University
>> SEAS
>> ktravis@fas.harvard.edu
>>
>>
>>
>>
>> _______________________________________________
>> 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 Wed Feb 20 07:17:16 2013

This archive was generated by hypermail 2.1.8 : Thu Feb 21 2013 - 11:26:43 MST