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

20030324: Interesting gddiag challenge.



Lewis,

You can control the grid identification for a calculated parameter
by specifying the information in GRDNAM using the ^, @ and %
inline modifiers to override the default parameter name
that would be created..

For example when calculating a precipitation difference,
GDATTIM = f024
GFUNC=sub(P24M,P12M^f012)
GRDNAM=P12M^f024

The GRDNAM will use f024 for TIME1 only instead of
using the 2 times f024 and f012 as it would default.

The above is also possible when doing layer or multiple
vertical coordinate  calculations that you want to be
identified using a single or different height and/or
vertical coordinate.

Steve Chiswell





>From: address@hidden
>Organization: UCAR/Unidata
>Keywords: 200303241358.h2ODwWB2025335

>Hello Unidata Support
>
>I have a little challenge with gddiag.
>
>In a nutshell:
>
>Is there a way to force a gddiag calculation to write only 1 time in the
>gempak output grid? My gddiag calculation seems to want to include TIME1 and
>TIME2 in the ouput grid and I am concerned that this may be causing problems
>in nmap..
>
>Here is what I am trying to do: 
>
>Background: 
>
>I am presently adapting the Canadian Grib Data for viewing in NMAP2.
>
>I am converting it to gempak format, have adapted the nmap tables to
>recognize the new grid.
>
>It seems to be working fine for most things....except precip is giving me a
>bit of a challenge.
>
>The file(s) I am working with contain cummulative precipitation in the form
>of P06M, P12M, P18M, P24M, etc..representing cummulative precip from 00hr at
>06,12,18,24 etc respectively.
>
>One of the scripts in NMAP2 can print Precip_12hr_mm with the following
>lines in the script:
>
>gdattim=f12-last-12
>gdpfunc=p12m
>
>My problem is that I don't have a P12M for each time interval. The way my
>present data file is structured it only has P12M for f12.
>
>My attempst at a solution:
>
>During the process of turning my initial grib data into gempak format, I
>decided to add a gddiag calculation using the lines of code below (see
>gddiag calculation below) to actually calculate various intervals of
>precipitation and label them so that the nmap scripts can more easily
>recognize them. 
>
>The gddiag calculation works fine I believe except that it adds a TIME2 to
>the name of the variable. 
>
>I have verified that the p12m grids were indeed calculated by checking for
>their presence using gdinfo.
>I can plot these calculated p12m grids using gdcntr using:
>
># This will work in gdcntr if I define a time interval
>gddattim=f36:f24   
>gfunc=P12M
>
>#This will not work in gdcntr
>gddatim=f36
>gfunc=p12M
>error input grid not found.
>
>Now when viewing the results in NMAP2, I get the nmap2 script to recognize
>most of the the P12M variables by using 
>
>gdattim=f12-last-12
>gdpfunc=p12m
>
>It works except for f36 which does not appear in nmap. (but it is there in
>gdcntr)
>
>When I try plotting the P06M intervals using 
>gdattim=f06-last-6
>gdpfunc=p06m
>
>again it seems to work but sporatically. 
>
>
>Are the time intervals resulting from gddiag causing a problem?
>
>Any suggestions would be greatly appreciated.
>
>Thanks
>
>Lewis Poulin
>CMC-Montreal
>
>
>
>
>
>
>GDDIAG CALCULATION USED TO CALCULATE INTERVALS OF PRECIPITATION
>
>for hour1 in 12_6 18_6 18_12 24_6 24_12 30_6 30_12 30_24 36_6 36_12 36_24
>42_6 42_12 42_24 48_6 48_12 48_24
>do
>case ${hour1} in 
> 12_6)
>   func_var="sub(p12m,p06m^f06)"
>   gdattim_var=f12
>   grdnam_var=p06m
> ;;
> 18_6)
>   func_var="sub(p18m,p12m^f12)"
>   gdattim_var=f18
>   grdnam_var=p06m
> ;;
> 18_12)
>   func_var="sub(p18m,p06m^f06)"
>   gdattim_var=f18
>   grdnam_var=p12m
> ;;
> 24_6)
>   func_var="sub(p24m,p18m^f18)"
>   gdattim_var=f24
>   grdnam_var=p06m
> ;;
> 24_12)
>   func_var="sub(p24m,p12m^f12)"
>   gdattim_var=f24
>   grdnam_var=p12m
> ;;
> 30_6)
>   func_var="sub(p30m,p24m^f24)"
>   gdattim_var=f30
>   grdnam_var=p06m
> ;;
> 30_12)
>   func_var="sub(p30m,p18m^f18)"
>   gdattim_var=f30
>   grdnam_var=p12m
> ;;
> 30_24)
>   func_var="sub(p30m,p06m^f06)"
>   gdattim_var=f30
>   grdnam_var=p24m
> ;;
> 36_6)
>   func_var="sub(p36m,p30m^f30)"
>   gdattim_var=f36
>   grdnam_var=p06m
> ;;
> 36_12)
>   func_var="sub(p36m,p24m^f24)"
>   gdattim_var=f36
>   grdnam_var=p12m
> ;;
> 36_24)
>   func_var="sub(p36m,p12m^f12)"
>   gdattim_var=f36
>   grdnam_var=p24m
> ;;
> 42_6)
>   func_var="sub(p42m,p36m^f36)"
>   gdattim_var=f42
>   grdnam_var=p06m
> ;;
> 42_12)
>   func_var="sub(p42m,p30m^f30)"
>   gdattim_var=f42
>   grdnam_var=p12m
> ;;
> 42_24)
>   func_var="sub(p42m,p18m^f18)"
>   gdattim_var=f42
>   grdnam_var=p24m
> ;;
> 48_6)
>   func_var="sub(p48m,p42m^f42)"
>   gdattim_var=f48
>   grdnam_var=p06m
> ;;
> 48_12)
>   func_var="sub(p48m,p36m^f36)"
>   gdattim_var=f48
>   grdnam_var=p12m
> ;;
> 48_24)
>   func_var="sub(p48m,p24m^f24)"
>   gdattim_var=f48
>   grdnam_var=p24m
> ;;
> *)
> ;;
>esac
>
>#echo hour1=$hour1
>#echo func_var=$func_var
>#read
>
>gddiag << EOF
>gdfile=${gempakfile}
>gdoutf=${gempakfile}
>gfunc=$func_var
>gdattim=$gdattim_var
>glevel=0
>gvcord=none
>grdnam=$grdnam_var
>gpack=
>r
>
>
>ex
>EOF
>
>done
>