Re: I mean regridding the data to a rectiliniear lat / lon grid

From: Ping Yang <pyang_at_nyahnyahspammersnyahnyah>
Date: Thu Oct 25 2012 - 12:00:07 MDT

Hi NCL,

Where can I upload a sample file here? I got the variables information
using ncdump -c in the following:

netcdf \12296_2010_prcp {
dimensions:
x = 212 ;
y = 250 ;
time = 365 ;
nv = 2 ;
variables:
short lambert_conformal_conic ;
lambert_conformal_conic:grid_mapping_name = "lambert_conformal_conic" ;
lambert_conformal_conic:longitude_of_central_meridian = -100. ;
lambert_conformal_conic:latitude_of_projection_origin = 42.5 ;
lambert_conformal_conic:false_easting = 0. ;
lambert_conformal_conic:false_northing = 0. ;
lambert_conformal_conic:standard_parallel = 25., 60. ;
double x(x) ;
x:units = "m" ;
x:long_name = "x coordinate of projection" ;
x:standard_name = "projection_x_coordinate" ;
double y(y) ;
y:units = "m" ;
y:long_name = "y coordinate of projection" ;
y:standard_name = "projection_y_coordinate" ;
double time(time) ;
time:long_name = "time" ;
time:calendar = "standard" ;
time:units = "days since 1980-01-01 00:00:00 UTC" ;
time:bounds = "time_bnds" ;
double lat(y, x) ;
lat:units = "degrees_north" ;
lat:long_name = "latitude coordinate" ;
lat:standard_name = "latitude" ;
double lon(y, x) ;
lon:units = "degrees_east" ;
lon:long_name = "longitude coordinate" ;
lon:standard_name = "longitude" ;
short yearday(time) ;
yearday:long_name = "yearday" ;
yearday:valid_range = 1s, 365s ;
float prcp(time, y, x) ;
prcp:long_name = "daily total precipitation" ;
prcp:units = "mm/day" ;
prcp:missing_value = -9999.f ;
prcp:_FillValue = -9999.f ;
prcp:valid_range = 0.f, 200.f ;
prcp:coordinates = "lat lon" ;
prcp:grid_mapping = "lambert_conformal_conic" ;
prcp:cell_methods = "area: sum time: sum" ;
double time_bnds(time, nv) ;

// global attributes:
:tileid = 12296s ;
:start_year = 2010s ;
:source = "Daymet Software Version 2.0" ;
:Version_software = "Daymet Software Version 2.0" ;
:Version_data = "Daymet Data Version 2.1" ;
:Conventions = "CF-1.4" ;

I tried to follow your instructions the average method:

   f = "11569" + "_1980_" + var + ".nc"
   o = + "_1980_" + var + "_4km_" + ".nc"
   f = addfile (file1, "r") ; open input files
   var = f->prcp(:,:,:)
; var(ntim,nlat,mlon) ; variable on Daymet tile netCDF file
  k = 4
  k2 = k/2
  var_avg = new ( (/ntim, nlat/k,mlon/k /), typeof(var), getFillValue(var))
  do nl=k2,nlat-3,k
    do ml=k2,mlon-3,k
       var_avg(:,nl,ml) = avg(var(:,nl-k2:nl+k2,ml-k2:ml+k2))
    end do
  end do

  LAT2D = lat2d(k2::k,k2::k) ; subset
  LON2D = lon2d(k2::k,k2::k)

However, I don't know how to figure out the coordinates and subset. Would
you please let me know how to do it?

Looking forward to hearing from you.

Ping

On Wed, Oct 24, 2012 at 11:24 AM, Dennis Shea <shea@ucar.edu> wrote:

> As I mentioned earlier, I have no experience with Daymet tiles.
> I think you will have to discover the best way to handle these.
>
> What I meant was something like
>
> var(ntim,nlat,mlon) ; variable on Daymet tile netCDF file
>
> k = 4
> k2 = k/2
> var_avg = new ( (/ntim, nlat/k,mlon/k /), typeof(var), getFillValue(var))
>
> do nl=k2,nlat-3,k
> do ml=k2,mlon-3,k
> var_avg(:,nl,ml) = avg(var(:,nl-k2:nl+k2,ml-k2:**ml+k2))
> end do
> end do
>
> LAT2D = lat2d(k2::k,k2::k) ; subset
> LON2D = lon2d(k2::k,k2::k)
>
> Good luck
>
> On 10/23/12 8:39 PM, Ping Yang wrote:
>
>> Hi NCL,
>>
>> On Tue, Oct 23, 2012 at 4:12 PM, Dennis Shea <shea@ucar.edu
>> <mailto:shea@ucar.edu>> wrote:
>>
>> Given the small area covered by the 2x2 tiles at 1km resolution.
>> I think it would be just fine to compute a local 4kmx4km arithmetic
>> average. The grid center would the mid point of the
>> lat and lon used.
>>
>> What do you mean local 4kmx4km arithmetic average? Is this a regriding
>> method?
>>
>> Looking forward to hearing from you.
>>
>> Regards,
>>
>> Ping
>>
>

-- 
Ping Yang, Ph.D.
CUNY Environmental Crossroads Initiative
Marshak Science Building - Suite 925
The City College of New York - CUNY
160 Convent Avenue, New York NY 10031
Phone: 212-650-5769
Fax: 212-650-7064

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Oct 25 12:00:44 2012

This archive was generated by hypermail 2.1.8 : Wed Oct 31 2012 - 09:14:12 MDT