about hydro function

From: Ufuk Utku Turuncoglu <u.utku.turuncoglu_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 04 2010 - 07:07:51 MST

Hi,

I try to calculate geopotential height in each pressure level using NCL
hydro function but it behaves strange results for the lowest pressure
level (may be it is correct but i am not sure). I try to explain it
using following table,

(0) ---------------------------------------------------------------
(0) id lev temp mix.rat vtemp pres hgt1
(0) ---------------------------------------------------------------
(0) i = 8 j = 8 z = 0 p surface = 1031.43
(0) 0 0.9970 277.8898 0.004332 278.6241 1028.3346 0.0000
(0) 1 0.9750 276.6697 0.003945 277.3356 1005.5988 181.9110
(0) 2 0.9304 276.2367 0.003813 276.8792 959.6597 561.1757
(0) 3 0.8698 276.0042 0.001906 276.3251 897.1711 1106.3083
(0) 4 0.7922 275.8712 0.001745 276.1647 816.9797 1863.3903
(0) 5 0.6996 272.2826 0.001750 272.5732 720.8051 2869.2683
(0) 6 0.5995 264.1807 0.000840 264.3160 616.5197 4097.4312
(0) 7 0.5045 254.7549 0.000164 254.7804 517.4025 5429.2822
(0) 8 0.4221 245.4995 0.000000 245.4995 431.4965 6758.9644
(0) 9 0.3547 235.3604 0.000012 235.3622 361.4435 8006.0547
(0) 10 0.2998 225.2640 0.000049 225.2707 304.5563 9160.8809
(0) 11 0.2497 214.7236 0.000010 214.7248 252.9681 10356.4434
(0) 12 0.1996 205.7428 0.000011 205.7442 201.6077 11753.5537
(0) 13 0.1495 206.4208 0.000009 206.4220 150.4909 13517.3672
(0) 14 0.0992 210.4499 0.000001 210.4501 99.5809 16035.5850
(0) 15 0.0569 212.3834 0.000002 212.3836 56.9033 19497.5586
(0) 16 0.0296 209.5725 0.000000 209.5725 29.5943 23537.1602
(0) 17 0.0148 199.2787 0.000000 199.2787 14.7972 27696.5254
(0) 18 0.0046 212.1707 0.000000 212.1707 4.6059 34663.4102

as you can see from table, the surface pressure is 1031.43 and the
height of that grid point is zero (it is a sea point). The hydro
function gives the first layer height as zero like surface. In fact that
its pressure is 1028.3346 and it must be a positive value for that
layer. The calculation part of my script as follows,

   ;--- convert potential temperature to temperature
   p0 = 1000.0 ; referance pressure [mb]
   cp = 1004.7 ; specific heat at constant pressure for air [J/(kg-K)]
   Rgas = 287.04 ; specific gas constant for air [J/(kg-K)]
   Rcp = Rgas/cp ; constant

   ;--- use possion equation to convert ---
   ;--- potential temperature to actual temperature ---
   tt = theta/((p0/pres)^Rcp)

   ;--- use specific humidity and mixing ratio relation to ---
   ;--- convert specific humidity to mixing ratio ---
   mr = shum/(1.0-shum)

   ;--- calculate virtual temperature ---
   tkv = tt*(1.+mr*0.61)
   copy_VarCoords(theta, tkv)

   ;--- calculate geopotemtial height in hybrid levels ---
   geop_hgt = hydro(pres(time|:,lat|:,lon|:,lev|:), \
                    tkv(time|:,lat|:,lon|:,lev|:), \
                    hgt2(time|:,lat|:,lon|:))
   copy_VarCoords(pres(time|:,lat|:,lon|:,lev|:), geop_hgt)

   ;--- reorder dimensions ---
   geop_hgt2 = geop_hgt(time|:,lev|:,lat|:,lon|:)

In script, i calculate the temperature from potential temperature field
and then i calculate the virtual temperature to use in NCL hydro
function. This code has the same problem for land points and it gives
the first layer height exactly as surface height. The units of the used
variables; pres is millibar, tkv is K, hgt2 is meter. Any suggestion
will be helpful.

Thanks,

--ufuk

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 4 07:07:59 2010

This archive was generated by hypermail 2.1.8 : Fri Mar 12 2010 - 09:11:56 MST