UPP (develop)
Loading...
Searching...
No Matches
ETAMP_Q2F.f
1 SUBROUTINE etamp_q2f(QRIMEF,QQI,QQR,QQW,CWM,F_RAIN,F_ICE,F_RIMEF,T)
2 ! This subroutine is to be used with the WRF "advected Ferrier
3 ! scheme" to calculate the F_ICE, F_RIMEF and F_RAIN arrays from
4 ! the QQW, QQR, QQI and the input array QRIMEF.
5 use ctlblk_mod, only: lm,im,jsta,jend,jsta_2l,jend_2u,&
6 ista,iend,ista_2l,iend_2u
7 implicit none
8
9 real, intent(in),dimension(ista_2l:iend_2u,jsta_2l:jend_2u,lm) :: &
10 qrimef,qqw,qqr,qqi, t
11
12 real, intent(out),dimension(ista_2l:iend_2u,jsta_2l:jend_2u,lm) :: &
13 f_rain,f_ice,f_rimef,cwm
14
15 integer :: i,j,l
16 real :: qt
17
18 ! NOTE: these parameters must match the WRF Ferrier scheme.
19 ! They're wrong elsewhere in the post:
20 real, parameter :: t_ice=-40., t0c=273.15, t_icek=233.15
21 real, parameter :: epsq=1.e-12
22
23 bigl: do l=1,lm
24 bigj: do j=jsta,jend
25 bigi: do i=ista,iend
26 qt=qqw(i,j,l)+qqr(i,j,l)+qqi(i,j,l)
27 cwm(i,j,l)=qt
28 if(qqi(i,j,l)<=epsq) then
29 f_ice(i,j,l)=0.
30 f_rimef(i,j,l)=1.
31 if(t(i,j,l)<t_icek) f_ice(i,j,l)=1.
32 else
33 f_ice(i,j,l)=max(0.,min(1.,qqi(i,j,l)/qt))
34 f_rimef(i,j,l)=max(1.,min(100.,qrimef(i,j,l)/qqi(i,j,l)))
35 endif
36 if(qqr(i,j,l) <= epsq) then
37 f_rain(i,j,l)=0.
38 else
39 f_rain(i,j,l)=max(0.,min(1.,qqr(i,j,l)/(qqr(i,j,l)+qqw(i,j,l))))
40 endif
41 enddo bigi
42 enddo bigj
43 enddo bigl
44 END SUBROUTINE etamp_q2f