Skip to content

Add MPAS-O and MPAS-SI from EarthWorksOrg/EarthWorks #569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 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
19 changes: 19 additions & 0 deletions cime_config/config_component_cesm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,22 @@
<!-- =================================================== -->
<value compset="_DATM.*_BLOM">24</value>
<value compset="_BLOM" grid="oi%tnx0.25v">48</value>
<value compset=".+" grid="a%mpasa480" >48</value>
<value compset=".+" grid="a%mpasa240" >48</value>
<value compset=".+" grid="a%mpasa120" >48</value>
<value compset=".+" grid="a%mpasa60" >96</value>
<value compset=".+" grid="a%mpasa30" >192</value>
<value compset=".+" grid="a%mpasa15" >360</value>
<value compset=".+" grid="a%mpasa7p5" >720</value>
<value compset=".+" grid="a%mpasa3p75" >1440</value>
<value compset="_MPAS" grid="a%mpasa480" >2</value>
<value compset="_MPAS" grid="a%mpasa240" >2</value>
<value compset="_MPAS" grid="a%mpasa120" >2</value>
<value compset="_MPAS" grid="a%mpasa60" >4</value>
<value compset="_MPAS" grid="a%mpasa30" >8</value>
<value compset="_MPAS" grid="a%mpasa15" >15</value>
<value compset="_MPAS" grid="a%mpasa7p5" >30</value>
<value compset="_MPAS" grid="a%mpasa3p75" >60</value>
</values>
<group>run_coupling</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -380,6 +396,7 @@
<default_value>8</default_value>
<values match="last">
<value compset="_DATM.*_MOM6.*_DROF" >$ATM_NCPL</value>
<value compset="_DATM.*_MPASO.*_DROF" >$ATM_NCPL</value>
<value compset="_DATM.*_BLOM.*_DROF" >$ATM_NCPL</value>
<value compset="_DATM.*_DOCN%SOM" >$ATM_NCPL</value>
<value compset="_DATM.*_SLND.*_DICE.*_DOCN" >$ATM_NCPL</value>
Expand All @@ -390,6 +407,7 @@
<value compset="_XATM.*_XLND.*_XICE.*_XOCN" >$ATM_NCPL</value>
<value compset="_DLND.*_CISM\d" >1</value>
<value compset="_XROF" >$ATM_NCPL</value>
<value compset="_MPAS" >$ATM_NCPL</value>
</values>
<group>run_coupling</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -418,6 +436,7 @@
<values match="last">
<value compset="DATM.+POP\d">TRUE</value>
<value compset="DATM.+MOM\d">TRUE</value>
<value compset="DATM.+MPASO">TRUE</value>
<value compset="DATM.+BLOM\d">TRUE</value>
<value compset="DATM.+DOCN%IAF">TRUE</value>
<value compset="DATM%CPLHIST.+POP\d">FALSE</value>
Expand Down
267 changes: 267 additions & 0 deletions mediator/esmFldsExchange_cesm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
use med_internalstate_mod , only : mapbilnr, mapconsf, mapconsd, mappatch, mappatch_uv3d, mapbilnr_nstod
use med_internalstate_mod , only : mapfcopy, mapnstod, mapnstod_consd, mapnstod_consf
use med_internalstate_mod , only : map_rof2ocn_ice, map_rof2ocn_liq
use med_internalstate_mod, only : ocn_name, ice_name
use esmFlds , only : addfld_ocnalb => med_fldList_addfld_ocnalb
use esmFlds , only : addfld_aoflux => med_fldList_addfld_aoflux
use esmFlds , only : addmap_aoflux => med_fldList_addmap_aoflux
Expand Down Expand Up @@ -1510,6 +1511,18 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
call addmrg_to(compatm, 'Si_vice', mrg_from=compice, mrg_fld='Si_vice', mrg_type='copy')
end if
end if
if (ice_name == 'mpassi') then
if (phase == 'advertise') then
call addfld_from(compice, 'Si_ithick')
call addfld_to(compatm, 'Si_ithick')
else
if ( fldchk(is_local%wrap%FBexp(compatm) , 'Si_ithick', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compice,compice), 'Si_ithick', rc=rc)) then
call addmap_from(compice, 'Si_ithick', compatm, mapconsf, 'ifrac', ice2atm_map)
call addmrg_to(compatm, 'Si_ithick', mrg_from=compice, mrg_fld='Si_ithick', mrg_type='copy')
end if
end if
end if
if (phase == 'advertise') then
call addfld_from(compice, 'Si_vsno')
call addfld_to(compatm, 'Si_vsno')
Expand Down Expand Up @@ -1785,6 +1798,22 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
call addmrg_to(compocn, 'Si_ifrac', mrg_from=compice, mrg_fld='Si_ifrac', mrg_type='copy')
end if

