Re: Hybrid level to pressure level

From: Carlos A. F. Marques <cafm_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 14 2011 - 03:47:02 MDT

Hi sabeer

I think your script below is correct. I've interpolated CCSM3 hybrid
coordinate to pressure coordinate too, the only difference is that I've
used function 'vinth2p_ecmwf ', because I wanted to extrapolate below
ground with the ECMWF formulation. I believe the /hyam///hybm/
(/hyai///hybi/) does not mean a division, but only that both
coefficients (/hyam and //hybm/ or /hyai/ and /hybi/) must be given to
the interpolation function 'vinth2p' or 'vinth2p_ecmwf'.

Here is the relevant part of the script I use to interpolate temperature:
; =================== TEMPERATURE ==================================
Tin="b30.030e.cam2.h3.T.1972-01-01_cat_1972-01-31.nc"

; =================== SURFACE GEOPOTENTIAL =========================
PHISin="CCSM3_20C_PHIS.nc"

; =================== SURFACE PRESSURE =============================
PSin="b30.030e.cam2.h3.PS.1972-01-01_cat_1972-01-31.nc"

Tccm = addfile(Tin, "r")
Uccm = addfile(Uin, "r")
fccm1 = addfile(PHISin, "r")
fccm2 = addfile(PSin, "r")

phis = fccm1->PHIS ; PHIS is time invariant and so is
2-D (Lat, Lon)
psfc = fccm2->PS ; PS is 3-D (Time, Lat, Lon)

lev =
(/10,20,30,50,70,100,150,200,250,300,400,500,600,700,850,925,1000/) ;
pressure levels to interpolate
lev!0 = "lev" ; variable/dim name
lev&lev = lev ; create coordinate variable
lev@long_name = "pressure" ; attach some attributes
lev@units = "hPa"
lev@positive = "down"

   intyp = 1 ; 1=linear, 2=log, 3=log-log
   kxtrp = True ; True=extrapolate

; »»»»»»»»»»»»»»»»»»»»»»» TEMPERATURE ««««««««««««««««««««««
varflg = 1 ; temperature is variable
Th = Tccm->T ; temperature at hybrid levels
hlev = Tccm->lev ; hybrid levels
tb = Th(:,dimsizes(hlev)-1,:,:) ; temperature at the lowest level
  hyam = Tccm->hyam
  hybm = Tccm->hybm
  hyai = Tccm->hyai
  hybi = Tccm->hybi
  p0 = Tccm->P0*0.01

T =
vinth2p_ecmwf(Th,hyam,hybm,lev,psfc,intyp,p0,1,kxtrp,varflg,tb,phis) ;
temperature at pressure levels

Hope that helps,

Carlos

On 14/04/11 08:53, Sabeerali(sebi) wrote:
> I want to convert the CCSM hybrid coordinate to pressure coordinate.So
> I used the vinth2p function.I used the following scripts. My level is
> hybrid level at midpoints (1000*(A+B))
> So I am confused with the sentence in the description of function
> vinth2p where it is saying that "If /datai/ is on midlevels
> (interfaces), then /hyam///hybm/ (/hyai///hybi/) coefficients should
> be input." What is mean by /the division hyam///hybm. If that is the
> case how I can change my scripts? or the below script is O.K? Any help
> would be appreciated./
>
> begin
>
> f=addfile("file.nc <http://file.nc>","r")
> hyam=f->hyam
> hybm=f->hybm
> psurf=f->PS
> P0=1000
> lev_press=(/10,20,30,50,70,100,150,200,250,300 \
> ,400,500,600,700,850,925,1000/)
> uwnd=f->uwnd ;time,lev,lat,lon
> u_new=vinth2p(uwnd,hyam,hybm,lev_press,psurf,1,P0,1,True)
> end
>
> Thanks in advance
> sabeer
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
Carlos A. F. Marques
Department of Physics&  CESAM
University of Aveiro
Campus Universitário de Santiago
3810-193 Aveiro - Portugal
Tel: 967343770

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 14 19:44:19 2011

This archive was generated by hypermail 2.1.8 : Tue Apr 19 2011 - 18:32:03 MDT