UPP  001
 All Data Structures Files Functions Pages
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  use gridspec_mod, only: maptype, dxval
15  use vrbls3d, only: pmid, t, pint
16  use vrbls2d, only: pslp, fis
17  use masks, only: lmh
18  use params_mod, only: rog, p1000, capa, erad, pi ,gi
19 
20  implicit none
21 !
22  include "mpif.h"
23 !
24  REAL tpres(im,jsta_2l:jend_2u,lsm)
25 
26  real lapses, expo,expinv,tsfcnew
27 
28  REAL,dimension(im, jsta_2l:jend_2u) :: t700
29  real,dimension(im,2) :: sdummy
30  REAL,dimension(im,jm) :: grid1, th700
31  INTEGER nsmooth
32  integer l, j, i, k, ii, jj
33  real dxm
34 !-----------------------------------------------------------------------
35 !***
36  lapses = 0.0065
37 ! deg K / meter
38  expo = rog*lapses
39  expinv = 1./expo
40 
41  DO l=1,lsm
42 
43 !$omp parallel do private(i,j)
44  DO j=jsta,jend
45  DO i=1,im
46  if(spl(l) == 70000.)THEN
47  if(tpres(i,j,l) <spval)THEN
48  t700(i,j) = tpres(i,j,l)
49  th700(i,j) = t700(i,j)*(p1000/70000.)**capa
50  else
51  t700(i,j) = spval
52  th700(i,j) = spval
53  endif
54  endif
55  ENDDO
56  ENDDO
57 
58  ENDDO
59 
60 
61 ! smooth 700 mb temperature first
62  if(maptype==6) then
63  if(grib=='grib2') then
64  dxm=(dxval / 360.)*(erad*2.*pi)/1.d6 ! [mm]
65  endif
66  else
67  dxm = dxval
68  endif
69  if(grib == 'grib2')then
70  dxm = dxm/1000.0 ! [m]
71  endif
72 
73  IF (smflag) THEN
74  nsmooth=nint(10.*(13500./dxm))
75  call allgetherv(th700)
76  do k = 1,nsmooth
77  CALL smooth(th700,sdummy,im,jm,0.5)
78  end do
79  ENDIF
80  ii=im/2
81  jj=(jsta+jend)/2
82 ! if(i==ii.and.j==jj) &
83 ! print*,'Debug TH700(i,j), i,j',TH700(i,j), i,j
84 
85  DO j=jsta,jend
86  DO i=1,im
87  if(t700(i,j) <spval) then
88  t700(i,j) = th700(i,j)*(70000./p1000)**capa
89  IF (t700(i,j)>100.) THEN
90  tsfcnew = t700(i,j)*(pmid(i,j,lm)/70000.)**expo
91 ! effective sfc T based on 700 mb temp
92  ELSE
93  tsfcnew = t(i,j,lm)
94  ENDIF
95  pslp(i,j) = pint(i,j,nint(lmh(i,j))+1)* &
96  ((tsfcnew+lapses*fis(i,j)*gi)/tsfcnew)**expinv
97 ! print*,'PSLP(I,J),I,J',PSLP(I,J),I,J
98  grid1(i,j)=pslp(i,j)
99  else
100  pslp(i,j) = spval
101  grid1(i,j) = spval
102  endif
103 
104  ENDDO
105  ENDDO
106 
107  IF (smflag) THEN
108 ! - in WRF number of passes depends on the resolution: nsmooth=int(15*(13/dxval))
109  nsmooth=nint(15.*(13500./dxm))
110  call allgetherv(grid1)
111  do k=1,nsmooth
112  CALL smooth(grid1,sdummy,im,jm,0.5)
113  end do
114  DO j=jsta,jend
115  DO i=1,im
116  pslp(i,j)=grid1(i,j)
117  ENDDO
118  ENDDO
119  ENDIF
120 !
121 
122  RETURN
123  END
Definition: MASKS_mod.f:1