! ---------------------------------------------------------------------
! to ocn: seaice basal pressure
! ---------------------------------------------------------------------
if (ice_name == 'mpassi' .or. ocn_name == 'mpaso') then
if (phase == 'advertise') then
call addfld_from(compice, 'Si_bpress')
call addfld_to(compocn, 'Si_bpress')
else
if ( fldchk(is_local%wrap%FBImp(compice, compice), 'Si_bpress', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(compocn) , 'Si_bpress', rc=rc)) then
call addmap_from(compice, 'Si_bpress', compocn, mapfcopy, 'unset', 'unset')
call addmrg_to(compocn, 'Si_bpress', mrg_from=compice, mrg_fld='Si_bpress', mrg_type='copy')
end if
end if
end if

! ---------------------------------------------------------------------
! to ocn: downward longwave heat flux from atm
! to ocn: downward direct near-infrared incident solar radiation from atm
Expand Down Expand Up @@ -2518,6 +2547,229 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
call addmrg_to(compocn, 'Sw_lamult', mrg_from=compwav, mrg_fld='Sw_lamult', mrg_type='copy')
end if
end if
if (ocn_name == 'mpaso') then
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_Hs')
call addfld_to(compocn, 'Sw_Hs')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_Hs', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_Hs', rc=rc)) then
call addmap_from(compwav, 'Sw_Hs', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_Hs', mrg_from=compwav, mrg_fld='Sw_hs', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_Fp')
call addfld_to(compocn, 'Sw_Fp')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_Fp', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_Fp', rc=rc)) then
call addmap_from(compwav, 'Sw_Fp', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_Fp', mrg_from=compwav, mrg_fld='Sw_Fp', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_ustokes_wavenumber_1')
call addfld_to(compocn, 'Sw_ustokes_wavenumber_1')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_ustokes_wavenumber_1', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_ustokes_wavenumber_1', rc=rc)) then
call addmap_from(compwav, 'Sw_ustokes_wavenumber_1', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_ustokes_wavenumber_1', mrg_from=compwav, mrg_fld='Sw_ustokes_wavenumber_1', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_vstokes_wavenumber_1')
call addfld_to(compocn, 'Sw_vstokes_wavenumber_1')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_vstokes_wavenumber_1', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_vstokes_wavenumber_1', rc=rc)) then
call addmap_from(compwav, 'Sw_vstokes_wavenumber_1', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_vstokes_wavenumber_1', mrg_from=compwav, mrg_fld='Sw_lamult', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_ustokes_wavenumber_2')
call addfld_to(compocn, 'Sw_ustokes_wavenumber_2')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_ustokes_wavenumber_2', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_ustokes_wavenumber_2', rc=rc)) then
call addmap_from(compwav, 'Sw_ustokes_wavenumber_2', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_ustokes_wavenumber_2', mrg_from=compwav, mrg_fld='Sw_ustokes_wavenumber_2', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_vstokes_wavenumber_2')
call addfld_to(compocn, 'Sw_vstokes_wavenumber_2')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_vstokes_wavenumber_2', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_vstokes_wavenumber_2', rc=rc)) then
call addmap_from(compwav, 'Sw_vstokes_wavenumber_2', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_vstokes_wavenumber_2', mrg_from=compwav, mrg_fld='Sw_lamult', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_ustokes_wavenumber_3')
call addfld_to(compocn, 'Sw_ustokes_wavenumber_3')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_ustokes_wavenumber_3', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_ustokes_wavenumber_3', rc=rc)) then
call addmap_from(compwav, 'Sw_ustokes_wavenumber_3', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_ustokes_wavenumber_3', mrg_from=compwav, mrg_fld='Sw_ustokes_wavenumber_3', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_vstokes_wavenumber_3')
call addfld_to(compocn, 'Sw_vstokes_wavenumber_3')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_vstokes_wavenumber_3', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_vstokes_wavenumber_3', rc=rc)) then
call addmap_from(compwav, 'Sw_vstokes_wavenumber_3', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_vstokes_wavenumber_3', mrg_from=compwav, mrg_fld='Sw_lamult', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_ustokes_wavenumber_4')
call addfld_to(compocn, 'Sw_ustokes_wavenumber_4')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_ustokes_wavenumber_4', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_ustokes_wavenumber_4', rc=rc)) then
call addmap_from(compwav, 'Sw_ustokes_wavenumber_4', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_ustokes_wavenumber_4', mrg_from=compwav, mrg_fld='Sw_ustokes_wavenumber_4', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_vstokes_wavenumber_4')
call addfld_to(compocn, 'Sw_vstokes_wavenumber_4')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_vstokes_wavenumber_4', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_vstokes_wavenumber_4', rc=rc)) then
call addmap_from(compwav, 'Sw_vstokes_wavenumber_4', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_vstokes_wavenumber_4', mrg_from=compwav, mrg_fld='Sw_lamult', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_ustokes_wavenumber_5')
call addfld_to(compocn, 'Sw_ustokes_wavenumber_5')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_ustokes_wavenumber_5', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_ustokes_wavenumber_5', rc=rc)) then
call addmap_from(compwav, 'Sw_ustokes_wavenumber_5', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_ustokes_wavenumber_5', mrg_from=compwav, mrg_fld='Sw_ustokes_wavenumber_5', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_vstokes_wavenumber_5')
call addfld_to(compocn, 'Sw_vstokes_wavenumber_5')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_vstokes_wavenumber_5', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_vstokes_wavenumber_5', rc=rc)) then
call addmap_from(compwav, 'Sw_vstokes_wavenumber_5', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_vstokes_wavenumber_5', mrg_from=compwav, mrg_fld='Sw_lamult', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_ustokes_wavenumber_6')
call addfld_to(compocn, 'Sw_ustokes_wavenumber_6')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_ustokes_wavenumber_6', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_ustokes_wavenumber_6', rc=rc)) then
call addmap_from(compwav, 'Sw_ustokes_wavenumber_6', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_ustokes_wavenumber_6', mrg_from=compwav, mrg_fld='Sw_ustokes_wavenumber_6', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_vstokes_wavenumber_6')
call addfld_to(compocn, 'Sw_vstokes_wavenumber_6')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_vstokes_wavenumber_6', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_vstokes_wavenumber_6', rc=rc)) then
call addmap_from(compwav, 'Sw_vstokes_wavenumber_6', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_vstokes_wavenumber_6', mrg_from=compwav, mrg_fld='Sw_lamult', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_ustokes_wavenumber_6')
call addfld_to(compocn, 'Sw_ustokes_wavenumber_6')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_ustokes_wavenumber_6', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_ustokes_wavenumber_6', rc=rc)) then
call addmap_from(compwav, 'Sw_ustokes_wavenumber_6', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_ustokes_wavenumber_6', mrg_from=compwav, mrg_fld='Sw_ustokes_wavenumber_6', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_vstokes_wavenumber_6')
call addfld_to(compocn, 'Sw_vstokes_wavenumber_6')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_vstokes_wavenumber_6', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_vstokes_wavenumber_6', rc=rc)) then
call addmap_from(compwav, 'Sw_vstokes_wavenumber_6', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_vstokes_wavenumber_6', mrg_from=compwav, mrg_fld='Sw_lamult', mrg_type='copy')
end if
end if
!-----------------------------
! to ocn:
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_Dp')
call addfld_to(compocn, 'Sw_Dp')
else
if ( fldchk(is_local%wrap%FBExp(compocn) , 'Sw_Dp', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav, compwav), 'Sw_Dp', rc=rc)) then
call addmap_from(compwav, 'Sw_Dp', compocn, mapbilnr_nstod, 'one', wav2ocn_map)
call addmrg_to(compocn, 'Sw_Dp', mrg_from=compwav, mrg_fld='Sw_Dp', mrg_type='copy')
end if
end if
end if
!-----------------------------
! to ocn: Stokes drift u component from wave
!-----------------------------
Expand Down Expand Up @@ -3006,6 +3258,21 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
call addmrg_to(compice, 'Fioo_q', mrg_from=compocn, mrg_fld='Fioo_q', mrg_type='copy')
end if
end if
! ---------------------------------------------------------------------
! to ice: frazil from ocn
! ---------------------------------------------------------------------
if (ocn_name == 'mpaso' .or. ice_name == 'mpassi') then
if (phase == 'advertise') then
call addfld_from(compocn, 'Fioo_frazil')
call addfld_to(compice, 'Fioo_frazil')
else
if ( fldchk(is_local%wrap%FBImp(compocn, compocn), 'Fioo_frazil', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(compice) , 'Fioo_frazil', rc=rc)) then
call addmap_from(compocn, 'Fioo_frazil', compice, mapfcopy, 'unset', 'unset')
call addmrg_to(compice, 'Fioo_frazil', mrg_from=compocn, mrg_fld='Fioo_frazil', mrg_type='copy')
end if
end if
end if
!-----------------------------
! to ice: Ratio of ocean surface level abund. H2_16O/H2O/Rstd from ocean
!-----------------------------
Expand Down
Loading