Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TEMPO-v3.1.0
TEMPO-v3.1.1

## Thompson-Eidhammer Microphysics Parameterization for Operations

Expand Down
6 changes: 4 additions & 2 deletions src/module_mp_tempo_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ subroutine tempo_run(tempo_cfgs, dt, itimestep, &
real(wp), dimension(:), allocatable :: thten_swrad1d

integer :: i, j, k, nz
logical :: use_temperature
logical :: use_temperature, is_first_step

type(ty_tempo_main_diags) :: tempo_main_diags
type(ty_tempo_driver_diags), intent(inout) :: tempo_diags
Expand Down Expand Up @@ -394,6 +394,8 @@ subroutine tempo_run(tempo_cfgs, dt, itimestep, &
! error stop "tempo_run() --- requires either temperature or theta and Exner function"
endif

is_first_step = (itimestep == 1)

! tempo driver code
do j = jts, jte
do i = its, ite
Expand Down Expand Up @@ -437,7 +439,7 @@ subroutine tempo_run(tempo_cfgs, dt, itimestep, &
if (present(land_input)) land1d = land_input(i,j)

! main call to the 1d tempo microphysics
call tempo_main(tempo_cfgs=tempo_cfgs, &
call tempo_main(tempo_cfgs=tempo_cfgs, is_first_step=is_first_step, &
qv1d=qv1d, qc1d=qc1d, qi1d=qi1d, qr1d=qr1d, qs1d=qs1d, qg1d=qg1d, qb1d=qb1d, &
ni1d=ni1d, nr1d=nr1d, nc1d=nc1d, ng1d=ng1d, nwfa1d=nwfa1d, nifa1d=nifa1d, t1d=t1d, p1d=p1d, &
w1d=w1d, dz1d=dz1d, land1d=land1d, &
Expand Down
17 changes: 9 additions & 8 deletions src/module_mp_tempo_main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module module_mp_tempo_main

contains

subroutine tempo_main(tempo_cfgs, &
subroutine tempo_main(tempo_cfgs, is_first_step, &
qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, qb1d, ni1d, nr1d, nc1d, ng1d, &
nwfa1d, nifa1d, t1d, p1d, w1d, dz1d, land1d, &
qcfrac1d, qifrac1d, qc_bl1d, qcfrac_bl1d, &
Expand All @@ -85,6 +85,7 @@ subroutine tempo_main(tempo_cfgs, &
type(ty_tempo_cfgs), intent(in) :: tempo_cfgs
integer, intent(in) :: kts, kte, ii, jj
real(wp), intent(in) :: dt
logical, intent(in), optional :: is_first_step
real(wp), dimension(kts:kte), intent(inout) :: t1d !! 1D temperature \([K]\)
real(wp), dimension(kts:kte), intent(in) :: p1d !! 1D pressure \([Pa]\)
real(wp), dimension(kts:kte), intent(inout) :: qv1d !! 1D water vapor mixing ratio \([kg\; kg^{-1}]\)
Expand Down Expand Up @@ -148,11 +149,13 @@ subroutine tempo_main(tempo_cfgs, &

! local variables
real(wp) :: tempc, tc0, odt
logical :: do_micro, supersaturated
logical, save :: first_call_main = .true.
logical :: do_micro, supersaturated, local_first_step
integer :: k, nz

! --------------------------------------------------------------------------------------------
local_first_step = .false.
if (present(is_first_step)) local_first_step = is_first_step

do_micro = .false.
supersaturated = .false.
odt = 1._wp / dt
Expand Down Expand Up @@ -323,15 +326,15 @@ subroutine tempo_main(tempo_cfgs, &
enddo

if (present(nwfa1d)) then
if (first_call_main) then
if (local_first_step) then
if (sum(nwfa1d) < eps) call init_water_friendly_aerosols(dz1d, nwfa)
endif
else
call init_water_friendly_aerosols(dz1d, nwfa)
endif

if (present(nifa1d)) then
if (first_call_main) then
if (local_first_step) then
if (sum(nifa1d) < eps) call init_ice_friendly_aerosols(dz1d, nifa)
endif
else
Expand Down Expand Up @@ -381,7 +384,7 @@ subroutine tempo_main(tempo_cfgs, &
dt=dt, odt=odt)

! init ng and qb
if (first_call_main) then
if (local_first_step) then
if (present(ng1d) .and. present(qb1d)) then
if (sum(qg1d) > r1 .and. sum(ng1d) < eps .and. sum(qb1d) < eps) then
call graupel_init(rho, qg1d, ng1d, qb1d)
Expand Down Expand Up @@ -410,8 +413,6 @@ subroutine tempo_main(tempo_cfgs, &
satw, sati, ssatw, ssati, diffu, visco, vsc2, ocp, lvap, tcond, lvt2, &
supersaturated)

if (first_call_main) first_call_main = .false.

! check for hydrometeors or supersaturation --------------------------------------------------
do_micro = any(l_qc) .or. any(l_qr) .or. any(l_qi) .or. any(l_qs) .or. any(l_qg)
if (.not. do_micro .and. .not. supersaturated) return
Expand Down
Loading