Re: question related to area_hi2lores

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 18 2011 - 21:04:13 MST

For this situation use "linint2_Wrap".

==================================

On 1/18/11 8:44 PM, Erik Noble wrote:
> I realize that I forgot to include the error.
> Hi. Yes, I just realized that I forgot to include the error.
> It is this (snipped at the end)
>
> Variable: rain
> Type: float
> Total Size: 63616 bytes
> 15904 values
> Number of Dimensions: 3
> Dimensions and sizes: [ncl1 | 1] x [lat | 112] x [lon | 142]
> Coordinates:
> lat: [-10.72084..41.98462]
> lon: [-51.28217..21.28217]
> Number Of Attributes: 3
> description : accumulated precipitation
> units : mm
> _FillValue : -9999
> (0)
> (0) accumulated precipitation: min=-6.68557e-08 max=668.375
> warning:area_hi2lores: both dimensions of the output grid must be of
> lower resolution than the input high resolution grid.
> (0) changeCaseChar: this function has been deprecated.
> (0) Will use str_switch.
> (0) changeCaseChar: this function has been deprecated.
> (0) Will use str_switch.
>
>
> Variable: var_o
> Type: float
> Total Size: 576000 bytes
> 144000 values
> Number of Dimensions: 3
> Dimensions and sizes: [ncl1 | 1] x [LAT | 200] x [LON | 720]
> Coordinates:
> LAT: [-49.75..49.75]
> LON: [-179.75..179.75]
> Number Of Attributes: 3
> description : accumulated precipitation
> units : mm
> _FillValue : -9999
> (0)
> (0) accumulated precipitation: min=0 max=0
> .
> .
> .
> <snip>
>
> On Tue, Jan 18, 2011 at 5:42 PM, Erik Noble<nobleeu@gmail.com> wrote:
>> Hi. May I have some help?
>> I am using the following script to regrid a modeled rainfall data on a
>> 55km grid to a 1/2-degree grid. The data is not cyclical and is on a
>> small domain. Even thought the data is regional, I want to put it on a
>> 1/2-degree grid, so I tried putting in on a global grid.
>>
>> When I read-in the data and examine the minimum and maximum values, I
>> see that I have successfully read in the file and the variable. But
>> when I check the mins and maxs after regridding with area_hi2lores, I
>> get "zeros."
>>
>> Is this expected?
>> How can I get the result that I want?
>>
>> Sincerely,
>> Erik
>>
>>
>> Code:
>>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>>
>> ;*************** User Input **************************************
>> diri ="./"
>> fili = "wrfout_*_precip.nc"
>> diro = "./"
>> all_files = systemfunc ("ls "+fili)
>> numFILES = dimsizes(all_files)
>> ;*************** DO LOOP TO READ and REGRID FILES ****************
>> do it = 0,numFILES-1
>> print("File = "+all_files(it))
>> a = addfile (all_files(it),"r")
>> rain = a->rain
>> printVarSummary(rain)
>> printMinMax(rain,True)
>> ;****************
>> ; Regrid to 0.5 degree
>> ;****************
>> nlat = 360
>> mlon = 720
>>
>> latGRID = fspan(-90,90, nlat)
>> latGRID!0 = "lat"
>> latGRID@units = "degrees_north"
>> latGRID&lat = latGRID
>>
>> lonGRID = fspan(-180,180, mlon)
>> lonGRID!0 = "lon"
>> lonGRID@units = "degrees_east"
>> lonGRID&lon = lonGRID
>>
>> var = rain
>> var_o = area_hi2lores_Wrap (var&lon,var&lat, var , False, 1,
>> lonGRID, latGRID, False)
>> printVarSummary(var_o)
>> printMinMax(var_o,True)
>>
>> ;****************
>> ; Output to Netcdf
>> ;****************
>> NCFILE1 = all_files(it)
>> NCFILE = "Regrid_0.5_"+NCFILE1
>> system("/bin/rm -f "+diro+NCFILE)
>> ncdf = addfile(diro+NCFILE ,"c")
>> filedimdef(ncdf,"Time",-1,True)
>> ncdf->prate=var_o
>> delete(ncdf)
>> delete(NCFILE)
>> end do
>>
> _______________________________________________
> 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 Jan 18 21:04:19 2011

This archive was generated by hypermail 2.1.8 : Tue Jan 25 2011 - 14:22:15 MST