Skip to content

Commit

Permalink
modmicrophysics and modgenstat: use iqr, inr instead of nsv to determ…
Browse files Browse the repository at this point in the history
…ine if these scalars are defined
  • Loading branch information
fjansson committed Nov 6, 2024
1 parent 63ffcb1 commit 3157151
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/modgenstat.f90
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ subroutine do_genstat
clwav(1) = clwav(1) + ql0(i,j,1) * ilratio
cliav(1) = cliav(1) + ql0(i,j,1) * (1-ilratio)

if (nsv > 1) then
if (iqr > 0) then
ilratio = max(0._field_r,min(1._field_r,(tmp0(i,j,1)-tdnrsg)/(tuprsg-tdnrsg)))
plwav(1) = plwav(1) + sv0(i,j,1,iqr) * ilratio
pliav(1) = pliav(1) + sv0(i,j,1,iqr) * (1-ilratio)
Expand Down Expand Up @@ -850,7 +850,7 @@ subroutine do_genstat
clwav_s = clwav_s + ql0(i,j,k) * ilratio
cliav_s = cliav_s + ql0(i,j,k) * (1-ilratio)

if (nsv > 1) then
if (iqr > 0) then
ilratio = max(0._field_r,min(1._field_r,(tmp0(i,j,k)-tdnrsg)/(tuprsg-tdnrsg)))
plwav_s = plwav_s + sv0(i,j,k,iqr) * ilratio
pliav_s = pliav_s + sv0(i,j,k,iqr) * (1-ilratio)
Expand Down
2 changes: 1 addition & 1 deletion src/modmicrodata.f90
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module modmicrodata

logical :: l_lognormal = .false. !< log param of rain terminal velocities for rain sedim

integer :: inr, iqr
integer :: inr = -1, iqr = -1

real(field_r), parameter :: D0_kk = 50e-6 & !< diameter sep. cloud and prec. in KK00 scheme
,qcmin = 1.0e-7 & !< Cloud specific mixing ratio treshold for calculations
Expand Down
8 changes: 2 additions & 6 deletions src/modmicrophysics.f90
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,15 @@ subroutine initmicrophysics
case(imicro_none)
case(imicro_drizzle)
case(imicro_bulk)
!if (nsv < 2) STOP "ERROR: Bulk microphysics requires nsv >=2"
call initbulkmicro
call initbulkmicro
case(imicro_bin)
! call initbinmicro
case(imicro_sice)
if (nsv < 2) STOP "ERROR: Simple ice microphysics requires nsv >=2"
call initsimpleice
case(imicro_sice2)
if (nsv < 2) STOP "ERROR: Simple ice microphysics requires nsv >=2"
call initsimpleice2
case(imicro_bulk3) !#sb3
if (nsv < 12) STOP "ERROR: Full Seifer-Beheng microphysics requires nsv >=12" !#sb3
call initbulkmicro3 !#sb3
call initbulkmicro3 !#sb3
case(imicro_user)
end select
end subroutine initmicrophysics
Expand Down

0 comments on commit 3157151

Please sign in to comment.