Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding updated RAS #585

Merged
merged 5 commits into from
Mar 17, 2021
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
8 changes: 4 additions & 4 deletions physics/GFS_DCNV_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, cs
dt3dt(i,k) = dt3dt(i,k) + (gt0(i,k)-save_t(i,k)) * frain
du3dt(i,k) = du3dt(i,k) + (gu0(i,k)-save_u(i,k)) * frain
dv3dt(i,k) = dv3dt(i,k) + (gv0(i,k)-save_v(i,k)) * frain

! upd_mf(i,k) = upd_mf(i,k) + ud_mf(i,k) * (con_g*frain)
! dwn_mf(i,k) = dwn_mf(i,k) + dd_mf(i,k) * (con_g*frain)
! det_mf(i,k) = det_mf(i,k) + dt_mf(i,k) * (con_g*frain)
! convective mass fluxes
upd_mf(i,k) = upd_mf(i,k) + ud_mf(i,k) * (con_g*frain)
dwn_mf(i,k) = dwn_mf(i,k) + dd_mf(i,k) * (con_g*frain)
det_mf(i,k) = det_mf(i,k) + dt_mf(i,k) * (con_g*frain)
enddo
enddo
if(qdiag3d) then
Expand Down
9 changes: 9 additions & 0 deletions physics/m_micro.F90
Original file line number Diff line number Diff line change
Expand Up @@ -542,16 +542,19 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
& NCPI(I,K), qc_min)
if (rnw(i,k) <= qc_min(1)) then
ncpr(i,k) = zero
rnw(i,k) = zero
elseif (ncpr(i,k) <= nmin) then ! make sure NL > 0 if Q >0
ncpr(i,k) = max(rnw(i,k) / (fourb3 * PI *RL_cub*997.0_kp), nmin)
endif
if (snw(i,k) <= qc_min(2)) then
ncps(i,k) = zero
snw(i,k) = zero
elseif (ncps(i,k) <= nmin) then
ncps(i,k) = max(snw(i,k) / (fourb3 * PI *RL_cub*500.0_kp), nmin)
endif
if (qgl(i,k) <= qc_min(2)) then
ncgl(i,k) = zero
qgl(i,k) = zero
elseif (ncgl(i,k) <= nmin) then
ncgl(i,k) = max(qgl(i,k) / (fourb3 * PI *RL_cub*500.0_kp), nmin)
endif
Expand Down Expand Up @@ -1696,16 +1699,19 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
QI_TOT(I,K) = QILS(I,K) + QICN(I,K)
if (rnw(i,k) <= qc_min(1)) then
ncpr(i,k) = zero
rnw(i,k) = zero
elseif (ncpr(i,k) <= nmin) then ! make sure NL > 0 if Q >0
ncpr(i,k) = max(rnw(i,k) / (fourb3 * PI *RL_cub*997.0_kp), nmin)
endif
if (snw(i,k) <= qc_min(2)) then
ncps(i,k) = zero
snw(i,k) = zero
elseif (ncps(i,k) <= nmin) then
ncps(i,k) = max(snw(i,k) / (fourb3 * PI *RL_cub*500.0_kp), nmin)
endif
if (qgl(i,k) <= qc_min(2)) then
ncgl(i,k) = zero
qgl(i,k) = zero
elseif (ncgl(i,k) <= nmin) then
ncgl(i,k) = max(qgl(i,k) / (fourb3 * PI *RL_cub*500.0_kp), nmin)
endif
Expand Down Expand Up @@ -1736,16 +1742,19 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
!
if (rnw(i,k) <= qc_min(1)) then
ncpr(i,k) = zero
rnw(i,k) = zero
elseif (ncpr(i,k) <= nmin) then ! make sure NL > 0 if Q >0
ncpr(i,k) = max(rnw(i,k) / (fourb3 * PI *RL_cub*997.0_kp), nmin)
endif
if (snw(i,k) <= qc_min(2)) then
ncps(i,k) = zero
snw(i,k) = zero
elseif (ncps(i,k) <= nmin) then
ncps(i,k) = max(snw(i,k) / (fourb3 * PI *RL_cub*500.0_kp), nmin)
endif
if (qgl(i,k) <= qc_min(2)) then
ncgl(i,k) = zero
qgl(i,k) = zero
elseif (ncgl(i,k) <= nmin) then
ncgl(i,k) = max(qgl(i,k) / (fourb3 * PI *RL_cub*500.0_kp), nmin)
endif
Expand Down
20 changes: 11 additions & 9 deletions physics/micro_mg2_0.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1792,23 +1792,25 @@ subroutine micro_mg_tend ( &
nnucct(i,k) = ratio * nnucct(i,k)
npsacws(i,k) = ratio * npsacws(i,k)
nsubc(i,k) = ratio * nsubc(i,k)
end if
endif

mnuccri(i,k) = zero
nnuccri(i,k) = zero

if (do_cldice) then

! freezing of rain to produce ice if mean rain size is smaller than Dcs
if (lamr(i,k) > qsmall .and. one/lamr(i,k) < Dcs) then
mnuccri(i,k) = mnuccr(i,k)
nnuccri(i,k) = nnuccr(i,k)
mnuccr(i,k) = zero
nnuccr(i,k) = zero
end if
end if
if (lamr(i,k) > qsmall) then
if (one/lamr(i,k) < Dcs) then
mnuccri(i,k) = mnuccr(i,k)
nnuccri(i,k) = nnuccr(i,k)
mnuccr(i,k) = zero
nnuccr(i,k) = zero
endif
endif
endif

end do
enddo

do i=1,mgncol

Expand Down
20 changes: 11 additions & 9 deletions physics/micro_mg3_0.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2448,23 +2448,25 @@ subroutine micro_mg_tend ( &
nnucct(i,k) = ratio * nnucct(i,k)
npsacws(i,k) = ratio * npsacws(i,k)
nsubc(i,k) = ratio * nsubc(i,k)
end if
endif

mnuccri(i,k) = zero
nnuccri(i,k) = zero

if (do_cldice) then

! freezing of rain to produce ice if mean rain size is smaller than Dcs
if (lamr(i,k) > qsmall .and. one/lamr(i,k) < Dcs) then
mnuccri(i,k) = mnuccr(i,k)
nnuccri(i,k) = nnuccr(i,k)
mnuccr(i,k) = zero
nnuccr(i,k) = zero
end if
end if
if (lamr(i,k) > qsmall) then
if (one/lamr(i,k) < Dcs) then
mnuccri(i,k) = mnuccr(i,k)
nnuccri(i,k) = nnuccr(i,k)
mnuccr(i,k) = zero
nnuccr(i,k) = zero
endif
endif
endif

end do
enddo

do i=1,mgncol

Expand Down
72 changes: 56 additions & 16 deletions physics/radsw_main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2946,8 +2946,13 @@ subroutine spcvrtc &
else ! for non-conservative scattering
za1 = zgam1*zgam4 + zgam2*zgam3
za2 = zgam1*zgam3 + zgam2*zgam4
zrk = sqrt ( (zgam1 - zgam2) * (zgam1 + zgam2) )
zrk2= 2.0 * zrk
zrk = (zgam1 - zgam2) * (zgam1 + zgam2)
if (zrk > eps1) then
zrk = sqrt(zrk)
else
zrk = f_zero
endif
zrk2= zrk + zrk

zrp = zrk * cosz
zrp1 = f_one + zrp
Expand Down Expand Up @@ -2993,7 +2998,8 @@ subroutine spcvrtc &
ze1r45 = zr4*zexp1 + zr5*zexm1

! ... collimated beam
if (ze1r45>=-eps1 .and. ze1r45<=eps1) then
! if (ze1r45>=-eps1 .and. ze1r45<=eps1) then
if (abs(ze1r45) <= eps1) then
zrefb(kp) = eps1
ztrab(kp) = zexm2
else
Expand All @@ -3005,7 +3011,11 @@ subroutine spcvrtc &
endif

! ... diffuse beam
zden1 = zr4 / (ze1r45 * zrkg1)
if (ze1r45 >= f_zero) then
zden1 = zr4 / max(eps1, ze1r45*zrkg1)
else
zden1 = zr4 / min(-eps1, ze1r45*zrkg1)
endif
zrefd(kp) = max(f_zero, min(f_one, &
& zgam2*(zexp1 - zexm1)*zden1 ))
ztrad(kp) = max(f_zero, min(f_one, zrk2*zden1 ))
Expand Down Expand Up @@ -3171,8 +3181,13 @@ subroutine spcvrtc &
else ! for non-conservative scattering
za1 = zgam1*zgam4 + zgam2*zgam3
za2 = zgam1*zgam3 + zgam2*zgam4
zrk = sqrt ( (zgam1 - zgam2) * (zgam1 + zgam2) )
zrk2= 2.0 * zrk
zrk = (zgam1 - zgam2) * (zgam1 + zgam2)
if (zrk > eps1) then
zrk = sqrt(zrk)
else
zrk = f_zero
endif
zrk2= zrk + zrk

zrp = zrk * cosz
zrp1 = f_one + zrp
Expand Down Expand Up @@ -3218,7 +3233,8 @@ subroutine spcvrtc &
ze1r45 = zr4*zexp1 + zr5*zexm1

! ... collimated beam
if ( ze1r45>=-eps1 .and. ze1r45<=eps1 ) then
! if ( ze1r45>=-eps1 .and. ze1r45<=eps1 ) then
if ( abs(ze1r45) <= eps1 ) then
zrefb(kp) = eps1
ztrab(kp) = zexm2
else
Expand All @@ -3230,7 +3246,11 @@ subroutine spcvrtc &
endif

! ... diffuse beam
zden1 = zr4 / (ze1r45 * zrkg1)
if (ze1r45 >= f_zero) then
zden1 = zr4 / max(eps1, ze1r45*zrkg1)
else
zden1 = zr4 / min(-eps1, ze1r45*zrkg1)
endif
zrefd(kp) = max(f_zero, min(f_one, &
& zgam2*(zexp1 - zexm1)*zden1 ))
ztrad(kp) = max(f_zero, min(f_one, zrk2*zden1 ))
Expand Down Expand Up @@ -3723,8 +3743,13 @@ subroutine spcvrtm &
else ! for non-conservative scattering
za1 = zgam1*zgam4 + zgam2*zgam3
za2 = zgam1*zgam3 + zgam2*zgam4
zrk = sqrt ( (zgam1 - zgam2) * (zgam1 + zgam2) )
zrk2= 2.0 * zrk
zrk = (zgam1 - zgam2) * (zgam1 + zgam2)
if (zrk > eps1) then
zrk = sqrt(zrk)
else
zrk = f_zero
endif
zrk2= zrk + zrk

zrp = zrk * cosz
zrp1 = f_one + zrp
Expand Down Expand Up @@ -3770,7 +3795,8 @@ subroutine spcvrtm &
ze1r45 = zr4*zexp1 + zr5*zexm1

! ... collimated beam
if (ze1r45>=-eps1 .and. ze1r45<=eps1) then
! if (ze1r45>=-eps1 .and. ze1r45<=eps1) then
if (abs(ze1r45) <= eps1) then
zrefb(kp) = eps1
ztrab(kp) = zexm2
else
Expand All @@ -3782,7 +3808,11 @@ subroutine spcvrtm &
endif

! ... diffuse beam
zden1 = zr4 / (ze1r45 * zrkg1)
if (ze1r45 >= f_zero) then
zden1 = zr4 / max(eps1, ze1r45*zrkg1)
else
zden1 = zr4 / min(-eps1, ze1r45*zrkg1)
endif
zrefd(kp) = max(f_zero, min(f_one, &
& zgam2*(zexp1 - zexm1)*zden1 ))
ztrad(kp) = max(f_zero, min(f_one, zrk2*zden1 ))
Expand Down Expand Up @@ -3935,8 +3965,13 @@ subroutine spcvrtm &
else ! for non-conservative scattering
za1 = zgam1*zgam4 + zgam2*zgam3
za2 = zgam1*zgam3 + zgam2*zgam4
zrk = sqrt ( (zgam1 - zgam2) * (zgam1 + zgam2) )
zrk2= 2.0 * zrk
zrk = (zgam1 - zgam2) * (zgam1 + zgam2)
if (zrk > eps1) then
zrk = sqrt(zrk)
else
zrk = f_zero
endif
zrk2= zrk + zrk

zrp = zrk * cosz
zrp1 = f_one + zrp
Expand Down Expand Up @@ -3982,7 +4017,8 @@ subroutine spcvrtm &
ze1r45 = zr4*zexp1 + zr5*zexm1

! ... collimated beam
if ( ze1r45>=-eps1 .and. ze1r45<=eps1 ) then
! if ( ze1r45>=-eps1 .and. ze1r45<=eps1 ) then
if ( abs(ze1r45) <= eps1 ) then
zrefb(kp) = eps1
ztrab(kp) = zexm2
else
Expand All @@ -3994,7 +4030,11 @@ subroutine spcvrtm &
endif

! ... diffuse beam
zden1 = zr4 / (ze1r45 * zrkg1)
if (ze1r45 >= f_zero) then
zden1 = zr4 / max(eps1, ze1r45*zrkg1)
else
zden1 = zr4 / min(-eps1, ze1r45*zrkg1)
endif
zrefd(kp) = max(f_zero, min(f_one, &
& zgam2*(zexp1 - zexm1)*zden1 ))
ztrad(kp) = max(f_zero, min(f_one, zrk2*zden1 ))
Expand Down
Loading