Skip to content

Commit

Permalink
Add support for scaling DIB
Browse files Browse the repository at this point in the history
Most of the support is in place, just not the coupling between
MPAS-Ocean and MPAS-Seaice to pass `runningMeanRemovedIceRunoff`
  • Loading branch information
xylar committed Aug 9, 2024
1 parent a99433b commit 1da9fb6
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 10 deletions.
1 change: 1 addition & 0 deletions components/mpas-seaice/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,7 @@ if ($iceberg_mode eq 'data') {
} else {
add_default($nl, 'config_use_data_icebergs', 'val'=>"false");
}
add_default($nl, 'config_scale_dib_by_removed_ice_runoff');
add_default($nl, 'config_salt_flux_coupling_type');
add_default($nl, 'config_ice_ocean_drag_coefficient');

Expand Down
1 change: 1 addition & 0 deletions components/mpas-seaice/bld/build-namelist-section
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ add_default($nl, 'config_ocean_heat_transfer_type');
add_default($nl, 'config_sea_freezing_temperature_type');
add_default($nl, 'config_ocean_surface_type');
add_default($nl, 'config_use_data_icebergs');
add_default($nl, 'config_scale_dib_by_removed_ice_runoff');
add_default($nl, 'config_salt_flux_coupling_type');
add_default($nl, 'config_ice_ocean_drag_coefficient');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@
<config_sea_freezing_temperature_type>'mushy'</config_sea_freezing_temperature_type>
<config_ocean_surface_type>'free'</config_ocean_surface_type>
<config_use_data_icebergs>false</config_use_data_icebergs>
<config_scale_dib_by_removed_ice_runoff>false</config_scale_dib_by_removed_ice_runoff>
<config_salt_flux_coupling_type>'constant'</config_salt_flux_coupling_type>
<config_ice_ocean_drag_coefficient>0.00536</config_ice_ocean_drag_coefficient>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2686,6 +2686,14 @@ Valid values: true or false
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_scale_dib_by_removed_ice_runoff" type="logical"
category="ocean" group="ocean">
Whether to scale data iceberg fluxes by the running mean of removed ice runoff

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

<entry id="config_salt_flux_coupling_type" type="char*1024"
category="ocean" group="ocean">
Type of salt flux to ocean method
Expand Down
14 changes: 12 additions & 2 deletions components/mpas-seaice/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,10 @@
description="Use data iceberg meltwater forcing"
possible_values="true or false"
/>
<nml_option name="config_scale_dib_by_removed_ice_runoff" type="logical" default_value="false"
description="Whether to scale data iceberg fluxes by the running mean of removed ice runoff"
possible_values="true or false"
/>
<nml_option name="config_salt_flux_coupling_type" type="character" default_value="constant" units="unitless"
description="Type of salt flux to ocean method"
possible_values="'constant' or 'prognostic'"
Expand Down Expand Up @@ -2099,6 +2103,7 @@
<var name="testArrayRestartability"/>
<var name="forcingGroupNames"/>
<var name="forcingGroupRestartTimes"/>
<var name="runningMeanRemovedIceRunoff" packages="pkgScaledDIB"/>
</stream>

<stream name="restart"
Expand Down Expand Up @@ -4819,8 +4824,13 @@
packages="pkgScaledDIB"
description="The area integrated, annually averaged freshwater flux into the ocean from both data icebergs and ice-shelf melting."
/>


<var name="runningMeanRemovedIceRunoff"
type="real"
dimensions="Time"
units="kg s-1"
packages="pkgScaledDIB"
description="The running mean of removed Antarctic ice runoff, computed in MPAS-Ocean"
/>
</var_struct>

<!-- fluxes from icebergs to ocean -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module seaice_core_interface
use seaice_analysis_driver
use mpas_log, only: mpas_log_write

implicit none
public

contains
Expand Down Expand Up @@ -546,10 +547,10 @@ end subroutine setup_packages_column_physics!}}}
! routine setup_packages_bergs
!
!> \brief Setup icebergs package
!> \author Darin Comeau
!> \date 19 May 2017
!> \details This routine is intended to set the icebergs package PkgBergs
!> as active/deactive based on the namelist option config_use_bergs.
!> \author Darin Comeau, Xylar Asay-Davis
!> \date August 2024
!> \details This routine is intended to set the icebergs packages PkgBergs
!> and pkgScaledDIB as active/deactive based on the namelist options.
!
!-----------------------------------------------------------------------

