From 62279bb627cffcb0e86d28b605048a706872568f Mon Sep 17 00:00:00 2001 From: Zhihong Tan Date: Mon, 27 Nov 2023 10:10:04 -0500 Subject: [PATCH] Passing additional surface variables into the atmospheric model #28 (#29) * ADDED SURFACE VARIABLES REQUIRED BY NCEP TKE-EDMF The shflx, lhflx, wind, thv_atm, thv_surf variables are passed from the surface coupler to the atmospheric model as required by the NCEP TKE-EDMF scheme. * CONDITIONAL COMPILATION FLAG FOR AM4 COMPATIBILITY For compatibility with AM4, a ifdef-statement with a conditional compilation flag "do_am5phys" is added in the call to physics_driver_down to prevent the additional surface variables from being passed into the old AM4 physics package. This flag should be defined if AM5 is compiled with NCEP TKE-based EDMF. * REMOVED NAME TAGS FROM THE COMMENTS * REMOVING THE CONDITIONAL COMPILATION FLAG The added variables are now passed as optional arguments into physics_driver_down. This requires consistent changes in the atmos_phys package. * ADDED IF-STATEMENTS FOR CHECKSUM Two if-associated statements are added before the checksums of bnd_type%shflx and bnd_type%lhflx to pass the null model build. * Changed the name for EDMF in the comments The full name for the NCEP TKE-based EDMF replaces the informal short name (HanEDMF) in the comments only. No other code changes. * Modified the comments for new fields The term 'surface' in the comments for the added fields is clarified as the lowest atmos level as Sergey suggested. --------- Co-authored-by: Zhihong Tan --- coupled/atmos_model.F90 | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/coupled/atmos_model.F90 b/coupled/atmos_model.F90 index 28be804..ed588c9 100644 --- a/coupled/atmos_model.F90 +++ b/coupled/atmos_model.F90 @@ -205,6 +205,9 @@ module atmos_model_mod real, dimension(:,:), pointer :: q_star =>null() ! moisture scale real, dimension(:,:), pointer :: shflx =>null() ! sensible heat flux !miz real, dimension(:,:), pointer :: lhflx =>null() ! latent heat flux !miz + real, dimension(:,:), pointer :: wind =>null() ! absolute wind at lowest atmos model level with gust corrections (w_atm of surface_flux output) + real, dimension(:,:), pointer :: thv_atm =>null() ! virtual temperature at lowest atmos model level + real, dimension(:,:), pointer :: thv_surf =>null() ! virtual temperature at the surface real, dimension(:,:), pointer :: rough_mom =>null() ! surface roughness (used for momentum) real, dimension(:,:), pointer :: frac_open_sea =>null() ! non-seaice fraction (%) real, dimension(:,:,:), pointer :: data =>null() !collective field for "named" fields above @@ -533,7 +536,13 @@ subroutine update_atmos_model_down( Surface_boundary, Atmos ) Atmos%Surf_diff, & Atmos%gust(is:ie,js:je), & Rad_flux(1)%control, & - Rad_flux(1)%block(blk) ) + Rad_flux(1)%block(blk), & + shflx = Surface_boundary%shflx (isw:iew,jsw:jew), & ! shflx required by NCEP TKE-based EDMF + lhflx = Surface_boundary%lhflx (isw:iew,jsw:jew), & ! evap required by NCEP TKE-based EDMF + wind = Surface_boundary%wind (isw:iew,jsw:jew), & ! sfc wind required by NCEP TKE-based EDMF + thv_atm = Surface_boundary%thv_atm (isw:iew,jsw:jew), & ! 2m thv required by NCEP TKE-based EDMF + thv_surf= Surface_boundary%thv_surf(isw:iew,jsw:jew) ) ! sfc thv required by NCEP TKE-based EDMF + enddo call physics_driver_down_endts (1, 1) @@ -1412,9 +1421,14 @@ subroutine lnd_ice_atm_bnd_type_chksum(id, timestep, bnd_type) write(outunit,100) 'lnd_ice_atm_bnd_type%b_star ',mpp_chksum(bnd_type%b_star ) write(outunit,100) 'lnd_ice_atm_bnd_type%q_star ',mpp_chksum(bnd_type%q_star ) #ifndef use_AM3_physics - write(outunit,100) 'lnd_ice_atm_bnd_type%shflx ',mpp_chksum(bnd_type%shflx )!miz - write(outunit,100) 'lnd_ice_atm_bnd_type%lhflx ',mpp_chksum(bnd_type%lhflx )!miz + if(associated(bnd_type%shflx)) & + write(outunit,100) 'lnd_ice_atm_bnd_type%shflx ',mpp_chksum(bnd_type%shflx )!miz + if(associated(bnd_type%lhflx)) & + write(outunit,100) 'lnd_ice_atm_bnd_type%lhflx ',mpp_chksum(bnd_type%lhflx )!miz #endif + write(outunit,100) 'lnd_ice_atm_bnd_type%wind ',mpp_chksum(bnd_type%wind ) + write(outunit,100) 'lnd_ice_atm_bnd_type%thv_atm ',mpp_chksum(bnd_type%thv_atm ) + write(outunit,100) 'lnd_ice_atm_bnd_type%thv_surf ',mpp_chksum(bnd_type%thv_surf ) write(outunit,100) 'lnd_ice_atm_bnd_type%rough_mom ',mpp_chksum(bnd_type%rough_mom ) ! write(outunit,100) 'lnd_ice_atm_bnd_type%data ',mpp_chksum(bnd_type%data )