Re: How to set Isobaric levels

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 17 Jan 2008 13:26:55 -0700

Rodrigo Fernández wrote:
> On Jan 17, 2008 4:16 PM, patton <thernand_at_inf.utfsm.cl> wrote:
>
>> Rodrigo Fernández wrote:
>>
>>> Hi,
>>> I have been working with a .grib file, and encountered some problems
>>> when i wanted to set the isobaric levels like (to be more especific
>>> 650mb, 500mb and 200mb). I dont understand quite well the
>>> documentation that says " The actual level coordinate in this case is
>>> just an integer index. However it specifies how to compute the
>>> pressure levels using the CF-compliant attribute formula_terms". Can i
>>> set the levels like its done in GraDs? ( set lev 650 ) or with a
>>> certain resource like mpsetlev ?
>>>
>>> I have been guessing at random with every variable in the file ( i
>>> have been lucky with some of them and founded some levels that
>>> needed).
>>>
>>> I attached the output of ncl_filedump.
>>>
>>>
>> Hi,
>>
>> i have the same problem, please can somebody help us?
>>
>> Thanks!.
>>
>> --
>> Tomás Hernández C.
>>
>>
>
> Hi Tomas,
> I founded how to set the levels reading the introduction.ppt.
> You can set the isobaric levels like this:
>
> Example:
>
> T = tf->TMP_GDS0_ISBL_10({650},:,:) ; 650mb
> T = tf->TMP_GDS0_ISBL_10({500},:,:) ; 500mb
> T = tf->TMP_GDS0_ISBL_10({200},:,:) ; 200mb
>
> It was very easy!, i will put more attention to the things i read next time :D.
>
> Cheers,
>
> ------------------------------------------------------------------------
>
>
==============================

A little background:

NCL variables are based upon the netCDF variable model.
See: http://www.cgd.ucar.edu/~shea/netCDF-varimodel.png

When NCL imports a variable via "addfile" it reads *all*
information associated with the variable. It is imported
as an 'data object' or a structure. The contents of this
object/structure may be accessed via NCL syntaxc [@, &,{...}].
This applies to netCDF, GRIB-1/2, HDF and HDF-EOS.

When a variable in memory or on a file has *coordinate variables*
associated with it, the user may use the "natural coordinate"
[eg: 700, 200 for pressure] to access the specified level.
This is more convenient then having to use subscripts.

----
The issue of netCDF coordinate variables is a bit difficult to explain.
They must be one dimensional variables whose dimension name is
the same as the variable name. Some examples
     lat(lat),  time(time),   lev(lev), 
     lv_ISBL2 ( lv_ISBL2 ).,   g0_lat_0 ( g0_lat_0 ), g0_lon_1 ( g0_lon_1 )
     float V_GRD_GDS0_ISBL_10 ( lv_ISBL2, g0_lat_0, g0_lon_1 )
To use "coordinate variables" with natural subscripts you must enclose
the natural coordinates with {...}
     v700   = V_GRD_GDS0_ISBL_10({700},:,:)
     vpxy   = f->V_GRD_GDS0_ISBL_10({700},{-30:50},{ 135:270})
It is better programming practice to use variables to facilitate future 
changes
      p = 700
      latS  = -30
      latN =  50
      lonE = 135
      lonW = 270
      vpxy   = f->V_GRD_GDS0_ISBL_10({p},{latS:latN},{lonE:lonW})
A more detailed description of NCL subscripting is at:
     http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml
For reference/hard copy, it is recommended to download the 'mini' manuals.
These are .pdf
    Mini-Language
    Graphics
Best on a duplex color printer but B+W is fine.
Good luck
<http://www.ncl.ucar.edu/Document/Manuals/language_man.pdf>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jan 17 2008 - 13:26:55 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 23 2008 - 14:19:32 MST