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

Re: 20050117: Ice bulb temperature



Patrick,

In my previous message, I stated:

To create a grid program function, you would need to create a
DF library function to call your PR routine for every grid point
and add this routine to the call list of
$GEMPAK/source/gemlib/dg/dgdriv.f.

So, you would likely have a routine df_tmik() trhat is called by
dg_driv() for 'TMIK' as the parameter. The job of df_tmik would
be to call pr_tmik for every grid point. The df_ routines will
provide a framework for how to allocate a grid for the
computation, and store the name, level, time and coordinate of the grid.
A good reference would be to look at df_relh().

Steve Chiswell



On Tue, 2005-03-22 at 11:51, Patrick S. Market wrote:
> Steve:
> 
> This is working fine for plots with SF programs, but when I tried 
> to do a gridded file today, it did not work.  My TMIK was simply
> not recognized.
> 
> I get
> 
> GEMPAK-GDCNTR>r
>  [DG -7]  Input grid TMIK ^970410/0000F012 @900 %PRES cannot be found.
> 
> Any ideas on what else have I missed?
> 
> Pat
> 
> > 
> > Patrick,
> > 
> > This means that your dfrmik.o isn't in your gemlib.a file.
> > Assuming hhere that you have written that routine.
> > 
> > Go to $GEMPAK/source/gemlib/df
> > and type:
> > make
> > 
> > I'm assuming you have added the dftmik.o to the Makefile to
> > build. Assuming you have dftmik.o now, to make sure it is added
> > to your gemlib.a, type:
> > ar rv $GEMLIB/gemlib.a dftmik.o
> > 
> > 
> > Steve Chiswell
> > Unidata User Support
> > 
> > 
> > 
> > On Mon, 2005-01-24 at 07:55, Patrick S. Market wrote:
> > > Steve:
> > > 
> > > This hasn't quite worked.  Have I missed a step.  Make bombs out
> > > with the following:
> > > 
> > > ar: creating /asp/met/GEMPAK5.7.4/lib/sol_gcc/gdgrib.a
> > > ar: writing /asp/met/GEMPAK5.7.4/lib/sol_gcc/gdgrib.a
> > > rm -f *.o
> > > g77 -fno-second-underscore -I/asp/met/GEMPAK5.7.4/gempak/include 
> > > -I/asp/met/GEMPAK5.7.4/gempak/include/SunOS.gcc  gdgrib.f 
> > > /asp/met/GEMPAK5.7.4/lib/sol_gcc/gdgrib.a 
> > > /asp/met/GEMPAK5.7.4/lib/sol_gcc/gemlib.a  
> > > /asp/met/GEMPAK5.7.4/lib/sol_gcc/appl.a  
> > > /asp/met/GEMPAK5.7.4/lib/sol_gcc/syslib.a  
> > > /asp/met/GEMPAK5.7.4/lib/sol_gcc/cgemlib.a -lm -o gdgrib
> > > Undefined                       first referenced
> > >  symbol                             in file
> > > df_tmik_                            
> > > /asp/met/GEMPAK5.7.4/lib/sol_gcc/gemlib.a(dgdriv.o)
> > > ld: fatal: Symbol referencing errors. No output written to gdgrib
> > > collect2: ld returned 1 exit status
> > > *** Error code 1
> > > make: Fatal error: Command failed for target `gdgrib'
> > > Current working directory 
> > > /asp/met/GEMPAK5.7.4/gempak/source/contrib/hpc/gdgrib
> > > *** Error code 1
> > > make: Fatal error: Command failed for target `gdgrib'
> > > Current working directory 
> > > /asp/met/GEMPAK5.7.4/gempak/source/programs/na/gd2ndfd
> > > *** Error code 1
> > > make: Fatal error: Command failed for target `all'
> > > Current working directory /asp/met/GEMPAK5.7.4/gempak/source/programs/na
> > > *** Error code 1
> > > make: Fatal error: Command failed for target `all'
> > > Current working directory /asp/met/GEMPAK5.7.4/gempak/source/programs
> > > *** Error code 1
> > > make: Fatal error: Command failed for target `all'
> > > Current working directory /asp/met/GEMPAK5.7.4/gempak/source
> > > *** Error code 1
> > > make: Fatal error: Command failed for target `all'
> > > Current working directory /asp/met/GEMPAK5.7.4/gempak
> > > *** Error code 1
> > > make: Fatal error: Command failed for target `all'
> > > 
> > > 
> > > 
> > > 
> > > Pat
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > > 
> > > > Pat,
> > > > 
> > > > your PR_ routine would be used for SF and SN programs.
> > > > You need to add your function to $GEMTBL/parms/pcconv.tbl,
> > > > 
> > > > and
> > > > 
> > > > Add your PR_TMIB routine to the call list in 
> > > > $GEMPAK/sounrce/gemlib/pc/pcfunc.f.
> > > > 
> > > > To create a grid program function, you would need to create a
> > > > DF library function to call your PR routine for every grid point
> > > > and add this routine to the call list of 
> > > > $GEMPAK/source/gemlib/dg/dgdriv.f.
> > > > 
> > > > Steve Chiswell
> > > > 
> > > > On Mon, 17 Jan 2005, Patrick S. Market wrote:
> > > > 
> > > > > Steve:
> > > > >
> > > > > I am trying to include a subroutine into GEMPAK that I have modified.
> > > > >
> > > > > I have rewritten TMWB to calculate to include the latent heat of 
> > > > > fusion
> > > > > as well (see below).  The code compiles alright, but trying to use it
> > > > > turns up:
> > > > >
> > > > >       [DG -19]  Operator TMIB is not recognized.
> > > > >
> > > > > How do I get this new function into GEMPAK?
> > > > >
> > > > > Pat
> > > > >
> > > > >
> > > > >
> > > > > *******************************begin 
> > > > > include****************************
> > > > >         FUNCTION PR_TMIB  ( tmpk, rmix, pres )
> > > > > C************************************************************************
> > > > > C* PR_TMIB                                                            
> > > > >   *
> > > > > C*                                                                    
> > > > >   *
> > > > > C* This function computes ice bulb temperature from the temperature,  
> > > > >   *
> > > > > C* mixing ratio, and pressure.  The result is obtained by solving     
> > > > >   *
> > > > > C* for the temperature at which saturation occurs when the latent     
> > > > >   *
> > > > > C* heat required to vaporize/melt ice is provided by a cooling of     
> > > > >   *
> > > > > C* the air.  The equation representing the process is                 
> > > > >   *
> > > > > C*                                                                    
> > > > >   *
> > > > > C*      ( TMPK - TMWB ) * CP - ( Rsat (TMWB) - RMIX ) * LVAP = 0      
> > > > >   *
> > > > > C*                                                                    
> > > > >   *
> > > > > C* This implicit equation is solved by Newton's method, since the     
> > > > >   *
> > > > > C* saturation mixing ratio Rsat is a transcendental function of       
> > > > >   *
> > > > > C* TMWB.                                                              
> > > > >   *
> > > > > C*                                                                    
> > > > >   *
> > > > > C* The expressions for the heat of vaporization (LVAP) and saturation 
> > > > >   *
> > > > > C* vapor pressure are equations (2) and (10) from Bolton (MWR, 1980). 
> > > > >   *
> > > > > C*                                                                    
> > > > >   *
> > > > > C* REAL PR_TMIB  ( TMPK, RMIX, PRES )                                 
> > > > >   *
> > > > > C*                                                                    
> > > > >   *
> > > > > C* Input parameters:                                                  
> > > > >   *
> > > > > C*      TMPK            REAL            Temperature (K)               
> > > > >   *
> > > > > C*      RMIX            REAL            Mixing ratio (g/kg)           
> > > > >   *
> > > > > C*      PRES            REAL            Pressure (mb)                 
> > > > >   *
> > > > > C*                                                                    
> > > > >   *
> > > > > C* Output parameters:                                                 
> > > > >   *
> > > > > C*      PR_TMIB         REAL            Wet bulb temperature (K)      
> > > > >   *
> > > > > C**                                                                   
> > > > >   *
> > > > > C* Log:                                                               
> > > > >   *
> > > > > C* K. Brill/NMC          4/94                                         
> > > > >   *
> > > > > C* S. Jacobs/NMC         4/94   Changed input RMIX from kg/kg to g/kg 
> > > > >   *
> > > > > C* G. Krueger/EAI        4/96   Replaced C->K constant with PR_TMKC   
> > > > >   *
> > > > > C* T. Lee/GSC           11/96   Changed constant                      
> > > > >   *
> > > > > C* S. Jacobs/NCEP        8/97   Changed latent heat calc to use 
> > > > > PR_LHVP *
> > > > > C* T. Lee/GSC            8/97   Set TMWB <= temp; Simplify 
> > > > > computation  *
> > > > > C************************************************************************
> > > > >         INCLUDE         'GEMPRM.PRM'
> > > > > C*
> > > > >         PARAMETER       ( A = 6.112, B = 17.67, C = 243.5, EPSI = 
> > > > > .622 )
> > > > >         PARAMETER       ( G = B * C )
> > > > >         PARAMETER       ( ERRMAX = .001 )
> > > > > C*
> > > > >         LOGICAL         convrg
> > > > > C*
> > > > >         INCLUDE         'ERMISS.FNC'
> > > > > C------------------------------------------------------------------------
> > > > > C*      Check for missing values.
> > > > > C
> > > > >         IF  ( ERMISS ( tmpk ) .or. ERMISS ( rmix ) .or. ERMISS ( pres 
> > > > > )
> > > > >      +       .or.  ( pres .le. 0. ) )  THEN
> > > > >             PR_TMWB = RMISSD
> > > > >           ELSE
> > > > > C
> > > > > C*          Change temperature to degrees Celsius.
> > > > > C
> > > > >             tmp = PR_TMKC (tmpk)
> > > > > C
> > > > > C*          Compute the latent heat of sublimation.
> > > > > C
> > > > >             lvap = PR_LHVP ( tmp ) + (0.333 * 1.0E6)
> > > > > C
> > > > > C*          Compute the specific heat of moist air.
> > > > > C
> > > > >             rmix = rmix / 1000.
> > > > >             cp = 1005.7 * ( 1. + .887 * rmix )
> > > > > C
> > > > > C*          Compute L / cp.
> > > > > C
> > > > >             rlocp = lvap / cp
> > > > > C
> > > > > C*          Do Newton iteration.
> > > > > C
> > > > >             iter = 0
> > > > >             tib = tmp
> > > > >             convrg = .false.
> > > > >             DO WHILE ( iter .le. 50 .and. .not. convrg )
> > > > >                 iter = iter + 1
> > > > >                 bt = B * tib
> > > > >                 tpc = tib + C
> > > > >                 d = ( pres / A ) * EXP ( -bt / tpc )
> > > > >                 dm1 = d - 1.
> > > > >                 f = ( tmp - tib ) - rlocp * ( EPSI / dm1 - rmix )
> > > > >                 df = - G  / ( tpc * tpc )
> > > > >                 df = d * df * rlocp * EPSI / ( dm1 * dm1 ) - 1.
> > > > >                 cor = f / df
> > > > >                 tib = tib - cor
> > > > >                 IF ( ABS ( cor ) .le. ERRMAX ) convrg = .true.
> > > > >             END DO
> > > > > C*
> > > > >             IF ( .not. convrg ) THEN
> > > > >                 PR_TMWB = RMISSD
> > > > >               ELSE
> > > > >                 twk     = PR_TMCK (tib)
> > > > >                 IF  ( twk .gt. tmpk )  twk = tmpk
> > > > >                 PR_TMIB = twk
> > > > >             END IF
> > > > >         END IF
> > > > > C*
> > > > >         RETURN
> > > > >         END
> > > > >
> > > > > *******************************begin 
> > > > > include****************************
> > > > >
> > > > > --
> > > > > ========================================================================
> > > > > Dr. Patrick S. Market
> > > > > Dept. of Soil, Env. & Atmospheric Sci.
> > > > > University of Missouri-Columbia                 Phone:  (573) 882 - 
> > > > > 1496
> > > > > 331 ABNR Hall                                   Lab:    (573) 882 - 
> > > > > 4401
> > > > > Columbia, MO 65211 USA          E-mail: address@hidden
> > > > > ========================================================================
> > > > >
> > > > 
> > > 
> > 
>