Skip to content
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9c41040
major ZM cleanup
whannah1 Oct 3, 2025
dc2ce59
major cleanup of microphysics related arguments
whannah1 Oct 8, 2025
6cd876f
more major ZM fortran refactoring
whannah1 Oct 10, 2025
688e782
remove hack scheme support to avoid ZM build issues
whannah1 Oct 13, 2025
7310aac
add old_snow to zm_params
whannah1 Oct 13, 2025
3852f5f
add sprd to ZM microp_st and create zm_microphysics_adjust
whannah1 Oct 13, 2025
21dc4d5
dd snow mass/num detrainment tendencies
whannah1 Oct 13, 2025
8ece799
move frz argument to microp_st
whannah1 Oct 13, 2025
605bc28
move mudpcu and lambdadpcu to microp_st
whannah1 Oct 13, 2025
05989e0
move aero/micro to end of arg list
whannah1 Oct 13, 2025
6b49592
move MCSP output to zm_conv_mcsp_hist
whannah1 Oct 14, 2025
3eb6026
remove pcols from ZM fortran bridge
whannah1 Oct 14, 2025
82b11fb
zm bridge - fix ol_snow and output initialization
whannah1 Oct 15, 2025
de7bbdf
enable host mirroring of ZM variables
whannah1 Oct 17, 2025
0243127
remove GPU clause for building zm
whannah1 Oct 20, 2025
a108e61
update ZM bridge to output temperature tendency
whannah1 Oct 22, 2025
b6c0670
interim update to facilitate rebase
whannah1 Oct 22, 2025
438415d
major updates for GPU support
whannah1 Oct 23, 2025
1ab6be1
add temporary explicit transpose/copy method for ZM bridge
whannah1 Oct 24, 2025
a3d31b5
unod packed type for phis in SHOC
whannah1 Oct 27, 2025
a91d55b
updates from PR review
whannah1 Oct 28, 2025
f5be2bc
bug fix
whannah1 Oct 28, 2025
7e04eb8
move call for zm_microphysics_history_convert
whannah1 Oct 29, 2025
404f99a
remove team_policy
whannah1 Oct 29, 2025
33f3720
fixes to restor BFB for EAM tests
whannah1 Oct 29, 2025
ddc6db5
bug fix for run-time issue in EAM
whannah1 Nov 3, 2025
0ac1476
add constexpr to fix build error
whannah1 Nov 3, 2025
1dc8c98
bug fix to address diffs in ne30 tests
whannah1 Nov 5, 2025
f6527c1
fix variable descriptions
whannah1 Nov 7, 2025
ef87994
fix variable descriptions
whannah1 Nov 7, 2025
a9f4f79
fix units
whannah1 Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 0 additions & 132 deletions components/eam/src/physics/cam/convect_shallow.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ module convect_shallow
convect_shallow_use_shfrc !

! The following namelist variable controls which shallow convection package is used.
! 'Hack' = Hack shallow convection (default)
! 'UW' = UW shallow convection by Sungsu Park and Christopher S. Bretherton
! 'off' = No shallow convection

Expand Down Expand Up @@ -134,7 +133,6 @@ subroutine convect_shallow_init(pref_edge, pbuf2d)

