[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20020129: gempak function question



Paul,
The gempak library is built on several layers. At its simplest,
you can calculate THTE for a single PRES,TMPC,DWPC by calling the PR_THTE
routine. That basically leaves it up to you to loop through each station
that you have retrieved the required values for.

The PD_THTE is similar, but allows you to pass an entire array of
values for each of the quantities.

If you already have the required 3 parameters, you can use those routines
without having to go through the PC_ routines.

A good place to start to find what routines do each computation is the
$GEMTBL/parms/pcconv.tbl file.

The programs like sflist, sfmap, etc. use a higher level routine through the
PC_FUNC routine to allow GEMPAK to calculate a parameter such as THTE
through a variety of known relations. That is, if you have RELH, and
TMPC, you can arrive at DPWC. Then, you can compute THTE. Similarly, the PC_SLCD
routine allows conditions to be imposed on the specified parameters. A program 
like
sflist would be a good place to go to follow the computation of parameters from 
the
user input. The reason it appears daunting is that you are generally telling
GEMPAK what parameters you have available, and what you want to compute. It
is determining which of your parameters can be computed. So, there isn't a 
simple
interface that you pass your input through and arrive at output for each 
parameter.

This may be more than you need when you are writing your own programs
if you know what the data files will look like. These are more helpful when you
really don't know what the input file is going to have in order to
compute your quantities. You probably don't need this level....but let me know
if you think that is where you are headed.

Steve Chiswell
Unidata User Support


>From: Paul Markowski <address@hidden>
>Organization: UCAR/Unidata
>Keywords: 200201292051.g0TKpDx07351

>
>Hello,
>
>I am calling gempak subroutines within f77 code, and I've had much success
>using subroutines such as sf_tstn, sf_ttim, and sf_rdat to extract surface
>observations from gempak files.  However, need to call some of the pc_ and
>pd_ subroutines and have not had much luck.  Specifically, I need to compute
>some derived variables (e.g., equivalent potential temperature) from known
>variables such as temperature and dewpoint, which I've been able to
>successfully obtain using sf_rdat.
>
>It seems as though I need to make calls to pc_init and pd_thte, among
>others.  But I'm a bit overwhelmed at all of the steps that seem to be
>involved, after studying the gempak documentation.  I was wondering if you
>could let me know of the easiest way to go about doing a simple
>calculation from variables contained in the data(nparm) array (output
>from sf_rdat); i.e., what subroutines must be called, and in what order,
>and whether any of the input arguments need to have special values.
>
>Gratefully,
>Paul Markowski
>
>
>__________________
>Dr. Paul Markowski
>Department of Meteorology
>Pennsylvania State University
>503 Walker Building
>University Park, PA  16802
>email: address@hidden
>phone: (814) 865-0478
>fax: (814) 865-3663
>web: http://www.meteo.psu.edu/~marko/
>