Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
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
7 changes: 7 additions & 0 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,13 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files):
run_startdate = "".join(str(x) for x in case.get_value("RUN_STARTDATE").split("-"))
nmlgen.set_value("start_ymd", value=run_startdate)

# --------------------------------
# Overwrite: budget_table_version if atm computes enthalpy
# --------------------------------
component_computes_enthalpy_flux = nmlgen.get_value("component_computes_enthalpy_flux")
if 'atm' in component_computes_enthalpy_flux:
nmlgen.set_value("budget_table_version", value="v2")

# --------------------------------
# Overwrite: set tprof_option and tprof_n - if tprof_total is > 0
# --------------------------------
Expand Down
28 changes: 23 additions & 5 deletions cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,26 @@
</values>
</entry>

<!-- =========================================== -->
<!-- All components enthalpy computation -->
<!-- =========================================== -->

<entry id="component_computes_enthalpy_flux">
<type>char</type>
<category>control</category>
<group>ALLCOMP_attributes</group>
<valid_values>none,atm,med</valid_values>
<desc>
if none, no enthaply flux is computed to send to the ocean,
if atm, the atm (in this case cam) computes enthalpy to send to the ocn (in this case BLOM)
if med, the mediator computes computes enthalpy to send to the ocn (in this case MOM6)
</desc>
<values>
<value>none</value>
<value comp_ocn="mom6" comp_atm="cam">med</value>
</values>
</entry>

<!-- =========================================== -->
<!-- MED general attributes -->
<!-- =========================================== -->
Expand Down Expand Up @@ -980,14 +1000,13 @@
<type>char</type>
<category>budget</category>
<group>MED_attributes</group>
<valid_values>v0,v1</valid_values>
<valid_values>v0,v1,v2</valid_values>
<desc>
currently v0 refers to budgets using POP and v1 refers to budgets using MOM6
currently v0 refers to budgets using BLOM and v1 refers to budgets using MOM6
</desc>
<values>
<value>v0</value>
<value comp_ocn="mom">v1</value>
<value comp_ocn="pop">v0</value>
</values>
</entry>

Expand Down Expand Up @@ -2462,10 +2481,9 @@
<category>expdef</category>
<group>ALLCOMP_attributes</group>
<desc>
index of scalar containing epbal precipitation factor from ocn (only for POP)
index of scalar containing epbal precipitation factor from ocn (only for BLOM)
</desc>
<values>
<value COMP_OCN="pop">4</value>
<value COMP_OCN="blom">4</value>
<value>0</value>
</values>
Expand Down
44 changes: 37 additions & 7 deletions mediator/esmFldsExchange_cesm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1315,9 +1315,10 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)

if (phase == 'advertise') then
call addfld_to(compatm, 'Faxx_evap')
call addfld_to(compatm, 'Faox_evap')
call addfld_from(complnd, 'Fall_evap')
call addfld_from(compice, 'Faii_evap')
call addfld_aoflux( 'Faox_evap')
call addfld_aoflux('Faox_evap')
else
if (fldchk(is_local%wrap%FBexp(compatm), 'Faxx_evap', rc=rc)) then
if ( fldchk(is_local%wrap%FBImp(complnd,complnd), 'Fall_evap', rc=rc)) then
Expand All @@ -1336,6 +1337,8 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
end if
call addmrg_to(compatm , 'Faxx_evap', &
mrg_from=compmed, mrg_fld='Faox_evap', mrg_type='merge', mrg_fracname='ofrac')
! unmerged aoflux-only for correct hevap to ocean in cam_out
call addmrg_to(compatm, 'Faox_evap', mrg_from=compmed, mrg_fld='Faox_evap', mrg_type='copy')
end if
end if
end if
Expand Down Expand Up @@ -1892,6 +1895,33 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
mrg_from=compatm, mrg_fld='Faxa_swdn', mrg_type='copy')
end if
end if
!----------------------------------------------------------------------
! to ocn: downward material enthalpy flux from atm
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld_from(compatm, 'Faxa_hmat')
call addfld_to (compocn, 'Faxa_hmat')
call addfld_to (compocn, 'Faxa_hmat_oa') ! handled in prep_ocn
call addfld_from(compatm, 'Faxa_hlat')
call addfld_to (compocn, 'Faxa_hlat')
call addfld_to (compatm, 'Faxx_hrof') ! enthalpy of runoff, computed in med_phases_prep_ocn
else
if (fldchk(is_local%wrap%FBImp(compatm, compatm), 'Faxa_hmat', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(compocn) , 'Faxa_hmat', rc=rc)) then
call addmap_from(compatm, 'Faxa_hmat', compocn, mapconsf, 'one', atm2ocn_map)
call addmrg_to (compocn, 'Faxa_hmat', mrg_from=compatm ,mrg_fld='Faxa_hmat' &
, mrg_type='copy_with_weights', mrg_fracname='ofrac')
end if
if (fldchk(is_local%wrap%FBImp(compatm, compatm), 'Faxa_hlat', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(compocn) , 'Faxa_hlat', rc=rc)) then
call addmap_from(compatm, 'Faxa_hlat', compocn, mapconsf, 'one', atm2ocn_map)
call addmrg_to (compocn, 'Faxa_hlat', mrg_from=compatm ,mrg_fld='Faxa_hlat' &
, mrg_type='copy_with_weights', mrg_fracname='ofrac')
end if
!if (fldchk(is_local%wrap%FBExp(compatm),'Faxx_hrof', rc=rc)) &
! call addmap_from(compocn, 'Faxx_hrof', compatm, mapconsf, 'one', atm2ocn_map)
end if

