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

19990316: Subtraction of Fields in GDCROSS

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: 19990316: Subtraction of Fields in GDCROSS
  • Date: Tue, 16 Mar 1999 16:20:34 -0700

>From: Brett Newkirk <address@hidden>
>Organization: .
>Keywords: 199903162219.PAA23320

>Hi-
>       I was wondering if it was possible to do subtraction of two fields
>in 2 different GEMPAK files using GDCROSS. I have a cross section defined
>and two separate model runs a.gem and b.gem. I would like to subtract the
>potential temperature in the cross sectional plane from each other. I have
>tried using GDFILE=a.gem + b.gem and doing GFUNC=thta//one (save it in a
>grid called one) then doing GFUNC=SUB(one,thta) with GDFILE=b.gem + a.gem
>and this did not work. Is there a simpler way of doing this task from
>within GEMPAK?
> Thanks for your help--
>Brett Newkirk
>
>Brett Newkirk    E-MAIL: address@hidden
>Office: ATG 424  Atmospheric Science/Geophysics Building
>Mailing Address: Department of Atmospheric Sciences, University of Washington
>                 Box 351640
>                 Seattle, WA 98195-1640
>Office Phone: (206) 685-2183
>


Brett,

To subtract two fields from different grid files, use the
+ operator to list both files in gdfile. Then, assume I want to
compare the difference in the F012 tmpc forecast for the 00Z eta run
and the F000 tmpc forecast for the 12Z run.

GDFILE   = $HDS/99031612_eta211.gem+$HDS/99031600_eta211.gem
GDATTIM  = F000
GFUNC    = sub(tmpc,tmpc+2^f012)

in the gfunc, tmpc will use the f000 forecast time from the first
file. In order to get the 12 hour forecast from the second file,
you have to use the inline modifiers to specify F012 from
the second file.

Steve Chiswell