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.
John, If you can show me what you are doing in gddiag, that might help. I'll step through gddiag to give you a feeling of whats going on. You can calculate d/dz(variable) in gddiag. By default, GEMPAK will create a name based on the functions, parameter, and levels. To make the output grid more usable, you might want to control the naming more. Take for instance, calculating dT/dz in the 500 to 700 mb layer. So the grids you need are: LEVL1 LEVL2 VCORD PARM 500 PRES TMPC 700 PRES TMPC 500 PRES HGHT 700 PRES HGHT Your gddiag function would look like: glevel = 500:700 gfunc = quo(ldf(tmpc),ldf(hght)) gvcord = pres you could also do the calculation like: glevel = 500 gfunc = quo(sub(tmpc,tmpc@700),sub(hght,hght@700)) Now, if you let gddiag determine the name by itself, by leaving GRDNAM = then you get a grid named: LEVL1 LEVL2 VCORD PARM 500 700 PRES QUOLDFTLDFH That PARM name is pretty ugly. You can use GRDNAM = LAPSE for instance, and get: LEVL1 LEVL2 VCORD PARM 500 700 PRES LAPSE You notice that your input grids were defined on individual constant pressure levels, 500 and 700 mb, but the output grid is defined over a layer, using both LEVL1 and LEVL2. Remember, them refering to a level in using the output function later, your will have to use 500:700 as the layer. If you decide you want the above calculation to be written as the lapse rate at a single level between 500 and 700 mb, say 600mb, you can do that with GRDNAM = LAPSE@600 to get: LEVL1 LEVL2 VCORD PARM 600 PRES LAPSE GEMPAK uses up to 2 levels to define a parameter, and up to 2 times to define a parameter. For accumulating/averaging a quantity over time, you will get gdattimes like f000:f024 similar to the way layers are denoted. The "^" character is used to modify the gdattim variable, just as @ for glevel and % for gvcord as described in the GPARM (3.36) section of the user guide. How you chose to name the output grids is probably dependent on what is most convenient for using in your later calculations. The grid diagnostic excersises in the tutorial at: http://www/packages/gempak/tutorial/diagnostic_exercises.html Give some examples of some calculations that use the %,^ and @ modifiers to override the gvcord, gdattim and glevel parameters. When you get ready to do your calculation that uses the individual terms you calculate in gddiag, you may have to use the inline modifiers since quite oftem you are using layer and level quantities at the same time. Steve Chiswell Unidata User Support >From: "John H. E. Clark" <address@hidden> >Organization: . >Keywords: 199901291333.GAA26601 > >Steve, > >Some time ago I asked you about what to do if a line of GEMPAK code is too >long. In particular I was trying to calculate a variable in GDPLOT and its >definition in GFUNC was too long for a single line. > >You had suggested using GDDIAG to do the computation in steps. > >I have tried to use GDDIAG without success. > >I am working with a 24-hour data set of MM5 model output. At one particular >time and at a few constant pressure levels, I wish to find the product of >vertical velocity and the vertical derivative of a complicated function. As >I understand GDDIAG, it can be used to calculate, say, the vertical >derivative of the function and add it to my MM5 data set. I could then call >the variable and multiply by vertical velocity in GDPLOT to get the desired >result. > >The manual only offers a brief explanation of GDDIAG and every time I run >it there are errors. Also even if I get GDDIAG to work such that it adds >the new variable to my MM5 data set, I do not see how to call the new >variable in GDPLOT to get the final result. > >I would appreciate any help you can offer. > >John Clark > >