UPP (develop)
Loading...
Searching...
No Matches
MAPSSLP.f
1!
2 SUBROUTINE mapsslp(TPRES)
3!$$$ SUBPROGRAM DOCUMENTATION BLOCK
4! . . .
5! INPUT ARGUMENT LIST:
6! TPRES - TEMPERATURE at pressure levels
7!
8! OUTPUT ARGUMENT LIST:
9! PSLP - THE FINAL REDUCED SEA LEVEL PRESSURE ARRAY
10!
11!-----------------------------------------------------------------------
12 use ctlblk_mod, only: jsta, jend, spl, smflag, lm, im, jsta_2l, jend_2u, &
13 lsm, jm, grib, spval, &
14 ista, iend, ista_2l, iend_2u
15 use gridspec_mod, only: maptype, dxval
16 use vrbls3d, only: pmid, t, pint
17 use vrbls2d, only: pslp, fis
18 use masks, only: lmh
19 use params_mod, only: rog, p1000, capa, erad, pi ,gi
20
21 implicit none
22!
23 include "mpif.h"
24!
25 REAL TPRES(ISTA_2L:IEND_2U,JSTA_2L:JEND_2U,LSM)
26
27 real LAPSES, EXPo,EXPINV,TSFCNEW
28
29 REAL,dimension(ista_2l:iend_2u, jsta_2l:jend_2u) :: T700
30 real,dimension(im,2) :: sdummy
31 REAL,dimension(im,jm) :: GRID1, TH700
32 INTEGER NSMOOTH
33 integer l, j, i, k, ii, jj
34 real dxm
35!-----------------------------------------------------------------------
36!***
37 lapses = 0.0065
38! deg K / meter
39 expo = rog*lapses
40 expinv = 1./expo
41
42 DO l=1,lsm
43
44!$omp parallel do private(i,j)
45 DO j=jsta,jend
46 DO i=ista,iend
47 if(spl(l) == 70000.)THEN
48 if(tpres(i,j,l) <spval)THEN
49 t700(i,j) = tpres(i,j,l)
50 th700(i,j) = t700(i,j)*(p1000/70000.)**capa
51 else
52 t700(i,j) = spval
53 th700(i,j) = spval
54 endif
55 endif
56 ENDDO
57 ENDDO
58
59 ENDDO
60
61
62! smooth 700 mb temperature first
63 if(maptype==6) then
64 if(grib=='grib2') then
65 dxm=(dxval / 360.)*(erad*2.*pi)/1.d6 ! [mm]
66 endif
67 else
68 dxm = dxval
69 endif
70 if(grib == 'grib2')then
71 dxm = dxm/1000.0 ! [m]
72 endif
73
74 IF (smflag) THEN
75 nsmooth=nint(10.*(13500./dxm))
76 call allgetherv(th700)
77 do k = 1,nsmooth
78 CALL smooth(th700,sdummy,im,jm,0.5)
79 end do
80 ENDIF
81 ii=(ista+iend)/2
82 jj=(jsta+jend)/2
83! if(i==ii.and.j==jj) &
84! print*,'Debug TH700(i,j), i,j',TH700(i,j), i,j
85
86 DO j=jsta,jend
87 DO i=ista,iend
88 if(t700(i,j) <spval) then
89 t700(i,j) = th700(i,j)*(70000./p1000)**capa
90 IF (t700(i,j)>100.) THEN
91 tsfcnew = t700(i,j)*(pmid(i,j,lm)/70000.)**expo
92! effective sfc T based on 700 mb temp
93 ELSE
94 tsfcnew = t(i,j,lm)
95 ENDIF
96 pslp(i,j) = pint(i,j,nint(lmh(i,j))+1)* &
97 ((tsfcnew+lapses*fis(i,j)*gi)/tsfcnew)**expinv
98! print*,'PSLP(I,J),I,J',PSLP(I,J),I,J
99 grid1(i,j)=pslp(i,j)
100 else
101 pslp(i,j) = spval
102 grid1(i,j) = spval
103 endif
104
105 ENDDO
106 ENDDO
107
108 IF (smflag) THEN
109! - in WRF number of passes depends on the resolution: nsmooth=int(15*(13/dxval))
110 nsmooth=nint(15.*(13500./dxm))
111 call allgetherv(grid1)
112 do k=1,nsmooth
113 CALL smooth(grid1,sdummy,im,jm,0.5)
114 end do
115 DO j=jsta,jend
116 DO i=ista,iend
117 pslp(i,j)=grid1(i,j)
118 ENDDO
119 ENDDO
120 ENDIF
121!
122
123 RETURN
124 END
subroutine smooth(field, hold, ix, iy, smth)
smooth() smooths a meteorological field using Shapiro smoother.
Definition SMOOTH.f:43