Skip to content

Commit

Permalink
Passing additional surface variables into the atmospheric model #28 (#29
Browse files Browse the repository at this point in the history
)

* 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 <[email protected]>
  • Loading branch information
zhihong-tan and Zhihong Tan authored Nov 27, 2023
1 parent 88b050f commit 62279bb
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions coupled/atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 )

Expand Down

0 comments on commit 62279bb

Please sign in to comment.