UPP  001
 All Data Structures Files Functions Pages
NGMSLP.f
Go to the documentation of this file.
1 
2 !
89  SUBROUTINE ngmslp
90 
91 !
92  use vrbls3d, only: zint, pint, t, q, zmid
93  use vrbls2d, only: slp, fis, z1000
94  use masks, only: lmh
95  use params_mod, only: rd, gi, g, h1, d608, gamma, d50, p1000
96  use ctlblk_mod, only: jsta, jend, im, jm, spval
97 !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
98  implicit none
99 !
100  real,PARAMETER :: zsl=0.0
101  real,PARAMETER :: taucr=rd*gi*290.66,const=0.005*g/rd
102  real,PARAMETER :: gord=g/rd,dp=60.e2
103 !
104 ! DECLARE VARIABLES
105 !
106  integer i,j,llmh
107  real zsfc,psfc,tvrt,tau,tvrsfc,tausfc,tvrsl,tausl,tauavg, &
108  alpavg,pavg,rhoavg,rrhog
109 !
110 !**********************************************************************
111 ! START NGMSLP HERE.
112 !
113 ! LOOP OVER HORIZONTAL GRID.
114 !
115 !!$omp parallel do
116 !!$omp& private(llmh,pavg,psfc,qavg,rhoavg,rrhog,
117 !!$omp& tau,tauavg,tausfc,tausl,tavg,tvrbar,tvrsfc,tvrsl,
118 !!$omp& tvrt,tvrtal,zbar,zl,zsfc)
119  DO j=jsta,jend
120  DO i=1,im
121  llmh = nint(lmh(i,j))
122 
123  if( pint(i,j,llmh+1)<spval) then
124 
125  zsfc = zint(i,j,llmh+1)
126  psfc = pint(i,j,llmh+1)
127  slp(i,j) = psfc
128 !
129 ! COMPUTE LAYER TAU (VIRTUAL TEMP*RD/G).
130  tvrt = t(i,j,llmh)*(h1+d608*q(i,j,llmh))
131  tau = tvrt*rd*gi
132 !
133 ! COMPUTE TAU AT THE GROUND (Z=ZSFC) AND SEA LEVEL (Z=0)
134 ! ASSUMING A CONSTANT LAPSE RATE OF GAMMA=6.5DEG/KM.
135 ! TVRSFC = TVRT + (ZSFC- ZSL)*GAMMA
136  tvrsfc = tvrt + (zmid(i,j,llmh) - zsfc)*gamma ! Chuang
137  tausfc = tvrsfc*rd*gi
138 ! TVRSL = TVRT + (ZSFC- ZSL)*GAMMA
139  tvrsl = tvrt + (zmid(i,j,llmh) - zsl)*gamma
140  tausl = tvrsl*rd*gi
141 !
142 ! IF NEED BE APPLY SHEULL CORRECTION.
143  IF ((tausl>taucr).AND.(tausfc<=taucr)) THEN
144  tausl=taucr
145  ELSEIF ((tausl>taucr).AND.(tausfc>taucr)) THEN
146  tausl = taucr-const*(tausfc-taucr)**2
147  ENDIF
148 !
149 ! COMPUTE MEAN TAU.
150  tauavg = d50*(tausl+tausfc)
151 !
152 ! COMPUTE SEA LEVEL PRESSURE.
153  IF (abs(fis(i,j))>1.0)slp(i,j) = psfc*exp(zsfc/tauavg)
154 !
155 ! COMPUTE 1000MB HEIGHTS.
156  alpavg = d50*(alog(psfc)+alog(slp(i,j)))
157  pavg = exp(alpavg)
158  rhoavg = pavg*gi/tauavg
159  rrhog = h1/(rhoavg*g)
160  z1000(i,j) = (slp(i,j)-p1000)*rrhog
161 
162  else
163  slp(i,j) = spval
164  z1000(i,j) = spval
165  endif
166 
167 !
168 ! MOVE TO NEXT HORIZONTAL GRIDPOINT.
169  ENDDO
170  ENDDO
171 !
172 !
173 ! END OF ROUTINE.
174 !
175 
176  RETURN
177  END
Definition: MASKS_mod.f:1