From 4d14fcab1b74bdd679fe8c1d51d8048b9c45e033 Mon Sep 17 00:00:00 2001 From: William Putman Date: Mon, 27 Mar 2023 23:24:02 -0400 Subject: [PATCH] hydrostatic density option --- .../gfdl_cloud_microphys.F90 | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/gfdl_cloud_microphys.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/gfdl_cloud_microphys.F90 index 17565c69d..302f0e25f 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/gfdl_cloud_microphys.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/gfdl_cloud_microphys.F90 @@ -471,7 +471,7 @@ subroutine gfdl_cloud_microphys_driver (qv, ql, qr, qi, qs, qg, qa, qn, & ! ----------------------------------------------------------------------- do j = js, je - call mpdrv (hydrostatic, uin, vin, w, delp, pt, qv, ql, qr, qi, qs, qg,& + call mpdrv (phys_hydrostatic, hydrostatic, uin, vin, w, delp, pt, qv, ql, qr, qi, qs, qg,& qa, qn, qicn, qlcn, clcn, dz, is, ie, js, je, ks, ke, ktop, kbot, j, dt_in, ntimes, & rain (:, j), snow (:, j), graupel (:, j), ice (:, j), m2_rain, & m2_sol, cond (:, j), area (:, j), & @@ -622,7 +622,7 @@ end subroutine gfdl_cloud_microphys_driver !>@param 5) qs: snow (kg / kg) !>@param 6) qg: graupel (kg / kg) ! ----------------------------------------------------------------------- -subroutine mpdrv (hydrostatic, uin, vin, w, delp, pt, qv, ql, qr, qi, qs, & +subroutine mpdrv (phys_hydrostatic, hydrostatic, uin, vin, w, delp, pt, qv, ql, qr, qi, qs, & qg, qa, qn, qicn, qlcn, clcn, dz, is, ie, js, je, ks, ke, ktop, kbot, j, dt_in, ntimes, & rain, snow, graupel, ice, m2_rain, m2_sol, cond, area1, land, & cnv_fraction, srf_type, eis, rhcrit, anv_icefall, lsc_icefall, revap, isubl, & @@ -631,7 +631,7 @@ subroutine mpdrv (hydrostatic, uin, vin, w, delp, pt, qv, ql, qr, qi, qs, & implicit none - logical, intent (in) :: hydrostatic + logical, intent (in) :: phys_hydrostatic, hydrostatic integer, intent (in) :: j, is, ie, js, je, ks, ke integer, intent (in) :: ntimes, ktop, kbot @@ -815,13 +815,20 @@ subroutine mpdrv (hydrostatic, uin, vin, w, delp, pt, qv, ql, qr, qi, qs, & ! ----------------------------------------------------------------------- ! dry air density ! ----------------------------------------------------------------------- - - do k = ktop, kbot - dz1 (k) = dz0 (k) - den (k) = den0 (k) ! dry air density remains the same - denfac (k) = sqrt ( den(kbot) / den (k)) - enddo - + if (phys_hydrostatic .or. hydrostatic) then + do k = ktop, kbot + dz1 (k) = dz0 (k) * tz (k) / t0 (k) ! hydrostatic balance + den (k) = den0 (k) * dz0 (k) / dz1 (k) + denfac (k) = sqrt (sfcrho / den (k)) + enddo + else + do k = ktop, kbot + dz1 (k) = dz0 (k) + den (k) = den0 (k) ! dry air density remains the same + denfac (k) = sqrt ( den(kbot) / den (k)) + enddo + endif + ! ----------------------------------------------------------------------- ! sedimentation of cloud ice, snow, and graupel ! -----------------------------------------------------------------------