From b549d67eabc91965aec11e005e262d4158732169 Mon Sep 17 00:00:00 2001 From: Oksana Guba Date: Tue, 9 Nov 2021 11:03:05 -0600 Subject: [PATCH 1/4] added clubb fixer field, factor for the shflx --- components/eam/src/physics/cam/cam_diagnostics.F90 | 4 ++++ components/eam/src/physics/cam/clubb_intr.F90 | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/components/eam/src/physics/cam/cam_diagnostics.F90 b/components/eam/src/physics/cam/cam_diagnostics.F90 index cd0423ce2f49..9a19f7f8446a 100644 --- a/components/eam/src/physics/cam/cam_diagnostics.F90 +++ b/components/eam/src/physics/cam/cam_diagnostics.F90 @@ -314,6 +314,10 @@ subroutine diag_init() call addfld ('PSL',horiz_only, 'A','Pa','Sea level pressure', & standard_name='air_pressure_at_mean_sea_level') + + call addfld ('fixerCLUBB',horiz_only, 'A','J/m2','dTE fixed by CLUBB') + + call addfld ('T850',horiz_only, 'A','K','Temperature at 850 mbar pressure surface') call addfld ('T500',horiz_only, 'A','K','Temperature at 500 mbar pressure surface') call addfld ('T300',horiz_only, 'A','K','Temperature at 300 mbar pressure surface') diff --git a/components/eam/src/physics/cam/clubb_intr.F90 b/components/eam/src/physics/cam/clubb_intr.F90 index d2cadc0950cf..d75c5be74032 100644 --- a/components/eam/src/physics/cam/clubb_intr.F90 +++ b/components/eam/src/physics/cam/clubb_intr.F90 @@ -1484,6 +1484,10 @@ subroutine clubb_tend_cam( & real(r8) :: sfc_v_diff_tau(pcols) ! Response to tau perturbation, m/s real(r8), parameter :: pert_tau = 0.1_r8 ! tau perturbation, Pa + + real(r8) :: inv_exner_clubb_surf + + ! ZM gustiness equation below from Redelsperger et al. (2000) ! numbers are coefficients of the empirical equation @@ -2036,6 +2040,10 @@ subroutine clubb_tend_cam( & ! Surface fluxes provided by host model wpthlp_sfc = real(cam_in%shf(i), kind = core_rknd)/(real(cpair, kind = core_rknd)*rho_ds_zm(1)) ! Sensible heat flux +#if 1 + inv_exner_clubb_surf = 1._r8/((state1%pmid(i,pver)/p0_clubb)**(rair/cpair)) !phl Option 2 + wpthlp_sfc = wpthlp_sfc*inv_exner_clubb_surf +#endif wprtp_sfc = real(cam_in%cflx(i,1), kind = core_rknd)/rho_ds_zm(1) ! Latent heat flux upwp_sfc = real(cam_in%wsx(i), kind = core_rknd)/rho_ds_zm(1) ! Surface meridional momentum flux vpwp_sfc = real(cam_in%wsy(i), kind = core_rknd)/rho_ds_zm(1) ! Surface zonal momentum flux @@ -2548,6 +2556,10 @@ subroutine clubb_tend_cam( & enddo ! end column loop call t_stopf('adv_clubb_core_col_loop') + + call outfld('fixerCLUBB', te_a(:)-te_b(:), pcols, lchnk ) + + ! Add constant to ghost point so that output is not corrupted if (clubb_do_adv) then if (macmic_it .eq. cld_macmic_num_steps) then From bc9aac5f30e2565cc2b04ba13377061d085df009 Mon Sep 17 00:00:00 2001 From: Oksana Guba Date: Mon, 31 Jan 2022 22:52:37 -0600 Subject: [PATCH 2/4] another definition for thlm --- components/eam/src/physics/cam/clubb_intr.F90 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/components/eam/src/physics/cam/clubb_intr.F90 b/components/eam/src/physics/cam/clubb_intr.F90 index d75c5be74032..18b0374e481f 100644 --- a/components/eam/src/physics/cam/clubb_intr.F90 +++ b/components/eam/src/physics/cam/clubb_intr.F90 @@ -1799,7 +1799,14 @@ subroutine clubb_tend_cam( & rvm(i,k) = state1%q(i,k,ixq) um(i,k) = state1%u(i,k) vm(i,k) = state1%v(i,k) + +#if 0 thlm(i,k) = state1%t(i,k)*exner_clubb(i,k)-(latvap/cpair)*state1%q(i,k,ixcldliq) +#else + thlm(i,k) = ( state1%t(i,k) & + - (latvap/cpairv(i,k,lchnk))*state1%q(i,k,ixcldliq) ) & + * inv_exner_clubb(i,k) +#endif if (clubb_do_adv) then if (macmic_it .eq. 1) then @@ -2040,10 +2047,15 @@ subroutine clubb_tend_cam( & ! Surface fluxes provided by host model wpthlp_sfc = real(cam_in%shf(i), kind = core_rknd)/(real(cpair, kind = core_rknd)*rho_ds_zm(1)) ! Sensible heat flux -#if 1 +#if 0 inv_exner_clubb_surf = 1._r8/((state1%pmid(i,pver)/p0_clubb)**(rair/cpair)) !phl Option 2 wpthlp_sfc = wpthlp_sfc*inv_exner_clubb_surf #endif +#if 1 + inv_exner_clubb_surf = 1._r8/((state1%pint(i,pverp)/p0_clubb)**(rair/cpair)) !PB option + wpthlp_sfc = wpthlp_sfc*inv_exner_clubb_surf +#endif + wprtp_sfc = real(cam_in%cflx(i,1), kind = core_rknd)/rho_ds_zm(1) ! Latent heat flux upwp_sfc = real(cam_in%wsx(i), kind = core_rknd)/rho_ds_zm(1) ! Surface meridional momentum flux vpwp_sfc = real(cam_in%wsy(i), kind = core_rknd)/rho_ds_zm(1) ! Surface zonal momentum flux From 384083568af22374fcb5b4e3b345394316df7724 Mon Sep 17 00:00:00 2001 From: Oksana Guba Date: Wed, 2 Feb 2022 16:02:42 -0600 Subject: [PATCH 3/4] fix new thetal definition --- components/eam/src/physics/cam/clubb_intr.F90 | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/components/eam/src/physics/cam/clubb_intr.F90 b/components/eam/src/physics/cam/clubb_intr.F90 index 18b0374e481f..3d9aa6017ffe 100644 --- a/components/eam/src/physics/cam/clubb_intr.F90 +++ b/components/eam/src/physics/cam/clubb_intr.F90 @@ -1800,12 +1800,18 @@ subroutine clubb_tend_cam( & um(i,k) = state1%u(i,k) vm(i,k) = state1%v(i,k) -#if 0 +#define NEWTHETAL +#ifdef NEWTHETAL thlm(i,k) = state1%t(i,k)*exner_clubb(i,k)-(latvap/cpair)*state1%q(i,k,ixcldliq) #else +!NCAR +! thlm(i,k) = ( state1%t(i,k) & +! - (latvap/cpairv(i,k,lchnk))*state1%q(i,k,ixcldliq) ) & +! * inv_exner_clubb(i,k) + thlm(i,k) = ( state1%t(i,k) & - - (latvap/cpairv(i,k,lchnk))*state1%q(i,k,ixcldliq) ) & - * inv_exner_clubb(i,k) + - (latvap/cpair)*state1%q(i,k,ixcldliq) ) & + * exner_clubb(i,k) #endif if (clubb_do_adv) then @@ -2047,12 +2053,12 @@ subroutine clubb_tend_cam( & ! Surface fluxes provided by host model wpthlp_sfc = real(cam_in%shf(i), kind = core_rknd)/(real(cpair, kind = core_rknd)*rho_ds_zm(1)) ! Sensible heat flux -#if 0 +#if 1 inv_exner_clubb_surf = 1._r8/((state1%pmid(i,pver)/p0_clubb)**(rair/cpair)) !phl Option 2 wpthlp_sfc = wpthlp_sfc*inv_exner_clubb_surf #endif -#if 1 - inv_exner_clubb_surf = 1._r8/((state1%pint(i,pverp)/p0_clubb)**(rair/cpair)) !PB option +#if 0 + inv_exner_clubb_surf = 1._r8/((state1%pint(i,pverp)/p0_clubb)**(rair/cpair)) !Peter B option wpthlp_sfc = wpthlp_sfc*inv_exner_clubb_surf #endif @@ -2464,7 +2470,11 @@ subroutine clubb_tend_cam( & wv_a = 0._r8 wl_a = 0._r8 do k=1,pver +#ifdef NEWTHETAL + enthalpy = cpair*thlm(i,k)/exner_clubb(i,k) + latvap*rcm(i,k) +#else enthalpy = cpair*((thlm(i,k)+(latvap/cpair)*rcm(i,k))/exner_clubb(i,k)) +#endif clubb_s(k) = enthalpy + gravit*state1%zm(i,k)+state1%phis(i) ! se_a(i) = se_a(i) + clubb_s(k)*state1%pdel(i,k)*invrs_gravit se_a(i) = se_a(i) + enthalpy * state1%pdel(i,k)*invrs_gravit From 9823193800eed283cccc070fe09ecd194050df29 Mon Sep 17 00:00:00 2001 From: Oksana Guba Date: Wed, 2 Feb 2022 17:55:32 -0600 Subject: [PATCH 4/4] fix typo --- components/eam/src/physics/cam/clubb_intr.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/eam/src/physics/cam/clubb_intr.F90 b/components/eam/src/physics/cam/clubb_intr.F90 index 3d9aa6017ffe..13e1e06f5f98 100644 --- a/components/eam/src/physics/cam/clubb_intr.F90 +++ b/components/eam/src/physics/cam/clubb_intr.F90 @@ -1801,7 +1801,7 @@ subroutine clubb_tend_cam( & vm(i,k) = state1%v(i,k) #define NEWTHETAL -#ifdef NEWTHETAL +#ifndef NEWTHETAL thlm(i,k) = state1%t(i,k)*exner_clubb(i,k)-(latvap/cpair)*state1%q(i,k,ixcldliq) #else !NCAR