! ---------------------------------------------------------------------
! to ocn: net shortwave radiation from med
! ---------------------------------------------------------------------
Expand Down Expand Up @@ -1932,15 +1962,15 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
end if

! import sw from atm by bands
if ( fldchk(is_local%wrap%FBImp(compatm,compatm), 'Faxa_swvdr', rc=rc) .and. &
if ((fldchk(is_local%wrap%FBImp(compatm,compatm), 'Faxa_swvdr', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compatm,compatm), 'Faxa_swvdf', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compatm,compatm), 'Faxa_swndr', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compatm,compatm), 'Faxa_swndr', rc=rc) .and. &
(fldchk(is_local%wrap%FBExp(compocn), 'Foxx_swnet' , rc=rc)) .or. &
(fldchk(is_local%wrap%FBExp(compocn), 'Foxx_swnet_vdr', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(compocn), 'Foxx_swnet_vdf', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(compocn), 'Foxx_swnet_idr', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(compocn), 'Foxx_swnet_idf', rc=rc))) then
fldchk(is_local%wrap%FBExp(compocn) , 'Foxx_swnet', rc=rc)) .or. &
(fldchk(is_local%wrap%FBExp(compocn), 'Foxx_swnet_vdr', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(compocn), 'Foxx_swnet_vdf', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(compocn), 'Foxx_swnet_idr', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(compocn), 'Foxx_swnet_idf', rc=rc))) then
call addmap_from(compatm, 'Faxa_swvdr', compocn, mapconsf, 'one', atm2ocn_map)
call addmap_from(compatm, 'Faxa_swvdf', compocn, mapconsf, 'one', atm2ocn_map)
call addmap_from(compatm, 'Faxa_swndr', compocn, mapconsf, 'one', atm2ocn_map)
Expand Down
25 changes: 24 additions & 1 deletion mediator/fd_cesm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,25 @@
alias: mean_down_lw_flx
canonical_units: W m-2
description: atm import to med
mean downward SW heat flux
mean downward LW heat flux
#
- standard_name: Faxa_hmat
alias: mean_down_hmat
canonical_units: W m-2
description: atm import to med
mean downward material enthalpy flux
#
- standard_name: Faxa_hlat
alias: mean_down_hlat
canonical_units: W m-2
description: atm import to med
variable latent heat part of mat.enth.flx
#
- standard_name: Faxa_hmat_oa
alias: mean_down_hmat_oa
canonical_units: W m-2
description: med export to ocn
mean downw. mat. enth. flux, ocean average
#
- standard_name: Faxa_ndep
canonical_units: kg(N)/m2/sec
Expand Down Expand Up @@ -1017,6 +1035,11 @@
canonical_units: W m-2
description: med export to ocn heat content of condensation
#
- standard_name: Faxx_hrof
alias: heat_content_rof
canonical_units: W m-2
description: med export to atm gl.avg. of mat.enthalpy of runoff
#
- standard_name: Foxx_hrofl
alias: heat_content_rofl
canonical_units: W m-2
Expand Down
Loading