[gradsusr] LFC calculation

Charles Seman Charles.Seman at noaa.gov
Thu Apr 21 15:16:16 EDT 2011


Following Jeff Duda's idea for getting the LFC...

I'm not sure if this would work, but perhaps you could use "defval" to 
re-define a GrADS 2D LFC field initially defined to "undef"...

here is some GrADS pseudo-code for a single time-level, NOT TESTED, that 
you may be able to adapt?

'open 'your_GrADS_ctl_file

* find "nx" and "ny"...

'query file'
say
say result
rec5 = sublin(result,5)
nx = subwrd(rec5,3) ; ny = subwrd(rec5,6) ; nz = subwrd(rec5,9) ; nt = 
subwrd(rec5,12)

'set x 1 'nx
'set y 1 'ny
'set z 1'
'set t 1'

* initialize LFC field variable to "undef" using 
"a_GrADS_ctl_file_2D_var" from "your_GrADS_ctl_file"...

* define maskoutfield = -1 everywhere to use maskout() define a new 
"LFC" field = undef everywhere

'maskoutfield = const(a_GrADS_ctl_file_2D_var,-1,-a)'
'undef = maskout(a_GrADS_ctl_file_2D_var,maskoutfield)'
'LFC = undef'
'set x 1' ; 'set y 1' ; 'd undef' ; undef_value = subwrd(result,4)

  yy=1
while ( yy <= ny )
  xx=1
while ( xx <= nx )
  'set x 'xx
  'set y 'yy

*  load a sounding for this (x,y) point and
*  use some GrADS code to calculate LFC
*  note, LFC may not exist and if it doesn't
*  don't redefine LFC variable at this point (remains undefined)...

  LFC_value = undef_value ; initialize LFC_value for this (x,y) point to 
"undef" value

...do calculations to update "LFC_value" if possible

  if ( LFC_value != undef_value )

*  use "defval" to redefine LFC for this point in 2D field using LFC_value

    'set defval LFC 'xx' 'yy' 'LFC_value

  endif

  xx=xx+1
endwhile
  yy=yy+1
endwhile

I hope this helps... please let me know if you have any questions on the 
above GrADS pseudo-code...

Chuck


Jeffrey Duda wrote:
> Unless you're using OpenGrads, which might allow for defining a variable 
> by grid point, you probably can't compute LFC height in any direct way.  
> If you were somehow able to compute a vertical parcel path at each 
> gridpoint, however, you could then use the fndlvl command 
> (http://www.iges.org/grads/gadoc/gradfuncfndlvl.html) to find the first 
> vertical level at which the parcel temperature exceeds the environmental 
> temperature.  It's the first part that I can't think of a way to do.
> 
> If you are dealing with WRF output and you have the netCDF files, you 
> can run ARWpost or WPP on them to get LFC calculated. Otherwise you 
> might try using some other graphics software.  Sorry I can't be of more 
> help.
> 
> Jeff Duda
> 
> On Wed, Apr 20, 2011 at 9:39 AM, Meredith Croke <mcroke at airdat.com 
> <mailto:mcroke at airdat.com>> wrote:
> 
>     Hi Everyone,
> 
>     I’m looking to plot a contour plot of LFC height, similar to the
>     graphic on the SPC Mesoscale Analysis page, my control file does not
>     output LFC directly,  is there anyway I can calculate this in grads?
> 
>      
> 
>     Thanks for your help.
> 
>      
> 
>     Meredith
> 
> 
>     _______________________________________________
>     gradsusr mailing list
>     gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
> 
> 
> -- 
> Jeff Duda
> Iowa State University
> Meteorology Graduate Student
> 3134 Agronomy Hall
> www.meteor.iastate.edu/~jdduda <http://www.meteor.iastate.edu/~jdduda>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

-- 

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
  Charles Seman                                Charles.Seman at noaa.gov
  U.S. Department of Commerce / NOAA / OAR
  Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
  201 Forrestal Road                              fax: (609) 987-5063
  Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not reflect any
official or unofficial position of the United States Federal Government,
the United States Department of Commerce, or NOAA."


More information about the gradsusr mailing list