Skip to content

Commit

Permalink
Separate removal of Antarctic river and ice runoff
Browse files Browse the repository at this point in the history
This is needed so so we can remove ice (solid) runoff but not
river (liquid) runoff.
  • Loading branch information
xylar committed Jun 23, 2024
1 parent a592f83 commit 5cb37fb
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 40 deletions.
5 changes: 3 additions & 2 deletions components/mpas-ocean/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,11 @@ add_default($nl, 'config_flux_attenuation_coefficient_runoff');
# Namelist group: coupling #
############################

add_default($nl, 'config_remove_ais_river_runoff');
if (($OCN_ICEBERG eq 'true') && ($OCN_FORCING eq 'active_atm')) {
add_default($nl, 'config_remove_AIS_coupler_runoff', 'val'=>".true.");
add_default($nl, 'config_remove_ais_ice_runoff', 'val'=>".true.");
} else {
add_default($nl, 'config_remove_AIS_coupler_runoff', 'val'=>".false.");
add_default($nl, 'config_remove_ais_ice_runoff', 'val'=>".false.");
}

######################################
Expand Down
3 changes: 2 additions & 1 deletion components/mpas-ocean/bld/build-namelist-section
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ add_default($nl, 'config_flux_attenuation_coefficient_runoff');
# Namelist group: coupling #
############################

add_default($nl, 'config_remove_AIS_coupler_runoff');
add_default($nl, 'config_remove_ais_river_runoff');
add_default($nl, 'config_remove_ais_ice_runoff');

######################################
# Namelist group: shortwaveRadiation #
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@
<config_flux_attenuation_coefficient_runoff>10.0</config_flux_attenuation_coefficient_runoff>

<!-- coupling -->
<config_remove_AIS_coupler_runoff>.false.</config_remove_AIS_coupler_runoff>
<config_remove_ais_river_runoff>.false.</config_remove_ais_river_runoff>
<config_remove_ais_ice_runoff>.false.</config_remove_ais_ice_runoff>

<!-- shortwaveRadiation -->
<config_sw_absorption_type>'jerlov'</config_sw_absorption_type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1191,9 +1191,17 @@ Default: Defined in namelist_defaults.xml

<!-- coupling -->

<entry id="config_remove_AIS_coupler_runoff" type="logical"
<entry id="config_remove_ais_river_runoff" type="logical"
category="coupling" group="coupling">
If true, solid and liquid runoff from the Antarctic Ice Sheet (below 60S latitude) coming from the coupled is zeroed in the coupler import routines. To be used with data iceberg fluxes coming from the sea ice model.
If true, liquid runoff from the Antarctic Ice Sheet (below 60S latitude) coming from the coupled is zeroed in the coupler import routines. To be used with data iceberg fluxes coming from the sea ice model.

Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_remove_ais_ice_runoff" type="logical"
category="coupling" group="coupling">
If true, solid runoff from the Antarctic Ice Sheet (below 60S latitude) coming from the coupled is zeroed in the coupler import routines. To be used with data iceberg fluxes coming from the sea ice model.

Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
Expand Down
68 changes: 46 additions & 22 deletions components/mpas-ocean/driver/ocn_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,8 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
config_use_MacroMoleculesTracers, &
config_use_MacroMoleculesTracers_sea_ice_coupling, &
config_use_CFCTracers, &
config_remove_AIS_coupler_runoff, &
config_remove_ais_river_runoff, &
config_remove_ais_ice_runoff, &
config_cvmix_kpp_use_theory_wave

character(len=StrKIND), pointer :: config_ecosys_atm_co2_option, &
Expand Down Expand Up @@ -1886,7 +1887,8 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
call mpas_pool_get_config(domain % configs, 'config_use_MacroMoleculesTracers_sea_ice_coupling', &
config_use_MacroMoleculesTracers_sea_ice_coupling)
call mpas_pool_get_config(domain % configs, 'config_use_CFCTracers', config_use_CFCTracers)
call mpas_pool_get_config(domain % configs, 'config_remove_AIS_coupler_runoff', config_remove_AIS_coupler_runoff)
call mpas_pool_get_config(domain % configs, 'config_remove_ais_river_runoff', config_remove_ais_river_runoff)
call mpas_pool_get_config(domain % configs, 'config_remove_ais_ice_runoff', config_remove_ais_ice_runoff)
call mpas_pool_get_config(domain % configs, 'config_cvmix_kpp_use_theory_wave', config_cvmix_kpp_use_theory_wave)

n = 0
Expand Down Expand Up @@ -2063,14 +2065,18 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
windSpeedSquared10mCFC => windSpeedSquared10mField % array
endif

