[Thread Prev][Thread Next][Index]
Re: [ferret_users] height in meters
Hi Mauro,
I put my cross-section plots on a height axis by regridding the variable
using the 'zaxreplace' function. Here's how I do it:
I have 2 netCDF files containing a 4D field of the pressure at my 19
sigma model levels. One file has the actual pressure for each grid
square (taking orography into account) and the other has a constant
pressure for each level globally. The former file can be used for cross
sections of particular longitudes, where you want to preserve the
orography detail, and the latter for zonal means, where you would like
the plot to start at zero for all latitudes. You can use either file
with a script similar to this one below (credit G. Carver, Cambridge for
providing me a similar version):
! pres2height.jnl
!
! To regrid data to true height (using 4D pressure field)
!
! Args: 1 = variable to regrid (e.g ozone)
! 2 = pressure field (varying or constant)
! 3 = name of new regridded variable
\cancel mode verify
!Z Axis definitions
let zmin = 0
let zmax = 20
let zinc = 0.1
define axis/z=`zmin`:`zmax`:`zinc`/units=km kmz
!Convert pressure (Pa) to height (km)
let conv2ht = (44330.77*(1.-($2/100900.0)^0.19026))/1000.0
!Replace sigma z axis with height
let $3 = zaxreplace($1,conv2ht,z[gz=kmz])
! end of script
set mode verify
You can run the script like this:
yes? use my_output.nc !your model data
yes? use my_pressure.nc !your model pressure field
yes? let my_var = o3[d=1]
yes? let my_pres = pres[d=2]
yes? go pres2height my_var my_pres my_var_km
Hope this works for you,
Paul
--
Paul Young
Centre for Atmospheric Science
Department of Chemistry
University of Cambridge
Lensfield Road
Cambridge CB2 1EW UK
Tel: +44 (0)1223 763 814
Fax: +44 (0)1223 763 823
http://www.atm.ch.cam.ac.uk/cas
http://www.atm.ch.cam.ac.uk/~paul
> Hello Ferret users,
>
> I am a novice user and currently needing a help,
>
> My problem is: although I could generate a cross-section, I want to
> change Z into meters.
>
> Below follows the plot; instead 27 Z levels, I would like to change it
> into meters
>
>
>
>
> best regards,
> Mauro
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Privacy Policy | Disclaimer | Accessibility Statement