Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
058e4e3
Remove info_dbug namelist variable
billsacks Nov 23, 2025
95cacb5
Add dbug_flag namelist setting
billsacks Nov 23, 2025
cbc1f0f
Merge pull request #608 from billsacks/dbug_flag
billsacks Nov 25, 2025
b469716
Changes ESMF version check to allow version 9+ in addition to 8.4+
briandobbins Dec 5, 2025
bea8cb4
Merge pull request #610 from briandobbins/esmf_v9_fix
jedwards4b Dec 5, 2025
a17f001
Add Meg Fowler as code owner of the atm-ocn flux code
billsacks Dec 5, 2025
0a22b18
Merge pull request #611 from billsacks/codeowners
billsacks Dec 5, 2025
3c04db5
add startTime argument to ESMF_TimeIntervalGet
alperaltuntas Dec 9, 2025
fefa047
specify name of the argument for starttime
alperaltuntas Dec 9, 2025
6539501
Merge pull request #614 from alperaltuntas/fix_monthly_hist
jedwards4b Dec 9, 2025
0fc855a
Copy shr_lnd2rof_tracers_mod from noresm branch
billsacks Dec 19, 2025
a2dca0c
Merge pull request #618 from billsacks/noresm_lnd2rof_tracers
billsacks Dec 19, 2025
548b80a
remove unneeded dependancy on shr_mpi_mod
jedwards4b Dec 20, 2025
91dfecc
sync with cdeps copy
jedwards4b Dec 20, 2025
3923b83
Merge pull request #619 from jedwards4b/remove_shr_mpi_dependance
jedwards4b Dec 22, 2025
1921680
Remove some unused behavior from med_methods_FB_init
billsacks Dec 5, 2025
b1b8d7b
Refactor med_methods_FB_init to allow handling of water tracer fields
billsacks Dec 23, 2025
a39d47d
For now, hard-code n_tracers = 0
billsacks Dec 24, 2025
529126f
Remove a duplicate block from esmFldsExchange_cesm_mod
billsacks Dec 29, 2025
f477c33
Merge pull request #622 from billsacks/remove_duplicate_flds_exchange
billsacks Dec 30, 2025
e9dc860
Add new file to CMakeLists.txt
billsacks Dec 30, 2025
889368b
Minor cleanup suggested in review
billsacks Dec 30, 2025
5a3d2b8
Rename a subroutine, as suggested in review
billsacks Dec 30, 2025
adca1fd
Refactor to use new shr_wtracers_is_wtracer_field function
billsacks Dec 31, 2025
2ec86d3
Add some comments
billsacks Dec 31, 2025
d60fbeb
Wrap shr_wtracers_mod
billsacks Dec 31, 2025
43e4594
Remove unused variable
billsacks Dec 31, 2025
8d3ff3a
Merge pull request #620 from billsacks/refactor_med_methods_fb_init
billsacks Jan 2, 2026
90fdf3c
Add a namelist variable, aofluxes_use_shr_wv_sat
billsacks Jan 2, 2026
511b5fe
Fix argument names to shr_wv_sat_qsat_liquid calls
billsacks Jan 3, 2026
0897f30
Put a conditional around the calculations of ssq
billsacks Jan 6, 2026
c10618b
Remove some commented-out code related to qsat calculation
billsacks Jan 8, 2026
bdfe9dd
Merge tag 'cmeps1.1.27' into noresm_merge_escomp
billsacks Jan 10, 2026
bbb2b4a
Merge tag 'cmeps1.1.28' into noresm_merge_escomp
billsacks Jan 10, 2026
0d1218f
Merge tag 'cmeps1.1.29' into noresm_merge_escomp
billsacks Jan 10, 2026
8ecf909
Merge tag 'cmeps1.1.31' into noresm_merge_escomp
billsacks Jan 11, 2026
a6f0ee5
Merge branch 'shr_flux_namelist' into noresm_merge_escomp
billsacks Jan 11, 2026
ba21bc3
Change aofluxes_use_shr_wv_sat to false for noresm
billsacks Jan 11, 2026
072da1c
Add use statements
billsacks Jan 11, 2026
a57506d
Change python 3.8 to 3.9 in srt testing
billsacks Jan 12, 2026
61537ac
Change srt python versions to 3.10 and 3.12
billsacks Jan 12, 2026
697bad4
Need quotes around 3.10 python version
billsacks Jan 12, 2026
799325e
Merge branch 'shr_flux_namelist' into noresm_merge_escomp
billsacks Jan 12, 2026
8556b1b
Write aofluxes_use_shr_wv_sat value to log file
billsacks Jan 12, 2026
4a9842a
Add some comments
billsacks Jan 12, 2026
16f28d8
Merge branch 'shr_flux_namelist' into noresm_merge_escomp
billsacks Jan 12, 2026
35f4fc1
Merge pull request #625 from billsacks/shr_flux_namelist
billsacks Jan 15, 2026
8099279
Merge branch 'main' into noresm_merge_escomp
billsacks Jan 15, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/srt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ 3.8, 3.11, 3.x ]
python-version: [ "3.10", 3.12, 3.x ]
env:
CC: mpicc
FC: mpifort
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/cesm/flux_atmocn/ @megandevlan
16 changes: 15 additions & 1 deletion cesm/flux_atmocn/flux_atmocn_COARE_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module flux_atmocn_COARE_mod
use shr_flux_mod, only : loc_stebol, loc_latvap, loc_g, loc_cpdair
use shr_flux_mod, only : td0, maxscl, alpha, use_coldair_outbreak_mod
use shr_const_mod, only : shr_const_rgas
use shr_wv_sat_mod, only: shr_wv_sat_qsat_liquid ! use saturation calculation consistent with CAM