if (config_remove_AIS_coupler_runoff) then
! Initialize these fields
if (config_remove_ais_river_runoff) then
! Initialize this field
removedRiverRunoffFlux(:) = 0.0_RKIND
endif

if (config_remove_ais_ice_runoff) then
! Initialize this field
removedIceRunoffFlux(:) = 0.0_RKIND
endif

if (config_cvmix_kpp_use_theory_wave) then
! Initialize these fields
! Initialize this field
windSpeed10m(:) = 0.0_RKIND
endif

Expand Down Expand Up @@ -2118,7 +2124,7 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
end if
if ( riverRunoffFluxField % isActive ) then
riverRunoffFlux(i) = x2o_o % rAttr(index_x2o_Foxx_rofl, n)
if (config_remove_AIS_coupler_runoff) then
if (config_remove_ais_river_runoff) then
if (latCell(i) < -1.04719666667_RKIND) then ! 60S in radians
removedRiverRunoffFlux(i) = riverRunoffFlux(i)
riverRunoffFlux(i) = 0.0_RKIND
Expand All @@ -2131,7 +2137,7 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
if(iceRunoffFlux(n) < 0.0_RKIND) then
call shr_sys_abort ('Error: incoming rofi_F is negative')
end if
if (config_remove_AIS_coupler_runoff) then
if (config_remove_ais_ice_runoff) then
if (latCell(i) < -1.04719666667_RKIND) then ! 60S in radians
removedIceRunoffFlux(i) = iceRunoffFlux(i)
iceRunoffFlux(i) = 0.0_RKIND
Expand Down Expand Up @@ -2692,7 +2698,8 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
real (kind=RKIND) :: surfaceFreezingTemp

