Skip to content

Commit

Permalink
Updating to simplify precip temperature resetting.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaxmonsky committed Jun 14, 2024
1 parent a824aa7 commit d0a9dac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions tj2016/tj2016_precip.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ subroutine tj2016_precip_run(ncol, pver, gravit, rairv,
real(kind_phys), intent(in) :: pmid(:,:) ! mid-point pressure (Pa)
real(kind_phys), intent(in) :: pdel(:,:) ! layer thickness (Pa)

real(kind_phys), intent(inout) :: T(:,:) ! air temperature (K)
real(kind_phys), intent(in) :: T(:,:) ! air temperature (K)
real(kind_phys), intent(inout) :: qv(:,:) ! specific humidity Q (kg/kg)

real(kind_phys), intent(out) :: relhum(:,:) ! relative humidity
Expand All @@ -62,7 +62,7 @@ subroutine tj2016_precip_run(ncol, pver, gravit, rairv,
! Variables for condensation, precipitation, and temperature
real(kind_phys) :: qsat ! saturation value for Q (kg/kg)
real(kind_phys) :: tmp, tmp_t, tmp_q
real(kind_phys) :: stateT(ncol, pver) ! air temperature (K) _before_ run
real(kind_phys) :: localT(ncol, pver) ! air temperature (K) _before_ run
! Loop variables
integer :: i, k

Expand All @@ -89,7 +89,7 @@ subroutine tj2016_precip_run(ncol, pver, gravit, rairv,
!=========================================================================
! Large-Scale Condensation and Precipitation without cloud stage
!=========================================================================
stateT = T
localT = T
do k = 1, pver
do i = 1, ncol
qsat = epsilo*e0/pmid(i,k)*exp(-latvap/rh2o*((1._kind_phys/T(i,k))-1._kind_phys/T0)) ! saturation value for Q
Expand All @@ -99,17 +99,16 @@ subroutine tj2016_precip_run(ncol, pver, gravit, rairv,
tmp_t = latvap/cpairv(i,k)*tmp ! dT/dt tendency from large-scale condensation
tmp_q = -tmp ! dqv/dt tendency from large-scale condensation
precl(i) = precl(i) + tmp*pdel(i,k)/(gravit*rhoh2o) ! large-scale precipitation rate (m/s)
T(i,k) = T(i,k) + tmp_t*dtime ! update T (temperature)
localT(i,k) = localT(i,k) + tmp_t*dtime ! update T (temperature)
qv(i,k) = qv(i,k) + tmp_q*dtime ! update qv (specific humidity)
! recompute qsat with updated T
qsat = epsilo*e0/pmid(i,k)*exp(-latvap/rh2o*((1._kind_phys/T(i,k))-1._kind_phys/T0)) ! saturation value for Q
qsat = epsilo*e0/pmid(i,k)*exp(-latvap/rh2o*((1._kind_phys/localT(i,k))-1._kind_phys/T0)) ! saturation value for Q
end if

relhum(i,k) = qv(i,k) / qsat * 100._kind_phys ! in percent
tendency_of_air_enthalpy(i,k) = (T(i,k) - stateT(i,k)) / dtime * cpairv(i,k)
tendency_of_air_enthalpy(i,k) = (localT(i,k) - T(i,k)) / dtime * cpairv(i,k)
end do
end do


end subroutine tj2016_precip_run
end module TJ2016_precip
2 changes: 1 addition & 1 deletion tj2016/tj2016_precip.meta
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
units = K
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = inout
intent = in
[ qv ]
standard_name = water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water
units = kg kg-1
Expand Down

0 comments on commit d0a9dac

Please sign in to comment.