Re: convert nc file in sigma to pressure level

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sun Sep 04 2011 - 08:21:18 MDT

Not sure what to say. See Example 2 at
    http://www.ncl.ucar.edu/Applications/vert_interp.shtml
or Example 5 at
    http://www.ncl.ucar.edu/Document/Functions/Built-in/vinth2p.shtml

===========================================
You *MUST* have the surface pressure.

Here is an excerpt:

  f = addfile(....)
  t = f->t
  ps= f->ps ; sfc pressure [hPa or Pa]

  sigma = f->sigma
or
  sigma = t&lev

  dimt = dimsizes(t)
  ntim = dimt(0)
  ksig = dimt(1)
  nlat = dimt(2)
  mlon = dimt(3)

;***************************************************
; interpolate to pressure levels
;***************************************************
  plevs = (/1000,925, 850, 800, 700, 600, 500, 300 \
           , 200, 250, 200, 150, 100/)*1.0
  plevs@units = "hPa"

  if (ps@units.eq."Pa" .or. ps@units.eq."Pascals") then
      ps = ps*0.01
      ps@units = "hPa"
  end if

  hyam = fspan(0.,0.,ksig-1) ; create fake hyba array
  hybm = sigma

  tp = vinth2p(t,hyam,hybm,plevs,ps,1,1000,1,True)
  printVarSummary(tp)

On 9/4/11 5:00 AM, Coly SAR wrote:
> Below is the structure of the file i am trying to convert in pressure
> levels. It 18 sigma levels and I want to have at standard pressure
> levels : 1000 925 850 800 700 600 500 300 200 250 200 150 100
>
> CS
>
> netcdf atm99 {
> dimensions:
> lon = 190 ;
> lat = 106 ;
> lev = 18 ;
> time = UNLIMITED ; // (124 currently)
> variables:
> double lon(lon) ;
> lon:long_name = "longitude" ;
> lon:units = "degrees_east" ;
> lon:standard_name = "longitude" ;
> lon:axis = "X" ;
> double lat(lat) ;
> lat:long_name = "latitude" ;
> lat:units = "degrees_north" ;
> lat:standard_name = "latitude" ;
> lat:axis = "Y" ;
> double lev(lev) ;
> lev:long_name = "generic" ;
> lev:units = "level" ;
> lev:axis = "Z" ;
> double time(time) ;
> time:units = "hours since 1999-01-01 06:00:00" ;
> time:calendar = "standard" ;
> float u(time, lev, lat, lon) ;
> u:long_name = "westerly wind (m/s)" ;
> u:_FillValue = -1.e+34f ;
> float v(time, lev, lat, lon) ;
> v:long_name = "southerly wind (m/s)" ;
> v:_FillValue = -1.e+34f ;
> float w(time, lev, lat, lon) ;
> w:long_name = "omega (hPa/s) p-velocity" ;
> w:_FillValue = -1.e+34f ;
> float t(time, lev, lat, lon) ;
> t:long_name = "air temperature (degree)" ;
> t:_FillValue = -1.e+34f ;
>
>
> 2011/9/3 Coly SAR <colysar@gmail.com <mailto:colysar@gmail.com>>
>
>
> It is essentially interpolating sigma levels at selected constant
> pressure
> levels and write it to a new nc file having pressure levels.
>
> CS
>
>
> 2011/9/3 Dennis Shea <shea@ucar.edu <mailto:shea@ucar.edu>>
>
> This questions is a bit ambiguous. Are you talking about calculating
> the pressure at each level and grid point or interpolating
> sigm to constant pressure levels?
>
> See Example 2 at:
> http://www.ncl.ucar.edu/__Applications/vert_interp.shtml
> <http://www.ncl.ucar.edu/Applications/vert_interp.shtml>
>
> It shows how to do both.
>
>
> 9/3/11 7:37 AM, Coly SAR wrote:
>
> Dear NCL users,
> I have model output in netcdf with sigma levels and want to
> convert
> from sigma to pressure and wondering if a such
> routine or script is available in ncl.
>
> CS
>
>
> _________________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/__mailman/listinfo/ncl-talk
> <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
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Sep 4 08:21:26 2011

This archive was generated by hypermail 2.1.8 : Wed Sep 07 2011 - 10:58:58 MDT