logical, pointer :: frazilIceActive, &
config_remove_AIS_coupler_runoff, &
config_remove_ais_river_runoff, &
config_remove_ais_ice_runoff, &
config_use_ecosysTracers, &
config_use_DMSTracers, &
config_use_MacroMoleculesTracers, &
Expand All @@ -2709,7 +2716,8 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
call mpas_pool_get_package(domain % packages, 'frazilIceActive', frazilIceActive)
call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers', config_use_ecosysTracers)
call mpas_pool_get_config(domain % configs, 'config_land_ice_flux_mode', config_land_ice_flux_mode)
call mpas_pool_get_config(domain % configs, 'config_remove_AIS_coupler_runoff', config_remove_AIS_coupler_runoff)
call mpas_pool_get_config(domain % configs, 'config_remove_ais_river_runoff', config_remove_ais_river_runoff)
call mpas_pool_get_config(domain % configs, 'config_remove_ais_ice_runoff', config_remove_ais_ice_runoff)
call mpas_pool_get_config(domain % configs, 'config_use_DMSTracers', config_use_DMSTracers)
call mpas_pool_get_config(domain % configs, 'config_use_MacroMoleculesTracers', config_use_MacroMoleculesTracers)
call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers_sea_ice_coupling', &
Expand Down Expand Up @@ -2757,8 +2765,10 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux)
call mpas_pool_get_array(forcingPool, 'avgLandIceHeatFlux', avgLandIceHeatFlux)
endif
if (config_remove_AIS_coupler_runoff) then
if (config_remove_ais_river_runoff) then
call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux)
endif
if (config_remove_ais_ice_runoff) then
call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux)
call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffHeatFlux', avgRemovedIceRunoffHeatFlux)
endif
Expand Down Expand Up @@ -2819,8 +2829,10 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
o2x_o % rAttr(index_o2x_Foxo_ismw, n) = avgLandIceFreshwaterFlux(i)
o2x_o % rAttr(index_o2x_Foxo_ismh, n) = avgLandIceHeatFlux(i)
endif
if (config_remove_AIS_coupler_runoff) then
if (config_remove_ais_river_runoff) then
o2x_o % rAttr(index_o2x_Foxo_rrofl, n) = avgRemovedRiverRunoffFlux(i)
endif
if (config_remove_ais_ice_runoff) then
o2x_o % rAttr(index_o2x_Foxo_rrofi, n) = avgRemovedIceRunoffFlux(i)
o2x_o % rAttr(index_o2x_Foxo_rrofih, n) = avgRemovedIceRunoffHeatFlux(i)
endif
Expand Down Expand Up @@ -3218,7 +3230,8 @@ subroutine ocn_import_moab( Eclock, errorCode)!{{{
config_use_DMSTracers_sea_ice_coupling, &
config_use_MacroMoleculesTracers, &
config_use_MacroMoleculesTracers_sea_ice_coupling, &
config_remove_AIS_coupler_runoff, &
config_remove_ais_river_runoff, &
config_remove_ais_ice_runoff, &
config_cvmix_kpp_use_theory_wave

character(len=StrKIND), pointer :: config_ecosys_atm_co2_option, &
Expand Down Expand Up @@ -3365,7 +3378,8 @@ subroutine ocn_import_moab( Eclock, errorCode)!{{{
config_use_DMSTracers_sea_ice_coupling)
call mpas_pool_get_config(domain % configs, 'config_use_MacroMoleculesTracers_sea_ice_coupling', &
config_use_MacroMoleculesTracers_sea_ice_coupling)
call mpas_pool_get_config(domain % configs, 'config_remove_AIS_coupler_runoff', config_remove_AIS_coupler_runoff)
call mpas_pool_get_config(domain % configs, 'config_remove_ais_river_runoff', config_remove_ais_river_runoff)
call mpas_pool_get_config(domain % configs, 'config_remove_ais_ice_runoff', config_remove_ais_ice_runoff)
call mpas_pool_get_config(domain % configs, 'config_cvmix_kpp_use_theory_wave', config_cvmix_kpp_use_theory_wave)

n = 0
Expand Down Expand Up @@ -3503,14 +3517,18 @@ subroutine ocn_import_moab( Eclock, errorCode)!{{{
iceFluxDMSP => iceFluxDMSPField % array
endif

if (config_remove_AIS_coupler_runoff) then
! Initialize these fields
if (config_remove_ais_river_runoff) then
! Initialize this field
removedRiverRunoffFlux(:) = 0.0_RKIND
endif

if (config_remove_ais_ice_runoff) then
! Initialize this field
removedIceRunoffFlux(:) = 0.0_RKIND
endif

if (config_cvmix_kpp_use_theory_wave) then
! Initialize these fields
! Initialize this field
windSpeed10m(:) = 0.0_RKIND
endif

Expand Down Expand Up @@ -3559,7 +3577,7 @@ subroutine ocn_import_moab( Eclock, errorCode)!{{{
end if
if ( riverRunoffFluxField % isActive ) then
riverRunoffFlux(i) = x2o_om(n, index_x2o_Foxx_rofl)
if (config_remove_AIS_coupler_runoff) then
if (config_remove_ais_river_runoff) then
if (latCell(i) < -1.04719666667_RKIND) then ! 60S in radians
removedRiverRunoffFlux(i) = riverRunoffFlux(i)
riverRunoffFlux(i) = 0.0_RKIND
Expand All @@ -3572,7 +3590,7 @@ subroutine ocn_import_moab( Eclock, errorCode)!{{{
if(iceRunoffFlux(n) < 0.0_RKIND) then
call shr_sys_abort ('Error: incoming rofi_F is negative')
end if
if (config_remove_AIS_coupler_runoff) then
if (config_remove_ais_ice_runoff) then
if (latCell(i) < -1.04719666667_RKIND) then ! 60S in radians
removedIceRunoffFlux(i) = iceRunoffFlux(i)
iceRunoffFlux(i) = 0.0_RKIND
Expand Down Expand Up @@ -3988,7 +4006,8 @@ subroutine ocn_export_moab(EClock) !{{{
real (kind=RKIND) :: surfaceFreezingTemp

logical, pointer :: frazilIceActive, &
config_remove_AIS_coupler_runoff, &
config_remove_ais_river_runoff, &
config_remove_ais_ice_runoff, &
config_use_ecosysTracers, &
config_use_DMSTracers, &
config_use_MacroMoleculesTracers, &
Expand All @@ -4005,7 +4024,8 @@ subroutine ocn_export_moab(EClock) !{{{
call mpas_pool_get_package(domain % packages, 'frazilIceActive', frazilIceActive)
call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers', config_use_ecosysTracers)
call mpas_pool_get_config(domain % configs, 'config_land_ice_flux_mode', config_land_ice_flux_mode)
call mpas_pool_get_config(domain % configs, 'config_remove_AIS_coupler_runoff', config_remove_AIS_coupler_runoff)
call mpas_pool_get_config(domain % configs, 'config_remove_ais_river_runoff', config_remove_ais_river_runoff)
call mpas_pool_get_config(domain % configs, 'config_remove_ais_ice_runoff', config_remove_ais_ice_runoff)
call mpas_pool_get_config(domain % configs, 'config_use_DMSTracers', config_use_DMSTracers)
call mpas_pool_get_config(domain % configs, 'config_use_MacroMoleculesTracers', config_use_MacroMoleculesTracers)
call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers_sea_ice_coupling', &
Expand Down Expand Up @@ -4052,8 +4072,10 @@ subroutine ocn_export_moab(EClock) !{{{
call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux)
call mpas_pool_get_array(forcingPool, 'avgLandIceHeatFlux', avgLandIceHeatFlux)
endif
if (config_remove_AIS_coupler_runoff) then
if (config_remove_ais_river_runoff) then
call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux)
endif
if (config_remove_ais_ice_runoff) then
call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux)
call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffHeatFlux', avgRemovedIceRunoffHeatFlux)
endif
Expand Down Expand Up @@ -4113,8 +4135,10 @@ subroutine ocn_export_moab(EClock) !{{{
o2x_om(n, index_o2x_Foxo_ismw) = avgLandIceFreshwaterFlux(i)
o2x_om(n, index_o2x_Foxo_ismh) = avgLandIceHeatFlux(i)
endif
if (config_remove_AIS_coupler_runoff) then
if (config_remove_ais_river_runoff) then
o2x_om(n, index_o2x_Foxo_rrofl) = avgRemovedRiverRunoffFlux(i)
endif
if (config_remove_ais_ice_runoff) then
o2x_om(n, index_o2x_Foxo_rrofi) = avgRemovedIceRunoffFlux(i)
o2x_om(n, index_o2x_Foxo_rrofih) = avgRemovedIceRunoffHeatFlux(i)
endif
Expand Down
12 changes: 8 additions & 4 deletions components/mpas-ocean/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,12 @@
/>
</nml_record>
<nml_record name="coupling" mode="init;forward">
<nml_option name="config_remove_AIS_coupler_runoff" type="logical" default_value=".false."
description="If true, solid and liquid runoff from the Antarctic Ice Sheet (below 60S latitude) coming from the coupled is zeroed in the coupler import routines. To be used with data iceberg fluxes coming from the sea ice model."
<nml_option name="config_remove_ais_river_runoff" type="logical" default_value=".false."
description="If true, liquid runoff from the Antarctic Ice Sheet (below 60S latitude) coming from the coupled is zeroed in the coupler import routines. To be used with data iceberg fluxes coming from the sea ice model."
possible_values=".true. or .false."
/>
<nml_option name="config_remove_ais_ice_runoff" type="logical" default_value=".false."
description="If true, solid runoff from the Antarctic Ice Sheet (below 60S latitude) coming from the coupled is zeroed in the coupler import routines. To be used with data iceberg fluxes coming from the sea ice model."
possible_values=".true. or .false."
/>
</nml_record>
Expand Down Expand Up @@ -3761,15 +3765,15 @@
packages="thicknessBulkPKG"
/>
<var name="removedRiverRunoffFlux" type="real" dimensions="nCells Time" units="kg m^-2 s^-1"
description="Fresh water flux from river runoff from the coupler that was removed due to config_remove_AIS_coupler_runoff option. Positive into the ocean."
description="Fresh water flux from river runoff from the coupler that was removed due to config_remove_ais_river_runoff option. Positive into the ocean."
packages="thicknessBulkPKG"
/>
<var name="iceRunoffFlux" type="real" dimensions="nCells Time" units="kg m^-2 s^-1"
description="Fresh water flux from ice runoff at cell centers from coupler. Positive into the ocean."
packages="thicknessBulkPKG;activeTracersBulkRestoringPKG"
/>
<var name="removedIceRunoffFlux" type="real" dimensions="nCells Time" units="kg m^-2 s^-1"
description="Fresh water flux from ice runoff from the coupler that was removed due to config_remove_AIS_coupler_runoff option. Positive into the ocean."
description="Fresh water flux from ice runoff from the coupler that was removed due to config_remove_ais_ice_runoff option. Positive into the ocean."
packages="thicknessBulkPKG;activeTracersBulkRestoringPKG"
/>
<var name="rainFlux" type="real" dimensions="nCells Time" units="kg m^-2 s^-1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@
description="Fresh water flux from ice runoff from coupler. Positive into the ocean."
/>
<var name="accumulatedRemovedRiverRunoffFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from river runoff from the coupler that was removed due to config_remove_AIS_coupler_runoff option. Positive into the ocean."
description="Fresh water flux from river runoff from the coupler that was removed due to config_remove_ais_river_runoff option. Positive into the ocean."
packages="thicknessBulkPKG"
/>
<var name="accumulatedRemovedIceRunoffFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from ice runoff from the coupler that was removed due to config_remove_AIS_coupler_runoff option. Positive into the ocean."
description="Fresh water flux from ice runoff from the coupler that was removed due to config_remove_ais_ice_runoff option. Positive into the ocean."
packages="thicknessBulkPKG;activeTracersBulkRestoringPKG"
/>
<var name="accumulatedIcebergFlux" type="real" dimensions="Time" units="kg s^-1"
Expand Down
Loading

0 comments on commit 5cb37fb

Please sign in to comment.