1 !WRF:MEDIATION_LAYER:UTIL
4 MODULE module_solvedebug_em
6 SUBROUTINE var_min_max( u,v,w,t,r, &
7 ids,ide, jds,jde, kds,kde, & ! domain dims
8 ims,ime, jms,jme, kms,kme, & ! memory dims
9 ips,ipe, jps,jpe, kps,kpe, & ! patch dims
10 its,ite, jts,jte, kts,kte )
14 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde
15 INTEGER, INTENT(IN ) :: ims,ime, jms,jme, kms,kme
16 INTEGER, INTENT(IN ) :: ips,ipe, jps,jpe, kps,kpe
17 INTEGER, INTENT(IN ) :: its,ite, jts,jte, kts,kte
19 REAL, DIMENSION( kms: , ims: , jms: ), &
20 INTENT(IN) :: u,v,w,t,r
22 INTEGER :: i, j, k, istag, jstag, imax, imin, jmax, jmin, &
25 REAL :: vmax, vmin, vavg
40 if(u(k,i,j) .gt. vmax) then
47 if(u(k,i,j) .lt. vmin) then
53 vavg = vavg + abs(u(k,i,j))
57 vavg = vavg/float((ipe-ips)*(jpe-jps-1)*(kpe-kps-1))
58 write(6,*) ' ru min,max,avg ',vmin,vmax,vavg
59 write(6,*) kmax, imax, jmax, kmin, imin, jmin
75 if(v(k,i,j) .gt. vmax) then
81 if(v(k,i,j) .lt. vmin) then
87 vavg = vavg + abs(v(k,i,j))
91 vavg = vavg/float((ipe-ips-1)*(jpe-jps)*(kpe-kps-1))
92 write(6,*) ' rv min,max,avg ',vmin,vmax,vavg
93 write(6,*) kmax, imax, jmax, kmin, imin, jmin
110 if(w(k,i,j) .gt. vmax) then
116 if(w(k,i,j) .lt. vmin) then
122 vavg = vavg + abs(w(k,i,j))
126 vavg = vavg/float((ipe-ips-1)*(jpe-jps-1)*(kpe-kps))
127 write(6,*) ' rom min,max,avg ',vmin,vmax,vavg
128 write(6,*) kmax, imax, jmax, kmin, imin, jmin
145 if(t(k,i,j) .gt. vmax) then
151 if(t(k,i,j) .lt. vmin) then
157 vavg = vavg + abs(t(k,i,j))
161 vavg = vavg/float((ipe-ips-1)*(jpe-jps-1)*(kpe-kps-1))
162 write(6,*) ' rtp min,max,avg ',vmin,vmax,vavg
163 write(6,*) kmax, imax, jmax, kmin, imin, jmin
180 if(r(k,i,j) .gt. vmax) then
186 if(r(k,i,j) .lt. vmin) then
192 vavg = vavg + abs(r(k,i,j))
196 vavg = vavg/float((ipe-ips-1)*(jpe-jps-1)*(kpe-kps-1))
197 write(6,*) ' rhop min,max,avg ',vmin,vmax,vavg
198 write(6,*) kmax, imax, jmax, kmin, imin, jmin
201 end subroutine var_min_max
203 SUBROUTINE var1_min_max( u, &
204 ids,ide, jds,jde, kds,kde, & ! domain dims
205 ims,ime, jms,jme, kms,kme, & ! memory dims
206 ips,ipe, jps,jpe, kps,kpe, & ! patch dims
207 its,ite, jts,jte, kts,kte )
211 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde
212 INTEGER, INTENT(IN ) :: ims,ime, jms,jme, kms,kme
213 INTEGER, INTENT(IN ) :: ips,ipe, jps,jpe, kps,kpe
214 INTEGER, INTENT(IN ) :: its,ite, jts,jte, kts,kte
216 REAL, DIMENSION(kms: , ims: , jms: ), &
219 INTEGER :: i, j, k, istag, jstag, imax, imin, jmax, jmin, &
222 REAL :: vmax, vmin, vavg
224 write(6,*) ' min, max, and avg stats '
239 if(u(k,i,j) .gt. vmax) then
246 if(u(k,i,j) .lt. vmin) then
252 vavg = vavg + abs(u(k,i,j))
256 vavg = vavg/float((ipe-ips)*(jpe-jps-1)*(kpe-kps-1))
257 write(6,*) ' ru max,min,avg ',vmax,vmin,vavg
258 write(6,*) kmax, imax, jmax, kmin, imin, jmin
261 end subroutine var1_min_max
266 SUBROUTINE var_print ( u, &
267 ims,ime, jms,jme, kms,kme, & ! memory dims
268 ips,ipe, jps,jpe, kps,kpe, & ! patch dims
273 INTEGER, INTENT(IN ) :: ims,ime, jms,jme, kms,kme
274 INTEGER, INTENT(IN ) :: ips,ipe, jps,jpe, kps,kpe
275 INTEGER, INTENT(IN ) :: level
277 REAL, DIMENSION(kms:kme, ims:ime, jms:jme), &
280 INTEGER :: i, j, k, istag, jstag, it, imax, imin, jmax, jmin, &
283 REAL :: vmax, vmin, vavg
285 write(6,*) ' level for print ',level
286 write(6,*) (u(level, ii, 1),ii=1,ipe)
287 write(6,*) (u(level, 1, jj),jj=1,jpe)
290 end subroutine var_print
292 SUBROUTINE symm_check ( f, &
293 ids,ide, jds,jde, kds,kde, & ! domain dims
294 ims,ime, jms,jme, kms,kme, & ! memory dims
295 ips,ipe, jps,jpe, kps,kpe, & ! patch dims
300 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde
301 INTEGER, INTENT(IN ) :: ims,ime, jms,jme, kms,kme
302 INTEGER, INTENT(IN ) :: ips,ipe, jps,jpe, kps,kpe
303 INTEGER, INTENT(IN ) :: level
305 REAL, DIMENSION(kms:kme, ims:ime, jms:jme), &
308 INTEGER :: i, j, k, istag, jstag, it, imax, imin, jmax, jmin, &
311 REAL :: vmax, vmin, vavg
313 write(6,*) ide,' = ide'
318 if(f(k,i,j).ne.f(k,ide-i,j))print *,' x asymmetry at kij ',k,i,j
319 if(f(k,i,j).ne.f(k,i,jde-j))print *,' y asymmetry at kij ',k,i,j
324 end subroutine symm_check
325 END MODULE module_solvedebug_em