Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 65 additions & 29 deletions physics/module_mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1908,12 +1908,12 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &

DOUBLE PRECISION, PARAMETER:: zeroD0 = 0.0d0
REAL, PARAMETER :: decfl = 8.0
REAL :: dtcfl,rainsfc
REAL :: dtcfl,rainsfc,graulsfc
Comment thread
climbfuji marked this conversation as resolved.
INTEGER :: niter

REAL, DIMENSION(kts:kte):: temp, pres, qv
REAL, DIMENSION(kts:kte):: rc, ri, rr, rs, rg, ni, nr, nc, nwfa, nifa
REAL, DIMENSION(kts:kte):: rr_tmp,nr_tmp
REAL, DIMENSION(kts:kte):: rr_tmp, nr_tmp, rg_tmp
REAL, DIMENSION(kts:kte):: rho, rhof, rhof2
REAL, DIMENSION(kts:kte):: qvs, qvsi, delQvs
REAL, DIMENSION(kts:kte):: satw, sati, ssatw, ssati
Expand All @@ -1927,7 +1927,7 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &

REAL, DIMENSION(kts:kte):: sed_r, sed_s, sed_g, sed_i, sed_n,sed_c

REAL:: rgvm, delta_tp, orho, lfus2
REAL:: rgvm, delta_tp, orho, lfus2, orhodt
REAL, DIMENSION(5):: onstep
DOUBLE PRECISION:: N0_exp, N0_min, lam_exp, lamc, lamr, lamg
DOUBLE PRECISION:: lami, ilami, ilamc
Expand Down Expand Up @@ -3937,11 +3937,12 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &
do n = 1, niter
rr_tmp(:) = rr(:)
nr_tmp(:) = nr(:)
call nislfv_rain_ppm(kte,dzq,vtrk,rr,rainsfc,dtcfl,R1)
call nislfv_rain_ppm(kte,dzq,vtnrk,nr,vtr,dtcfl,R2)
call nislfv_precip_ppm(kte,dzq,vtrk,rr,rainsfc,dtcfl,R1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you changed "rain" to "precip" I really don't understand "nislfv" nor "ppm" and would appreciate something better. These are jumbled letters to me and others. Got anything else?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nislfv and ppm are described in the description section of the routine.
nislfv= non-iteration semi-Lagrangain forward advection
ppm = 2nd order interpolation with monotonic piecewise parabolic method

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know it's documented somehow, but I see it as an improvement to use something like subroutine semi_lagrange_precip (or anything to give a clue by name in the calling routine. It's great to have the more full descript inside the routine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you suggest using? Any idea?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Songyou184 What do you think about the names?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you suggest using? Any idea?

I did give you my suggested name of subroutine in my comment. It is: semi_lagrange_precip or perhaps better is semi_lagrange_sedim

call nislfv_precip_ppm(kte,dzq,vtnrk,nr,vtr,dtcfl,R2)
do k = kts, kte
qrten(k) = qrten(k) + (rr(k) - rr_tmp(k))/rho(k)/dt
nrten(k) = nrten(k) + (nr(k) - nr_tmp(k))/rho(k)/dt
orhodt = 1./(rho(k)*dt)
qrten(k) = qrten(k) + (rr(k) - rr_tmp(k)) * orhodt
nrten(k) = nrten(k) + (nr(k) - nr_tmp(k)) * orhodt
enddo
pptrain = pptrain + rainsfc

Expand Down Expand Up @@ -4054,28 +4055,63 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &

if (ANY(L_qg .eqv. .true.)) then
nstep = NINT(1./onstep(4))
do n = 1, nstep
do k = kte, kts, -1
sed_g(k) = vtgk(k)*rg(k)
enddo
k = kte
odzq = 1./dzq(k)
orho = 1./rho(k)
qgten(k) = qgten(k) - sed_g(k)*odzq*onstep(4)*orho
rg(k) = MAX(R1, rg(k) - sed_g(k)*odzq*DT*onstep(4))
do k = ksed1(4), kts, -1
odzq = 1./dzq(k)
orho = 1./rho(k)
qgten(k) = qgten(k) + (sed_g(k+1)-sed_g(k)) &
*odzq*onstep(4)*orho
rg(k) = MAX(R1, rg(k) + (sed_g(k+1)-sed_g(k)) &
if(.not. sedi_semi) then
do n = 1, nstep
do k = kte, kts, -1
sed_g(k) = vtgk(k)*rg(k)
enddo
k = kte
odzq = 1./dzq(k)
orho = 1./rho(k)
qgten(k) = qgten(k) - sed_g(k)*odzq*onstep(4)*orho
rg(k) = MAX(R1, rg(k) - sed_g(k)*odzq*DT*onstep(4))
do k = ksed1(4), kts, -1
odzq = 1./dzq(k)
orho = 1./rho(k)
qgten(k) = qgten(k) + (sed_g(k+1)-sed_g(k)) &
*odzq*onstep(4)*orho
rg(k) = MAX(R1, rg(k) + (sed_g(k+1)-sed_g(k)) &
*odzq*DT*onstep(4))
enddo
enddo

if (rg(kts).gt.R1*10.) &
pptgraul = pptgraul + sed_g(kts)*DT*onstep(4)
enddo
endif
if (rg(kts).gt.R1*10.) &
pptgraul = pptgraul + sed_g(kts)*DT*onstep(4)
enddo
else ! if(.not. sedi_semi) then
niter = 1
dtcfl = dt
if(SEDI_SEMI_DECFL) then
niter = int(nstep/decfl) + 1
dtcfl = dt/niter
endif

do n = 1, niter
rg_tmp(:) = rg(:)
call nislfv_precip_ppm(kte,dzq,vtgk,rg,graulsfc,dtcfl,R1)
do k = kts, kte
orhodt = 1./(rho(k)*dt)
qgten(k) = qgten(k) + (rg(k) - rg_tmp(k))*orhodt
enddo
pptgraul = pptgraul + graulsfc
if(sedi_semi_update) then
do k = kte+1, kts, -1
vtgk(k) = 0.
enddo
do k = kte, kts, -1
vtg = 0.
if (rg(k).gt. R1) then
vtg = rhof(k)*av_g*cgg(6)*ogg3 * ilamg(k)**bv_g
if (temp(k).gt. T_0) then
vtgk(k) = MAX(vtg, vtrk(k))
else
vtgk(k) = vtg
endif
endif
enddo
endif
enddo
endif ! if(.not. sedi_semi) then
endif

!+---+-----------------------------------------------------------------+
!> - Instantly melt any cloud ice into cloud water if above 0C and
Expand Down Expand Up @@ -6102,7 +6138,7 @@ subroutine calc_refl10cm (qv1d, qc1d, qr1d, nr1d, qs1d, qg1d, &
end subroutine calc_refl10cm
!
!-------------------------------------------------------------------
SUBROUTINE nislfv_rain_ppm(km,dzl,wwl,rql,precip,dt,R1)
SUBROUTINE nislfv_precip_ppm(km,dzl,wwl,rql,precip,dt,R1)
!-------------------------------------------------------------------
!
! for non-iteration semi-Lagrangain forward advection for cloud
Expand Down Expand Up @@ -6320,7 +6356,7 @@ SUBROUTINE nislfv_rain_ppm(km,dzl,wwl,rql,precip,dt,R1)
!
! ----------------------------------
!
END SUBROUTINE nislfv_rain_ppm
END SUBROUTINE nislfv_precip_ppm
!+---+-----------------------------------------------------------------+
!+---+-----------------------------------------------------------------+
!+---+-----------------------------------------------------------------+
Expand Down