NSF Unidata

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

20020108: handling MIXR with grid diagnostics in gempak

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.




Clint,

This is the quick answer...

You are right in that the display of MIXR is scaled by 1000 to
produce g/kg (see $GEMPAK/source/gemlib/dg/dgscal.f). Calculations
are done in the dimensionless MKS units.

However, once you perform a calculation on the data (in MKS units),
and store the output for a different name (other than the recognized MIXR
name), your display will not be scaled to g/kg. So, you will have to
take that into acount when you SCALE the output for display.

I believe that is the gist of your message below. That is, when you
specify GRDNAM as MIXR_MOD for copying the data, the display output
will not be scaled to g/kg as MIXR would. You may also notice some
small roundoff changes due to the packing (PACK=grib/16) if the original
data used more precision.

If you want me to look into a specific calculation and how
to carry forth the MKS units let me know.


Chiz


Steve Chiswell
Unidata User Support



>From: Clint Rowe <address@hidden>
>Organization: UCAR/Unidata
>Keywords: 200201081709.g08H91N04033

>Chiz,
>
>I'm finding some strange behavior when trying to do some grid computations 
>in gempak.  I'm trying to compare two MM5 model runs and am creating a three-
>panel display (the two fields and their difference) using version 5.6e.  I've
>written a script that does this for whatever field I'm interested in.  
>Everything seemed to be working okay until Mark noticed that when plotting
>2m mixing ratios, the difference map were all blank, even though there are
>noticable differences in the two model runs.  If I run GDLIST on the two
>files and look at mixr, mixr+2 and sub(mixr, mixr+2), I get strange results.
>The reported mins and maxs look okay for the two runs and show differences
>as seen in the plots.  However, the results of the subtraction seems to
>yield zeros across the entire domain (i.e., the min and max are both zero).
>
>
>papagayo% gdlist
> GDATTIM   Grid date/time                    860731/1200
> GLEVEL    Grid level                        2
> GVCORD    Grid vertical coordinate          zagl
> GFUNC     Scalar grid                       mixrdiff
> GDFILE    Grid file                         test.gem
> GAREA     Graphics area                     dset
> PROJ      Map projection/angles/margins|dr  MER
> SCALE     Scalar scale / vector scale       0
> OUTPUT    Output device/filename            T
> Parameters requested: GDATTIM,GLEVEL,GVCORD,GFUNC,GDFILE,GAREA,PROJ,SCALE,
> OUTPUT.
> 
>GEMPAK-GDLIST>gdfil=../CTL/1986073100/1986073100_mm5_domain3.gem+../MOD/198607
> 31
>00/1986073100_mm5_domain3.gem
> GEMPAK-GDLIST>gfunc=mixr
> GEMPAK-GDLIST>r
>
>
> GDLIST PARAMETERS: 
>
> Grid file: 
>../CTL/1986073100/1986073100_mm5_domain3.gem+../MOD/1986073100/1986073100_mm5_
> do
>main3.gem                                       
> GRID IDENTIFIER:
>    TIME1             TIME2         LEVL1 LEVL2   VCORD PARM
>860731/1200                             2          ZAGL MIXR        
>
> GAREA:    dset                                            
> SCALE FACTOR : 10** 0
> OUTPUT:    TERM/              
>
> MINIMUM AND MAXIMUM VALUES     5.58    13.44
>Enter <cr> to accept parameters or type EXIT:ex
> Parameters requested: GDATTIM,GLEVEL,GVCORD,GFUNC,GDFILE,GAREA,PROJ,SCALE,
> OUTPUT.
> GEMPAK-GDLIST>gfun=mixr+2
> GEMPAK-GDLIST>r
>
>
> GDLIST PARAMETERS: 
>
> Grid file: 
>../CTL/1986073100/1986073100_mm5_domain3.gem+../MOD/1986073100/1986073100_mm5_
> do
>main3.gem                                       
> GRID IDENTIFIER:
>    TIME1             TIME2         LEVL1 LEVL2   VCORD PARM
>860731/1200                             2          ZAGL MIXR        
>
> GAREA:    dset                                            
> SCALE FACTOR : 10** 0
> OUTPUT:    TERM/              
>
> MINIMUM AND MAXIMUM VALUES     5.52    13.43
>Enter <cr> to accept parameters or type EXIT:ex
> Parameters requested: GDATTIM,GLEVEL,GVCORD,GFUNC,GDFILE,GAREA,PROJ,SCALE,
> OUTPUT.
> GEMPAK-GDLIST>gfun=sub(mixr,mixr+2)
> GEMPAK-GDLIST>r
>
>
> GDLIST PARAMETERS: 
>
> Grid file: 
>../CTL/1986073100/1986073100_mm5_domain3.gem+../MOD/1986073100/1986073100_mm5_
> do
>main3.gem                                       
> GRID IDENTIFIER:
>    TIME1             TIME2         LEVL1 LEVL2   VCORD PARM
>860731/1200                             2          ZAGL SUBMIXR     
>
> GAREA:    dset                                            
> SCALE FACTOR : 10** 0
> OUTPUT:    TERM/              
>
> MINIMUM AND MAXIMUM VALUES     0.00     0.00
>Enter <cr> to accept parameters or type EXIT:ex
> Parameters requested: GDATTIM,GLEVEL,GVCORD,GFUNC,GDFILE,GAREA,PROJ,SCALE,
> OUTPUT.
> GEMPAK-GDLIST>ex
>papagayo% 
>
>
>Okay, so if that wasn't a big enough problem, when I started putting together
>something to send you, I found even more strangeness.  I copied the mixing 
>ratio fields from the two files into a new file that I could send to you.  I
>also calculated the deifference to add to that file.  Then, when I began to 
>check my efforts, I found that the grids I had copied were different than
>what I expected. The raw fields had been multipled by 1000 and now there are 
>small differences (but smaller than implied by the fields themselves).
>
>
>papagayo% gdcfil
> GDOUTF    Output grid file                  test.gem
> PROJ      Map projection/angles/margins|dr  MER
> GRDAREA   Area covered by grid               
> KXKY      Number of grid points in x;y      10;10
> MAXGRD    Maximum number of grids           200
> CPYFIL    Grid file whose navigation is to  
>../CTL/1986073100/1986073100_mm5_domain3.gem
> ANLYSS    Grid analysis block               4/2;2;2;2
> Parameters requested: GDOUTF,PROJ,GRDAREA,KXKY,MAXGRD,CPYFIL,ANLYSS.
> GEMPAK-GDCFIL>r
>
> GDCFIL PARAMETERS: 
>
> New grid file:         test.gem                                              
>                                                                           
> File copied:           ../CTL/1986073100/1986073100_mm5_domain3.gem          
>                                                                           
> Grid projection:       LCC                     
> Lower left corner:         40.51  -104.66
> Upper right corner:        43.65   -96.77
> KX, KY:                      156       90
> DELTAN =     4.000       EXTEND =   2;  2;  2;  2
> Maximum number of grids that can be added to file  200
>Enter <cr> to accept parameters or type EXIT:
> Parameters requested: GDOUTF,PROJ,GRDAREA,KXKY,MAXGRD,CPYFIL,ANLYSS.
> GEMPAK-GDCFIL>ex
>papagayo% gddiag
> GDFILE    Grid file                         
>../CTL/1986073100/1986073100_mm5_domain3.gem+../MOD/1986073100/1986073100_mm5_
> do
>main3.gem
> GDOUTF    Output grid file                  test.gem
> GFUNC     Scalar grid                       sub(mixr,mixr+2)
> GDATTIM   Grid date/time                    860731/1200
> GLEVEL    Grid level                        2
> GVCORD    Grid vertical coordinate          zagl
> GRDNAM    Grid parameter name               mixr_mod
> GPACK     Packing type/number of bits       grib/16
> Parameters requested: GDFILE,GDOUTF,GFUNC,GDATTIM,GLEVEL,GVCORD,GRDNAM,
> GPACK.
> GEMPAK-GDDIAG>gfunc=mixr+2
> GEMPAK-GDDIAG>r
>
>
>    TIME1             TIME2         LEVL1 LEVL2   VCORD PARM
>860731/1200                             2          ZAGL MIXR_MOD    
>Enter a new grid parameter name, <cr> to accept or type EXIT:
> Parameters requested: GDFILE,GDOUTF,GFUNC,GDATTIM,GLEVEL,GVCORD,GRDNAM,
> GPACK.
> GEMPAK-GDDIAG>gfunc=mixr
> GEMPAK-GDDIAG>grdnam=mixr_ctl
> GEMPAK-GDDIAG>r
>
>
>    TIME1             TIME2         LEVL1 LEVL2   VCORD PARM
>860731/1200                             2          ZAGL MIXR_CTL    
>Enter a new grid parameter name, <cr> to accept or type EXIT:
> Parameters requested: GDFILE,GDOUTF,GFUNC,GDATTIM,GLEVEL,GVCORD,GRDNAM,
> GPACK.
> GEMPAK-GDDIAG>l
> GDFILE   = 
>../CTL/1986073100/1986073100_mm5_domain3.gem+../MOD/1986073100/1986073100_mm5_
> do
>main3.gem
> GDOUTF   = test.gem
> GFUNC    = mixr
> GDATTIM  = 860731/1200
> GLEVEL   = 2
> GVCORD   = zagl
> GRDNAM   = mixr_ctl
> GPACK    = none
> GEMPAK-GDDIAG>gfunc=sub(mixr,mixr+2)
> GEMPAK-GDDIAG>l
> GDFILE   = 
>../CTL/1986073100/1986073100_mm5_domain3.gem+../MOD/1986073100/1986073100_mm5_
> do
>main3.gem
> GDOUTF   = test.gem
> GFUNC    = sub(mixr,mixr+2)
> GDATTIM  = 860731/1200
> GLEVEL   = 2
> GVCORD   = zagl
> GRDNAM   = mixr_ctl
> GPACK    = none
> GEMPAK-GDDIAG>grdnam=mixrdiff
> GEMPAK-GDDIAG>r
>
>
>    TIME1             TIME2         LEVL1 LEVL2   VCORD PARM
>860731/1200                             2          ZAGL MIXRDIFF    
>Enter a new grid parameter name, <cr> to accept or type EXIT:
> Parameters requested: GDFILE,GDOUTF,GFUNC,GDATTIM,GLEVEL,GVCORD,GRDNAM,
> GPACK.
> GEMPAK-GDDIAG>ex
>papagayo% 
>papagayo% gdinfo
> GDFILE    Grid file                         
>../CTL/1986073100/1986073100_mm5_domain3.gem+../MOD/1986073100/1986073100_mm5_
> do
>main3.gem
> LSTALL    Full list flag                    YES
> OUTPUT    Output device/filename            T
> GDATTIM   Grid date/time                    860731/1200
> GLEVEL    Grid level                        2
> GVCORD    Grid vertical coordinate          zagl
> GFUNC     Scalar grid                       sub(mixr,mixr+2)
> Parameters requested: GDFILE,LSTALL,OUTPUT,GDATTIM,GLEVEL,GVCORD,GFUNC.
> GEMPAK-GDINFO>gdfil=test.gem
> GEMPAK-GDINFO>gfunc=all
> GEMPAK-GDINFO>r
>
> GRID FILE: test.gem                                                          
>                                                               
>
> GRID NAVIGATION: 
>     PROJECTION:          LCC                 
>     ANGLES:                30.0  -103.0    60.0
>     GRID SIZE:          156  90
>     LL CORNER:              40.51   -104.66
>     UR CORNER:              43.65    -96.77
>
> GRID ANALYSIS BLOCK: 
>     ANALYSIS TYPE:        BARNES
>     DELTAN:               4.000
>     DELTAX:           -9999.000
>     DELTAY:           -9999.000
>     GRID AREA:            39.00 -106.00   45.00  -96.00
>     EXTEND AREA:          39.00 -106.00   45.00  -96.00
>     DATA AREA:            39.00 -106.00   45.00  -96.00
>
> Number of grids in file:     3
>
> Maximum number of grids in file:    200
>
>  NUM       TIME1              TIME2           LEVL1 LEVL2  VCORD PARM
>    1     860731/1200                              2         ZAGL MIXR_MOD    
>    2     860731/1200                              2         ZAGL MIXR_CTL    
>    3     860731/1200                              2         ZAGL MIXRDIFF    
> Parameters requested: GDFILE,LSTALL,OUTPUT,GDATTIM,GLEVEL,GVCORD,GFUNC.
> GEMPAK-GDINFO>ex
>papagayo% gdlist
> GDATTIM   Grid date/time                    860731/1200
> GLEVEL    Grid level                        2
> GVCORD    Grid vertical coordinate          zagl
> GFUNC     Scalar grid                       all
> GDFILE    Grid file                         test.gem
> GAREA     Graphics area                     dset
> PROJ      Map projection/angles/margins|dr  MER
> SCALE     Scalar scale / vector scale       999
> OUTPUT    Output device/filename            T
> Parameters requested: GDATTIM,GLEVEL,GVCORD,GFUNC,GDFILE,GAREA,PROJ,SCALE,
> OUTPUT.
> GEMPAK-GDLIST>gfun=mixr_ctl
> GEMPAK-GDLIST>scal=0
> GEMPAK-GDLIST>r
>
>
> GDLIST PARAMETERS: 
>
> Grid file: test.gem                                                          
>                                                               
> GRID IDENTIFIER:
>    TIME1             TIME2         LEVL1 LEVL2   VCORD PARM
>860731/1200                             2          ZAGL MIXR_CTL    
>
> GAREA:    dset                                            
> SCALE FACTOR : 10** 0
> OUTPUT:    TERM/              
>
> MINIMUM AND MAXIMUM VALUES  5578.01 13438.01
>Enter <cr> to accept parameters or type EXIT:ex
> Parameters requested: GDATTIM,GLEVEL,GVCORD,GFUNC,GDFILE,GAREA,PROJ,SCALE,
> OUTPUT.
> GEMPAK-GDLIST>gfunc=mixr_mod
> GEMPAK-GDLIST>r
>
>
> GDLIST PARAMETERS: 
>
> Grid file: test.gem                                                          
>                                                               
> GRID IDENTIFIER:
>    TIME1             TIME2         LEVL1 LEVL2   VCORD PARM
>860731/1200                             2          ZAGL MIXR_MOD    
>
> GAREA:    dset                                            
> SCALE FACTOR : 10** 0
> OUTPUT:    TERM/              
>
> MINIMUM AND MAXIMUM VALUES  5519.52 13429.52
>Enter <cr> to accept parameters or type EXIT:ex
> Parameters requested: GDATTIM,GLEVEL,GVCORD,GFUNC,GDFILE,GAREA,PROJ,SCALE,
> OUTPUT.
> GEMPAK-GDLIST>gfunc=mixrdiff
> GEMPAK-GDLIST>r
>
>
> GDLIST PARAMETERS: 
>
> Grid file: test.gem                                                          
>                                                               
> GRID IDENTIFIER:
>    TIME1             TIME2         LEVL1 LEVL2   VCORD PARM
>860731/1200                             2          ZAGL MIXRDIFF    
>
> GAREA:    dset                                            
> SCALE FACTOR : 10** 0
> OUTPUT:    TERM/              
>
> MINIMUM AND MAXIMUM VALUES    -0.55     0.95
>Enter <cr> to accept parameters or type EXIT:ex
> Parameters requested: GDATTIM,GLEVEL,GVCORD,GFUNC,GDFILE,GAREA,PROJ,SCALE,
> OUTPUT.
> GEMPAK-GDLIST>ex
>papagayo% 
>
>
>
>Can you explain what's happening?
>
>Clint
>
>
>
>====================================================================
>Clinton M. Rowe
>Associate Professor 
>Meteorology/Climatology Program                  phone:(402)472-1946
>Department of Geosciences                          fax:(402)472-4917
>University of Nebraska-Lincoln                        address@hidden
>
>