Hi - For your problem with definining the axis using /BOUNDS, What version of Ferret are you running? This feature is available in Ferret version 5.7 and newer. If you're running a newer Ferret, then what is the error message that you see? If you are running an older Ferret, the behavior of Ferret for an irregular axis is to center the grid cell at the coordinate location. � wrote: Hi, You'll need to use the ZAXREPLACE function. I do something similar to what you're after in the script below. Note, to use this script you'll need an array of the actual or sigma pressure on the model grid (in pascals). If you use the 'actual' pressure, you'll get the true height of the model level, but this may make zonal mean plots look a little funny as they'll be places where the zonally average height is significantly higher than 0km (e.g. South Pole). Therefore, I tend to use a 4D array of sigma pressure levels (i.e. the same pressure column for each location) to make the zonal mean plots. I'm sure there might be a simpler method for this though.... PROBLEM (for someone else?): --------------------------- I can't get the BOUNDS/ qualifier to work when I define the z-axis, so the first level is plotted slightly above the surface. This is because my 4D pressure field gives the pressure of the middle of the model level. I've tried this: define axis/z=0:20/units=km/bounds kmz = \ {0,0.04, 0.04,0.31, 0.31,0.70, 0.70,1.26, 1.26,2.01, 2.01,3.02, \ 3.02,4.20, 4.20,5.46, 5.46,6.71, 6.71,7.91, 7.91,9.09, 9.09,10.50, \ 10.50,12.27, 12.27,14.63, 14.63,18.22, 18.22,22.62, 22.62,27.47, \ 27.47,32.33, 32.33,53.30} ..but with no joy! ---------------- ! height.jnl ! ! Args: 1 = variable to regrid ! 2 = pressure field ! 3 = zmin (e.g. 0km) ! 4 = zmax (e.g. 20km) ! 5 = name of new regridded variable ! ! (credit to Glenn Carver, CAS, U. Cambridge) ! \cancel mode verify let/quiet zmin = $3 let/quiet zmax = $4 ! set increment. let/quiet zinc = 0.1 define axis/z=`zmin`:`zmax`:`zinc`/units=km kmz !Formula to convert pressure (in Pascals) to height (in km) let conv2ht = (44330.77*(1.-($2/101325.0)^0.19026))/1000.0 let $5 = zaxreplace($1,conv2ht,z[gz=kmz]) message/continue Interpolated variable is now in x_km message/continue Regular height (km) axis is in variable kmz ! end of script set mode verify On Wed, 2007-04-25 at 11:52, Marshall L. Mdoka wrote:Hi All, I am new to Ferret and was advised that I can try to use it to solve a problem I have. I am intending to analyse some modelling results I have. There are CTL files which are in sigma coordinates and I would like to convert them pressure coordinates for all the atmospheric levels. May you please help me come up with a script. Thanking you in advance. Marshall -- ~> ~> ~> ~> ~> ~> ~> ~> ~> ~> ~> Ansley Manke, NOAA/PMEL ansley.b.manke@xxxxxxxx 7600 Sand Point Way NE, Seattle WA Phone 206-526-6246, FAX 206-526-6744 |