use cam_history, only : addfld, horiz_only, add_default
use ppgrid, only : pcols, pver
use hk_conv, only : mfinti
use uwshcu, only : init_uwshcu
use physconst, only : rair, gravit, latvap, rhoh2o, zvir, &
cappa, latice, mwdry, mwh2o
Expand Down Expand Up @@ -196,14 +194,6 @@ subroutine convect_shallow_init(pref_edge, pbuf2d)
'Cloud ice tendency - shallow convection' )
call addfld( 'CMFDQR' , (/ 'lev' /) , 'A' , 'kg/kg/s', &
'Q tendency - shallow convection rainout' )
call addfld( 'EVAPTCM' , (/ 'lev' /) , 'A' , 'K/s', &
'T tendency - Evaporation/snow prod from Hack convection' )
call addfld( 'FZSNTCM' , (/ 'lev' /) , 'A' , 'K/s', &
'T tendency - Rain to snow conversion from Hack convection' )
call addfld( 'EVSNTCM' , (/ 'lev' /) , 'A' , 'K/s', &
'T tendency - Snow to rain prod from Hack convection' )
call addfld( 'EVAPQCM' , (/ 'lev' /) , 'A' , 'kg/kg/s', &
'Q tendency - Evaporation from Hack convection' )
call addfld( 'QC' , (/ 'lev' /) , 'A' , 'kg/kg/s', &
'Q tendency - shallow convection LW export' )
call addfld( 'PRECSH' , horiz_only, 'A' , 'm/s', &
Expand All @@ -229,17 +219,6 @@ subroutine convect_shallow_init(pref_edge, pbuf2d)

call addfld( 'FREQSH' , horiz_only , 'A' , 'fraction', &
'Fractional occurance of shallow convection' )

call addfld( 'HKFLXPRC' , (/ 'ilev' /), 'A' , 'kg/m2/s', &
'Flux of precipitation from HK convection' )
call addfld( 'HKFLXSNW' , (/ 'ilev' /), 'A' , 'kg/m2/s', &
'Flux of snow from HK convection' )
call addfld( 'HKNTPRPD' , (/ 'lev' /) , 'A' , 'kg/kg/s', &
'Net precipitation production from HK convection' )
call addfld( 'HKNTSNPD' , (/ 'lev' /) , 'A' , 'kg/kg/s', &
'Net snow production from HK convection' )
call addfld( 'HKEIHEAT' , (/ 'lev' /) , 'A' , 'W/kg' , &
'Heating by ice and evaporation in HK convection' )

call addfld ('ICWMRSH' , (/ 'lev' /), 'A' , 'kg/kg', &
'Shallow Convection in-cloud water mixing ratio ' )
Expand Down Expand Up @@ -279,32 +258,6 @@ subroutine convect_shallow_init(pref_edge, pbuf2d)
if( masterproc ) write(iulog,*) 'convect_shallow_init: shallow convection OFF'
continue

case('Hack') ! Hack scheme

qpert_idx = pbuf_get_index('qpert')

if( masterproc ) write(iulog,*) 'convect_shallow_init: Hack shallow convection'
! Limit shallow convection to regions below 40 mb
! Note this calculation is repeated in the deep convection interface
if( pref_edge(1) >= 4.e3_r8 ) then
limcnv = 1
else
do k = 1, plev
if( pref_edge(k) < 4.e3_r8 .and. pref_edge(k+1) >= 4.e3_r8 ) then
limcnv = k
goto 10
end if
end do
limcnv = plevp
end if
10 continue

if( masterproc ) then
write(iulog,*) 'MFINTI: Convection will be capped at intfc ', limcnv, ' which is ', pref_edge(limcnv), ' pascals'
end if

call mfinti( rair, cpair, gravit, latvap, rhoh2o, limcnv) ! Get args from inti.F90

case('UW') ! Park and Bretherton shallow convection scheme

if( masterproc ) write(iulog,*) 'convect_shallow_init: UW shallow convection scheme (McCaa)'
Expand Down Expand Up @@ -413,7 +366,6 @@ subroutine convect_shallow_tend( ztodt , cmfmc , cmfmc2 , &
use camsrfexch, only : cam_in_t

use constituents, only : pcnst, cnst_get_ind, cnst_get_type_byind
use hk_conv, only : cmfmca
use uwshcu, only : compute_uwshcu_inv

use time_manager, only : get_nstep, is_first_step
Expand Down Expand Up @@ -608,22 +560,6 @@ subroutine convect_shallow_tend( ztodt , cmfmc , cmfmc2 , &
flxprec(:ncol,:) = 0._r8
flxsnow(:ncol,:) = 0._r8

case('Hack') ! Hack scheme

lq(:) = .TRUE.
call physics_ptend_init( ptend_loc, state%psetcols, 'cmfmca', ls=.true., lq=lq ) ! Initialize local ptend type

call pbuf_get_field(pbuf, qpert_idx, qpert)
qpert(:ncol,2:pcnst) = 0._r8

call cmfmca( lchnk , ncol , &
nstep , ztodt , state%pmid , state%pdel , &
state%rpdel , state%zm , tpert , qpert , state%phis , &
pblh , state%t , state%q , ptend_loc%s , ptend_loc%q , &
cmfmc2 , rprdsh , cmfsl , cmflq , precc , &
qc2 , cnt2 , cnb2 , icwmr , rliq2 , &
state%pmiddry, state%pdeldry, state%rpdeldry )

case('UW') ! UW shallow convection scheme

! -------------------------------------- !
Expand Down Expand Up @@ -883,74 +819,6 @@ subroutine convect_shallow_tend( ztodt , cmfmc , cmfmc2 , &
! NOT perform below 'zm_conv_evap'. !
! ------------------------------------------------------------------------ !

if( shallow_scheme .eq. 'Hack' ) then

! ------------------------------------------------------------------------------- !
! Determine the phase of the precipitation produced and add latent heat of fusion !
! Evaporate some of the precip directly into the environment (Sundqvist) !
! Allow this to use the updated state1 and a fresh ptend_loc type !
! Heating and specific humidity tendencies produced !
! ------------------------------------------------------------------------------- !

! --------------------------------- !
! initialize ptend for next process !
! --------------------------------- !

lq(1) = .TRUE.
lq(2:) = .FALSE.
call physics_ptend_init(ptend_loc, state1%psetcols, 'shallow_hack', ls=.true., lq=lq)

call pbuf_get_field(pbuf, sh_flxprc_idx, flxprec )
call pbuf_get_field(pbuf, sh_flxsnw_idx, flxsnow )
call pbuf_get_field(pbuf, sh_cldliq_idx, sh_cldliq )
call pbuf_get_field(pbuf, sh_cldice_idx, sh_cldice )

sprd = 0._r8

!! clouds have no water... :)
sh_cldliq(:ncol,:) = 0._r8
sh_cldice(:ncol,:) = 0._r8

call zm_conv_evap( state1%ncol, state1%lchnk, &
state1%t, state1%pmid, state1%pdel, state1%q(:pcols,:pver,1), &
ptend_loc%s, tend_s_snwprd, tend_s_snwevmlt, &
ptend_loc%q(:pcols,:pver,1), &
rprdsh, cld, ztodt, &
precc, snow, ntprprd, ntsnprd , flxprec, flxsnow, sprd, .true.)

! ------------------------------------------ !
! record history variables from zm_conv_evap !
! ------------------------------------------ !

evapcsh(:ncol,:pver) = ptend_loc%q(:ncol,:pver,1)

ftem(:ncol,:pver) = ptend_loc%s(:ncol,:pver) / cpair
call outfld( 'EVAPTCM ' , ftem , pcols, lchnk )
ftem(:ncol,:pver) = tend_s_snwprd(:ncol,:pver) / cpair
call outfld( 'FZSNTCM ' , ftem , pcols, lchnk )
ftem(:ncol,:pver) = tend_s_snwevmlt(:ncol,:pver) / cpair
call outfld( 'EVSNTCM ' , ftem , pcols, lchnk )
call outfld( 'EVAPQCM ' , ptend_loc%q(1,1,1) , pcols, lchnk )
call outfld( 'PRECSH ' , precc , pcols, lchnk )
call outfld( 'HKFLXPRC' , flxprec , pcols, lchnk )
call outfld( 'HKFLXSNW' , flxsnow , pcols, lchnk )
call outfld( 'HKNTPRPD' , ntprprd , pcols, lchnk )
call outfld( 'HKNTSNPD' , ntsnprd , pcols, lchnk )
call outfld( 'HKEIHEAT' , ptend_loc%s , pcols, lchnk )

! ---------------------------------------------------------------- !
! Add tendency from this process to tend from other processes here !
! ---------------------------------------------------------------- !

call physics_ptend_sum( ptend_loc, ptend_all, ncol )
call physics_ptend_dealloc(ptend_loc)

! -------------------------------------------- !
! Do not perform evaporation process for UW-Cu !
! -------------------------------------------- !

end if

! ------------------------------------------------------------- !
! Update name of parameterization tendencies to send to tphysbc !
! ------------------------------------------------------------- !
Expand Down
14 changes: 8 additions & 6 deletions components/eam/src/physics/cam/macrop_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,14 @@ subroutine macrop_driver_init(pbuf2d)
CC_ni_idx = pbuf_get_index('CC_ni')
CC_qlst_idx = pbuf_get_index('CC_qlst')

dlfzm_idx = pbuf_get_index('DLFZM')
difzm_idx = pbuf_get_index('DIFZM')
dsfzm_idx = pbuf_get_index('DSFZM', err)
dnlfzm_idx = pbuf_get_index('DNLFZM', err)
dnifzm_idx = pbuf_get_index('DNIFZM', err)
dnsfzm_idx = pbuf_get_index('DNSFZM', err)
if (zm_param%zm_microp) then
dlfzm_idx = pbuf_get_index('DLFZM')
difzm_idx = pbuf_get_index('DIFZM')
dsfzm_idx = pbuf_get_index('DSFZM', err)
dnlfzm_idx = pbuf_get_index('DNLFZM', err)
dnifzm_idx = pbuf_get_index('DNIFZM', err)
dnsfzm_idx = pbuf_get_index('DNSFZM', err)
end if

if (micro_do_icesupersat) then
naai_idx = pbuf_get_index('NAAI')
Expand Down
Loading
Loading