# Re: Regridding CAM4 1 degree FV grid to Gaussian

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri Jun 03 2011 - 11:43:13 MDT

Looks good to me!
=============================
Note: using spherical harmonics to interpolate bounded variables like
RELHUM [0 to 100] can produce values outside this range. You may wish to
check this out:
print("RELHUM: min="+min(RELHUM)+" max="+max(RELHUM))

print("RH_gaus: min="+min(RH_gaus)+" max="+max(RH_gaus))

If this happens you could use the 'where' function or NCL's
clipping operators:

RH_gaus = RH_gaus > 0 ; negative values replace with 0.0
RH_gaus = RH_gaus < 100 ; values > 100 replaced with 100

===
Also, you could use 'linint2_Wrap'. This will never produce
values outside the range of the input data.

For conservative remapping, you could use 'area_conserve_remap_Wrap'

D

On 06/03/2011 11:21 AM, Scott Capps wrote:
> Greetings,
>
> I want to regrid CCSM4 (CAM only) output to a Gaussian Grid (for input
> to WRF's metgrid.exe) and wanted to make sure I am using the correct NCL
> subroutine while preserving the resolution. The regridded output looks
> good so, I just need a sanity check. Here is my understanding:
>
> CAM4 was run and output at 1 degree resolution (0.9x1.25, a regular
> lon/lat finite volume grid). Here are some of the lat and lon vectors:
>
> Constant longitude grid spacing (1.25 degrees):
> lon[0]=0 degrees_east
> lon[1]=1.25 degrees_east
> lon[2]=2.5 degrees_east
> ...
> lon[285]=356.25 degrees_east
> lon[286]=357.5 degrees_east
> lon[287]=358.75 degrees_east
>
> Quasi-constant spacing along latitude (varying slightly):
>
> lat[0]=-90 degrees_north
> lat[1]=-89.057591623 degrees_north
> lat[2]=-88.1151832461 degrees_north
> lat[3]=-87.1727748691 degrees_north
> lat[4]=-86.2303664921 degrees_north
> lat[5]=-85.2879581152 degrees_north
> lat[6]=-84.3455497382 degrees_north
> lat[7]=-83.4031413613 degrees_north
> ...
> lat[185]=84.3455497382 degrees_north
> lat[186]=85.2879581152 degrees_north
> lat[187]=86.2303664921 degrees_north
> lat[188]=87.1727748691 degrees_north
> lat[189]=88.1151832461 degrees_north
> lat[190]=89.057591623 degrees_north
> lat[191]=90 degrees_north
>
> Here is the script I am using to convert this grid to Gaussian:
>
> begin
> ;
> ; Create regular spaced lon vector
> nlon = 288 ; 360./1.25 degree
> nlon@double = True
> glon = lonGlobeF(nlon, "lon", "longitude", "degrees_east")
> glon@long_name = "longitude"
> glon = decimalPlaces(glon,3,True)
> ;
> ; Determine and build Gaussian Grid parameters: Want to preserve
> ; resolution of orig grid: lon=1.25dgr; lat=0.92dgr
> nlat = 196 ; lat spacing ~0.92dgr
> nlat@double = True
> glat = latGau(nlat, "lat", "latitude", "degrees_north")
> glat@long_name = "latitude"
> ;
> ; REGRID TO GAUSSIAN GRID:
> flat = file1->lat
> nflat = dimsizes(flat)
> ;
> ; Gather Variables:
> RELHUM = file1->RELHUM
> ;
> ; FIXED TO GAUSSIAN GRID SUBROUTINE:
> RH_gaus = f2gsh_Wrap(RELHUM,(/nlat,nlon/),0)
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

```--
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
```
Received on Fri Jun 3 11:43:23 2011

This archive was generated by hypermail 2.1.8 : Thu Jun 09 2011 - 14:56:48 MDT