implicit none
private
Expand All @@ -44,6 +45,7 @@ subroutine flux_atmOcn_COARE( &
ts, mask, seq_flux_atmocn_minwind, &
sen, lat, lwup, evap, &
taux ,tauy, tref, qref, &
aofluxes_use_shr_wv_sat, &
duu10n, ugust_out, u10res, &
ustar_sv, re_sv, ssq_sv)

Expand All @@ -52,6 +54,7 @@ subroutine flux_atmOcn_COARE( &
real(R8) , intent(in) :: spval
integer , intent(in) :: nMax ! data vector length
integer , intent(in) :: mask (nMax) ! ocn domain mask 0 <=> out of domain
logical , intent(in) :: aofluxes_use_shr_wv_sat ! use shr_wv_sat_mod to calculate qsat for atm-ocn flux calculations
real(R8) , intent(in) :: zbot (nMax) ! atm level height (m)
real(R8) , intent(in) :: ubot (nMax) ! atm u wind (m/s)
real(R8) , intent(in) :: vbot (nMax) ! atm v wind (m/s)
Expand Down Expand Up @@ -106,6 +109,8 @@ subroutine flux_atmOcn_COARE( &
real(R8) :: hsb,hlb ! sens & lat heat flxs at zbot
real(R8) :: tau ! stress at zbot
real(R8) :: trf,qrf,urf,vrf ! reference-height quantities
real(r8) :: esat_val ! value of esat (saturation vapor pressure) at this point
real(r8) :: qsat_val ! value of qsat (saturation specific humidity) at this point

!--- local functions --------------------------------
real(R8) :: qsat ! function: the saturation humididty of air (kg/m^3)
Expand Down Expand Up @@ -146,7 +151,16 @@ subroutine flux_atmOcn_COARE( &
vmag=vmag*vscl
endif
endif
ssq = 0.98_R8 * qsat(ts(n)) / rbot(n) ! sea surf hum (kg/kg)

if (aofluxes_use_shr_wv_sat) then
! This version uses a qsat calculation method consistent with what's used in CAM
call shr_wv_sat_qsat_liquid(ts(n), pslv(n), esat_val, qsat_val)
ssq = 0.98_R8 * qsat_val ! sea surf hum (kg/kg)
else
! This version uses the qsat calculation method that was used for many years,
! prior to Aug 2025, and which is still being used by default in NorESM
ssq = 0.98_R8 * qsat(ts(n)) / rbot(n) ! sea surf hum (kg/kg)
end if

call cor30a(ubot(n),vbot(n),tbot(n),qbot(n),rbot(n), & ! in atm params
us(n),vs(n),ts(n),ssq, & ! in surf params
Expand Down
14 changes: 6 additions & 8 deletions cesm/flux_atmocn/flux_atmocn_Diurnal_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module flux_atmocn_diurnal_mod
use shr_const_mod, only : shr_const_ocn_ref_sal, shr_const_zsrflyr, shr_const_rgas
use shr_sys_mod, only : shr_sys_abort
use flux_atmocn_COARE_mod, only : cor30a
use shr_wv_sat_mod, only : shr_wv_sat_qsat_liquid ! use saturation calculation consistent with CAM

implicit none
private
Expand Down Expand Up @@ -236,7 +235,8 @@ subroutine flux_atmOcn_diurnal( &
real(R8) :: tdiff(nMax) ! tbot - ts
real(R8) :: vscl

! NOTE: this should use the shr_wv_sat_qsat_liquid if this routine is ever used in production
! NOTE: this should use the shr_wv_sat_qsat_liquid if this routine is ever used in
! production (see https://github.com/ESCOMP/CMEPS/issues/624)
qsat(Tk) = 640380.0_R8 / exp(5107.4_R8/Tk)
cdn(Umps) = 0.0027_R8 / Umps + 0.000142_R8 + 0.0000764_R8 * Umps
psimhu(xd) = log((1.0_R8+xd*(2.0_R8+xd))*(1.0_R8+xd*xd)/8.0_R8) - 2.0_R8*atan(xd) + 1.571_R8
Expand Down Expand Up @@ -354,10 +354,9 @@ subroutine flux_atmOcn_diurnal( &
speed(n) = 0.0_R8
endif

! This should be changed to use the subroutine below
! This should be changed to use shr_wv_sat_qsat_liquid (see
! https://github.com/ESCOMP/CMEPS/issues/624)
ssq = 0.98_R8 * qsat(tBulk(n)) / rbot(n) ! sea surf hum (kg/kg)
! call shr_wv_sat_qsat_liquid(tBulk(n), pslv(n), qsat, ssq)
! ssq = 0.98_R8 * ssq ! sea surf hum (kg/kg)

delt = thbot(n) - tBulk(n) ! pot temp diff (K)
delq = qbot(n) - ssq ! spec hum dif (kg/kg)
Expand Down Expand Up @@ -503,10 +502,9 @@ subroutine flux_atmOcn_diurnal( &

!--need to update ssq,delt,delq as function of tBulk ----

! This should be changed to use the subroutine below
! This should be changed to use shr_wv_sat_qsat_liquid (see
! https://github.com/ESCOMP/CMEPS/issues/624)
ssq = 0.98_R8 * qsat(tBulk(n)) / rbot(n) ! sea surf hum (kg/kg)
! call shr_wv_sat_qsat_liquid(tBulk(n), pslv(n), qsat, ssq)
! ssq = 0.98_R8 * ssq ! sea surf hum (kg/kg)

delt = thbot(n) - tBulk(n) ! pot temp diff (K)
delq = qbot(n) - ssq ! spec hum dif (kg/kg)
Expand Down
17 changes: 15 additions & 2 deletions cesm/flux_atmocn/flux_atmocn_Large.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module flux_atmOcn_large_mod
use shr_flux_mod, only: flux_con_tol, flux_con_max_iter
use shr_flux_mod, only: alpha, maxscl, td0
use shr_sys_mod, only: shr_sys_abort
use shr_wv_sat_mod, only: shr_wv_sat_qsat_liquid ! use saturation calculation consistent with CAM

implicit none
public
Expand All @@ -41,7 +42,8 @@ subroutine flux_atmOcn_large( &
ts, mask, seq_flux_atmocn_minwind, &
sen, lat, lwup, evap, &
taux, tauy, tref, qref, &
add_gusts, duu10n, ugust_out, u10res, &
add_gusts, aofluxes_use_shr_wv_sat, &
duu10n, ugust_out, u10res, &
ustar_sv, re_sv, ssq_sv)

!--- input arguments --------------------------------
Expand All @@ -50,6 +52,7 @@ subroutine flux_atmOcn_large( &
integer ,intent(in) :: nMax ! data vector length
integer ,intent(in) :: mask (nMax) ! ocn domain mask 0 <=> out of domain
logical ,intent(in) :: add_gusts
logical ,intent(in) :: aofluxes_use_shr_wv_sat ! use shr_wv_sat_mod to calculate qsat for atm-ocn flux calculations
real(R8) ,intent(in) :: zbot (nMax) ! atm level height (m)
real(R8) ,intent(in) :: ubot (nMax) ! atm u wind (m/s)
real(R8) ,intent(in) :: vbot (nMax) ! atm v wind (m/s)
Expand Down Expand Up @@ -120,6 +123,8 @@ subroutine flux_atmOcn_large( &
real(R8) :: cp ! specific heat of moist air
real(R8) :: fac ! vertical interpolation factor
real(R8) :: wind0 ! resolved large-scale 10m wind (no gust added)
real(r8) :: esat_val ! value of esat (saturation vapor pressure) at this point
real(r8) :: qsat_val ! value of qsat (saturation specific humidity) at this point

!--- local functions --------------------------------
real(R8) :: qsat ! function: the saturation humididty of air (kg/m^3)
Expand Down Expand Up @@ -209,7 +214,15 @@ subroutine flux_atmOcn_large( &
endif
endif

ssq = 0.98_R8 * qsat(ts(n)) / rbot(n) ! sea surf hum (kg/kg)
if (aofluxes_use_shr_wv_sat) then
! This version uses a qsat calculation method consistent with what's used in CAM
call shr_wv_sat_qsat_liquid(ts(n), pslv(n), esat_val, qsat_val)
ssq = 0.98_R8 * qsat_val ! sea surf hum (kg/kg)
else
! This version uses the qsat calculation method that was used for many years,
! prior to Aug 2025, and which is still being used by default in NorESM
ssq = 0.98_R8 * qsat(ts(n)) / rbot(n) ! sea surf hum (kg/kg)
end if
delt = thbot(n) - ts(n) ! pot temp diff (K)
delq = qbot(n) - ssq ! spec hum dif (kg/kg)
alz = log(zbot(n)/zref)
Expand Down
8 changes: 6 additions & 2 deletions cesm/flux_atmocn/flux_atmocn_driver_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ subroutine flux_atmOcn_driver(logunit, nMax, &
sen, lat, lwup, evap, &
taux, tauy, tref, qref, &
ocn_surface_flux_scheme, &
add_gusts, duu10n, ugust_out, u10res, &
add_gusts, aofluxes_use_shr_wv_sat, &
duu10n, ugust_out, u10res, &
ustar_sv, re_sv, ssq_sv, missval)

!--- input arguments --------------------------------
integer , intent(in) :: logunit
integer , intent(in) :: nMax ! data vector length
integer , intent(in) :: mask (nMax) ! ocn domain mask 0 <=> out of domain
logical , intent(in) :: add_gusts
logical , intent(in) :: aofluxes_use_shr_wv_sat ! use shr_wv_sat_mod to calculate qsat for atm-ocn flux calculations
real(R8) , intent(in) :: zbot (nMax) ! atm level height (m)
real(R8) , intent(in) :: ubot (nMax) ! atm u wind (m/s)
real(R8) , intent(in) :: vbot (nMax) ! atm v wind (m/s)
Expand Down Expand Up @@ -94,7 +96,8 @@ subroutine flux_atmOcn_driver(logunit, nMax, &
ts, mask, seq_flux_atmocn_minwind, &
sen, lat, lwup, evap, &
taux, tauy, tref, qref, &
add_gusts, duu10n, ugust_out, u10res, &
add_gusts, aofluxes_use_shr_wv_sat, &
duu10n, ugust_out, u10res, &
ustar_sv=ustar_sv, re_sv=re_sv, ssq_sv=ssq_sv)

else if (ocn_surface_flux_scheme == ocn_flux_scheme_coare) then
Expand All @@ -107,6 +110,7 @@ subroutine flux_atmOcn_driver(logunit, nMax, &
ts, mask, seq_flux_atmocn_minwind, &
sen, lat, lwup, evap, &
taux, tauy, tref, qref, &
aofluxes_use_shr_wv_sat, &
duu10n, ugust_out, u10res, &
ustar_sv=ustar_sv, re_sv=re_sv, ssq_sv=ssq_sv)

Expand Down
9 changes: 4 additions & 5 deletions cesm/nuopc_cap_share/shr_lnd2rof_tracers_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ module shr_lnd2rof_tracers_mod
! lnd -> river communications
!========================================================================

use ESMF , only : ESMF_VMGetCurrent, ESMF_VM, ESMF_VMGet
use ESMF , only : ESMF_VMGetCurrent, ESMF_VM, ESMF_VMGet, ESMF_VMBroadcast
use ESMF , only : ESMF_LogFoundError, ESMF_LOGERR_PASSTHRU, ESMF_SUCCESS
use shr_sys_mod , only : shr_sys_abort
use shr_log_mod , only : shr_log_getLogUnit
use shr_kind_mod , only : r8 => shr_kind_r8, cs => shr_kind_cs
use shr_nl_mod , only : shr_nl_find_group_name
use shr_mpi_mod , only : shr_mpi_bcast

implicit none
private
Expand All @@ -34,7 +33,6 @@ subroutine shr_lnd2rof_tracers_readnl(NLFilename, lnd2rof_tracer_list)

!----- local -----
type(ESMF_VM) :: vm
integer :: i ! Indices
integer :: unitn ! namelist unit number
integer :: ierr ! error code
logical :: exists ! if file exists or not
Expand Down Expand Up @@ -84,8 +82,9 @@ subroutine shr_lnd2rof_tracers_readnl(NLFilename, lnd2rof_tracer_list)
close( unitn )
end if
end if
call shr_mpi_bcast( lnd2rof_tracers, mpicom )

call ESMF_VMBroadcast(vm, lnd2rof_tracers, CS, 0, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return

if (lnd2rof_tracers /= ' ') then
lnd2rof_tracer_list = trim(lnd2rof_tracers)
end if
Expand Down
18 changes: 18 additions & 0 deletions cesm/share_wrappers/wtracers_mod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module wtracers_mod

!-----------------------------------------------------------------------------
! This module wraps shr_wtracers_mod from the CESM_share repository to avoid direct
! dependencies on this share code from CMEPS.
!
! See also the version of wtracers_mod in the ufs directory for when we do not have
! access to the CESM_share library.
!-----------------------------------------------------------------------------

use shr_wtracers_mod, only : wtracers_is_wtracer_field => shr_wtracers_is_wtracer_field

implicit none
private

public :: wtracers_is_wtracer_field ! return true if the given field name is a water tracer field

end module wtracers_mod
1 change: 1 addition & 0 deletions cime_config/buildexe
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def _main_func():
if not skip_mediator:
out.write(os.path.join(cmeps_dir, "mediator") + "\n")
out.write(os.path.join(cmeps_dir, "cesm", "flux_atmocn") + "\n")
out.write(os.path.join(cmeps_dir, "cesm", "share_wrappers") + "\n")
out.write(os.path.join(cmeps_dir, "cesm", "driver") + "\n")

# build model executable
Expand Down
2 changes: 1 addition & 1 deletion cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ def buildnml(case, caseroot, component):
major = line[-2] if "MAJOR" in line else major
minor = line[-2] if "MINOR" in line else minor
logger.debug("ESMF version major {} minor {}".format(major, minor))
expect(int(major) >= 8 and int(minor) >=4, "ESMF version should be 8.4.1 or newer")
expect(int(major) >= 9 or (int(major) >= 8 and int(minor) >=4), "ESMF version should be 8.4.1 or newer")

confdir = os.path.join(case.get_value("CASEBUILD"), "cplconf")
if not os.path.isdir(confdir):
Expand Down
9 changes: 0 additions & 9 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2310,15 +2310,6 @@
<desc>determine if per ice thickness category fields are passed from ice to ocean - DO NOT EDIT (set by MOM6)</desc>
</entry>

<entry id="INFO_DBUG">
<type>integer</type>
<valid_values>0,1,2,3,4,5,6,7,8,9</valid_values>
<default_value>1</default_value>
<group>run_flags</group>
<file>env_run.xml</file>
<desc>level of debug output, 0=minimum, 1=normal, 2=more, 3=too much</desc>
</entry>

<!-- Prerun/postrun custom script options -->

<entry id="PRERUN_SCRIPT">
Expand Down
43 changes: 37 additions & 6 deletions cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -900,15 +900,27 @@
</values>
</entry>

<entry id="info_debug" modify_via_xml="INFO_DBUG">
<entry id="dbug_flag">
<type>integer</type>
<category>expdef</category>
<group>MED_attributes</group>
<desc>
Level of debug output, 0=minimum, 1=normal, 2=more, 3=too much (default: 1)
Level of debug output; higher values give progressively more output

Some example values (other values are also accepted)
- 0: no extra debug output
- 1: a bit of debug output
- 2: a bit more debug output
- 6: a moderate amount of debug output
- 11: a lot of debug output
- 21: a huge amount of debug output

Note that setting this to moderate - high values can lead to overwhelming amounts of output.

(Default: 0)
</desc>
<values>
<value>$INFO_DBUG</value>
<value>0</value>
</values>
</entry>

Expand Down Expand Up @@ -961,15 +973,34 @@
<group>MED_attributes</group>
<desc>
atm/ocn flux calculation scheme
0 : LARGE algorithm
1 : COARE algorithm
2 : UA algorithm

0: Large and Pond
1: COARE algorithm
2: UA algorithm
</desc>
<values>
<value>0</value>
<value COMP_OCN="blom" COMP_ATM="cam">1</value>
</values>
</entry>
<entry id="aofluxes_use_shr_wv_sat">
<type>logical</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
If true, use shr_wv_sat_mod to calculate qsat for atm-ocn flux calculations.

If false, use the older inline calculation of qsat, which uses a different
formulation.

(Currently only relevant for ocn_surface_flux_scheme = 0 or 1.)
</desc>
<values>
<!-- Once CIME_MODEL distinguishes between NorESM and CESM, this value will differ
between these two. -->
<value>.false.</value>
</values>
</entry>
<entry id="add_gusts">
<type>logical</type>
<category>control</category>
Expand Down
1 change: 1 addition & 0 deletions mediator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
project(cmeps Fortran)

set(SRCFILES esmFldsExchange_cesm_mod.F90 med_fraction_mod.F90
med_field_info_mod.F90
med_methods_mod.F90 med_phases_prep_ice_mod.F90
med_phases_restart_mod.F90 esmFldsExchange_hafs_mod.F90
med_internalstate_mod.F90 med_phases_aofluxes_mod.F90
Expand Down
Loading