Expand All @@ -561,10 +562,13 @@ subroutine setup_packages_bergs(configPool, packagePool, ierr)!{{{

! icebergs package
logical, pointer :: &
config_use_data_icebergs
config_use_data_icebergs, &
config_scale_dib_by_removed_ice_runoff


logical, pointer :: &
pkgBergsActive
pkgBergsActive, &
pkgScaledDIBActive

ierr = 0

Expand All @@ -576,6 +580,10 @@ subroutine setup_packages_bergs(configPool, packagePool, ierr)!{{{
call MPAS_pool_get_package(packagePool, "pkgBergsActive", pkgBergsActive)
pkgBergsActive = config_use_data_icebergs

call MPAS_pool_get_config(configPool, "config_scale_dib_by_removed_ice_runoff", config_scale_dib_by_removed_ice_runoff)
call MPAS_pool_get_package(packagePool, "pkgScaledDIBActive", pkgScaledDIBActive)
pkgScaledDIBActive = config_scale_dib_by_removed_ice_runoff

end subroutine setup_packages_bergs!}}}

!***********************************************************************
Expand Down
29 changes: 27 additions & 2 deletions components/mpas-seaice/src/shared/mpas_seaice_forcing.F
Original file line number Diff line number Diff line change
Expand Up @@ -3318,6 +3318,9 @@ subroutine get_data_iceberg_fluxes(domain)
berg_forcing, &
berg_fluxes

logical, pointer :: &
config_scale_dib_by_removed_ice_runoff

integer, pointer :: &
nCellsSolve

Expand All @@ -3326,14 +3329,36 @@ subroutine get_data_iceberg_fluxes(domain)
bergFreshwaterFlux, & ! iceberg freshwater flux for ocean (kg/m^2/s)
bergLatentHeatFlux ! iceberg latent heat flux for ocean (J/m^2/s)

real(kind=RKIND), pointer :: &
areaIntegAnnMeanDataIcebergIceShelfFreshwaterFlux, & ! area integrated, annual mean freshwater flux from icebegs and ice shelves (kg/s)
runningMeanRemovedIceRunoff ! the area integrated, running mean of removed ice runoff (kg/s)

integer :: &
iCell

real(kind=RKIND) :: &
scaling

! dc including as parameters here so as not to create new namelist options
real(kind=RKIND), parameter :: &
specificHeatFreshIce = 2106.0_RKIND, & ! specific heat of fresh ice J * kg^-1 * K^-1
bergTemperature = -4.0_RKIND ! iceberg temperature, assumed constant


call MPAS_pool_get_config(domain % configs, "config_scale_dib_by_removed_ice_runoff", &
config_scale_dib_by_removed_ice_runoff)

if (config_scale_dib_by_removed_ice_runoff) then
block => domain % blocklist
call MPAS_pool_get_subpool(block % structs, "berg_forcing", berg_forcing)
call mpas_pool_get_array(berg_forcing, 'runningMeanRemovedIceRunoff', runningMeanRemovedIceRunoff)
call mpas_pool_get_array(berg_forcing, 'areaIntegAnnMeanDataIcebergIceShelfFreshwaterFlux', &
areaIntegAnnMeanDataIcebergIceShelfFreshwaterFlux)
scaling = runningMeanRemovedIceRunoff / areaIntegAnnMeanDataIcebergIceShelfFreshwaterFlux
else
scaling = 1.0_RKIND
end if

block => domain % blocklist
do while (associated(block))

Expand All @@ -3349,8 +3374,8 @@ subroutine get_data_iceberg_fluxes(domain)

do iCell = 1, nCellsSolve

bergFreshwaterFlux(iCell) = bergFreshwaterFluxData(iCell)
bergLatentHeatFlux(iCell) = -bergFreshwaterFluxData(iCell) * &
bergFreshwaterFlux(iCell) = scaling * bergFreshwaterFluxData(iCell)
bergLatentHeatFlux(iCell) = -scaling * bergFreshwaterFluxData(iCell) * &
(seaiceLatentHeatMelting - specificHeatFreshIce*bergTemperature)

enddo
Expand Down

0 comments on commit 1da9fb6

Please sign in to comment.