1!>>>c   This is the old ZMET, replace with new ZMET that uses AERMOD profiles
2!>>>c----------------------------------------------------------------------
3!>>>      subroutine zmet(z,ua,ra,ta,dudz,dpdz)
4!>>>c----------------------------------------------------------------------
5!>>>c
6!>>>c --- PRIME      Version:  1.0     Level:  970812                  ZMET
7!>>>c                X.(J.) Zhang, J. Scire,  EARTH TECH
8!>>>c
9!>>>c --- PURPOSE:  Obtain ambient met parameters at height z
10!>>>c               by interpolation of gridded values
11!>>>c
12!>>>c --- INPUTS:
13!>>>c          Z - real    - Height (m)
14!>>>c
15!>>>c     Common block /AMBIENT/ variables:
16!>>>c           NZA,UAMB(mxnz),RAMB(mxnz),TAMB(mxnz),ZFACEA(mxnzp1),
17!>>>c           ZGPTA(mxnz),TAMB0,RAMB0,ADIA,PTGRAD0
18!>>>c     Parameters:
19!>>>c           MXNZ, MXNZP1
20!>>>c
21!>>>c --- OUTPUT:
22!>>>c         UA - real    - Current ambient wind speed (m/s)
23!>>>c         RA - real    - Current ambient air density (kg/m**3)
24!>>>c         TA - real    - Current ambient air temperature (deg. K)
25!>>>c       DUDZ - real    - Current wind shear (1/s)
26!>>>c       DPDZ - real    - Current ambient potential temperature gradient
27!>>>c                        (deg. K/m)
28!>>>c
29!>>>c --- ZMET called by:  NUMRISE
30!>>>c --- ZMET calls:      none
31!>>>c----------------------------------------------------------------------
32!>>>c     Defined at grid center: uamb,tamb,ramb
33!>>>c     Defined at zface:       dedz
34!>>>c----------------------------------------------------------------------
35!>>>c --- Include files
36!>>>      include 'params.pri'
37!>>>      include 'ambient.pri'
38!>>>
39!>>>c --- Interpolate variables defined at grid cell center
40!>>>      if(z.lt.zgpta(1))then
41!>>>
42!>>>c ---    Height is below first grid point
43!>>>         zfact=(zgpta(1)-z)/zgpta(1)
44!>>>         ta=tamb(1)-(tamb(1)-tamb0)*zfact
45!>>>         ra=ramb(1)-(ramb(1)-ramb0)*zfact
46!>>>c ---    Wind speed at z=0 is assumed to be zero
47!>>>         ua=uamb(1)*(1.0-zfact)
48!>>>         dudz=uamb(1)/zgpta(1)
49!>>>         dpdz=adia+(tamb(1)-tamb0)/zgpta(1)
50!>>>         dpdz=amax1(dpdz,ptgrad0)
51!>>>
52!>>>      else if(z.lt.zgpta(nza))then
53!>>>
54!>>>c ---    Find the layer containing height, Z
55!>>>         do i=2,nza
56!>>>            if(z.le.zgpta(i))then
57!>>>               im1=i-1
58!>>>               delz=zgpta(i)-zgpta(im1)
59!>>>               zfact=(zgpta(i)-z)/delz
60!>>>               ta=tamb(i)-(tamb(i)-tamb(im1))*zfact
61!>>>               ra=ramb(i)-(ramb(i)-ramb(im1))*zfact
62!>>>               ua=uamb(i)-(uamb(i)-uamb(im1))*zfact
63!>>>c ---          Compute wind speed gradient & pot. temp. gradient
64!>>>               dudz=(uamb(i)-uamb(im1))/delz
65!>>>               dpdz=adia+(tamb(i)-tamb(im1))/delz
66!>>>               dpdz=amax1(dpdz,ptgrad0)
67!>>>               go to 101
68!>>>            endif
69!>>>         enddo
70!>>>
71!>>>      else
72!>>>
73!>>>c ---    Height is at or above the top grid point -- persist values
74!>>>c ---    at the top grid cell
75!>>>         ta=tamb(nza)
76!>>>         ra=ramb(nza)
77!>>>         ua=uamb(nza)
78!>>>c ---    Hold wind speed and temperature constant above top layer at
79!>>>c ---    values at top grid point
80!>>>         dudz=0.0
81!>>>         dpdz=adia
82!>>>         dpdz=amax1(dpdz,ptgrad0)
83!>>>      endif
84!>>>
85!>>>101   continue
86!>>>
87!>>>      return
88!>>>      end
89!----------------------------------------------------------------------
90      SUBROUTINE ZMET(Z,UA,RA,TAP,DUDZ,DPDZ)
91!----------------------------------------------------------------------
92!
93! --- PRIME      Version:  1.0     Level:  970812                  ZMET
94!                X.(J.) Zhang, J. Scire,  EARTH TECH
95!
96! --- PURPOSE:  Obtain ambient met parameters at height z
97!               by interpolation of gridded values
98!
99! --- MODIFIED: For use with the AERMOD model.  Uses AERMOD meteorological
100!               profiles.
101!               R.W. Brode, PES, Inc. - 07/05/01
102!
103! --- INPUTS:
104!          Z - real    - Height (m)
105!
106!     Common block /AMBIENT/ variables:
107!           NZA,UAMB(mxnz),RAMB(mxnz),TAMB(mxnz),ZFACEA(mxnzp1),
108!           ZGPTA(mxnz),TAMB0,RAMB0,ADIA,PTGRAD0
109!     Parameters:
110!           MXNZ, MXNZP1
111!
112! --- OUTPUT:
113!         UA - real    - Current ambient wind speed (m/s)
114!         RA - real    - Current ambient air density (kg/m**3)
115!         TA - real    - Current ambient air temperature (deg. K)
116!       DUDZ - real    - Current wind shear (1/s)
117!       DPDZ - real    - Current ambient potential temperature gradient
118!                        (deg. K/m)
119!
120! --- ZMET called by:  NUMRISE
121! --- ZMET calls:      none
122!----------------------------------------------------------------------
123!     Defined at grid center: uamb,tamb,ramb
124!     Defined at zface:       dedz
125!----------------------------------------------------------------------
126! --- Include files
127      USE MAIN1
128      INCLUDE 'params.pri'
129      INCLUDE 'ambient.pri'
130
131!---- Compute the parameter values at height Z for PRIME
132!---- Locate index below height Z
133
134      CALL LOCATE(GRIDHT,1,MXGLVL,Z,NDXBLZ)                             !6443782
135
136      IF ( NDXBLZ.GE.1 ) THEN
137
138!----    Sigma_V
139         CALL GINTRP(GRIDHT(NDXBLZ),GRIDSV(NDXBLZ),GRIDHT(NDXBLZ+1),    &
140     &               GRIDSV(NDXBLZ+1),Z,SVATZ)
141
142!----    Sigma_W
143         CALL GINTRP(GRIDHT(NDXBLZ),GRIDSW(NDXBLZ),GRIDHT(NDXBLZ+1),    &
144     &               GRIDSW(NDXBLZ+1),Z,SWATZ)
145
146!----    Wind speed
147         CALL GINTRP(GRIDHT(NDXBLZ),GRIDWS(NDXBLZ),GRIDHT(NDXBLZ+1),    &
148     &               GRIDWS(NDXBLZ+1),Z,UATZ)
149
150!----    Potential temperature gradient
151         CALL GINTRP(GRIDHT(NDXBLZ),GRIDTG(NDXBLZ),GRIDHT(NDXBLZ+1),    &
152     &               GRIDTG(NDXBLZ+1),Z,DPDZ)
153
154!----    Potential temperature
155         CALL GINTRP(GRIDHT(NDXBLZ),GRIDPT(NDXBLZ),GRIDHT(NDXBLZ+1),    &
156     &               GRIDPT(NDXBLZ+1),Z,PTZ)
157
158!----    Ambient air density
159         CALL GINTRP(GRIDHT(NDXBLZ),GRIDRHO(NDXBLZ),GRIDHT(NDXBLZ+1),   &
160     &               GRIDRHO(NDXBLZ+1),Z,RA)
161
162!----    Compute wind speed gradient
163         DELZ = (GRIDHT(NDXBLZ+1)-GRIDHT(NDXBLZ))
164         DUDZ = (GRIDWS(NDXBLZ+1)-GRIDWS(NDXBLZ))/DELZ
165
166      ELSE
167!        Use GRID value for lowest level
168         SVATZ = GRIDSV(1)                                              !      0
169         SWATZ = GRIDSW(1)
170         UATZ = GRIDWS(1)
171         DPDZ = GRIDTG(1)
172         PTZ = GRIDPT(1)
173         RA = GRIDRHO(1)
174         DUDZ = GRIDWS(1)/GRIDHT(1)
175      ENDIF
176
177!---- Calculate ambient temperature from potential temperature profile
178      TAP = PTZ - ADIA*(Z+ZBASE)                                        !6443782
179
180!RWB  Modify the treatment of low wind/low turbulence cases per 7/31/96
181!RWB  write-up by Steve Perry.  R. Brode, PES, 8/15/96
182      SWATZ = AMAX1(SWATZ,SWMIN)
183      SVATZ = AMAX1(SVATZ,SVMIN,0.05*UATZ)
184      UA = SQRT(UATZ*UATZ+2.*SVATZ*SVATZ)
185
186      CONTINUE
187      END


HyperKWIC - Version 1.00DD executed at 20:00 on 1 Mar 2018 | Personal or Academic or Evaluation User | Free for Non-Commercial, Non-Government Use