Skip to content
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

Add scaling of DIB and DISMF by running mean of removed Antarctic ice runoff #109

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions cime_config/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
"SMS_D_Ld1.T62_oQU240wLI.GMPAS-IAF-PISMF.mpaso-impl_top_drag",
"SMS_D_Ld1.T62_oQU240.GMPAS-IAF.mpaso-harmonic_mean_drag",
"SMS_D_Ld1.T62_oQU240.GMPAS-IAF.mpaso-upwind_advection",
"ERS.ne30pg2_r05_IcoswISC30E3r5.CRYO1850-DISMF.mpaso-scaled_dib_dismf",
)
},

Expand Down
2 changes: 2 additions & 0 deletions components/mpas-ocean/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,8 @@ if (($OCN_ICEBERG eq 'true') && ($OCN_FORCING eq 'active_atm')) {
} else {
add_default($nl, 'config_remove_ais_ice_runoff', 'val'=>".false.");
}
add_default($nl, 'config_scale_dismf_by_removed_ice_runoff');
add_default($nl, 'config_ais_ice_runoff_history_days');

######################################
# Namelist group: shortwaveRadiation #
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@
<!-- coupling -->
<config_remove_ais_river_runoff>.false.</config_remove_ais_river_runoff>
<config_remove_ais_ice_runoff>.false.</config_remove_ais_ice_runoff>
<config_scale_dismf_by_removed_ice_runoff>.false.</config_scale_dismf_by_removed_ice_runoff>
<config_ais_ice_runoff_history_days>7301</config_ais_ice_runoff_history_days>

<!-- shortwaveRadiation -->
<config_sw_absorption_type>'jerlov'</config_sw_absorption_type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,22 @@ Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_scale_dismf_by_removed_ice_runoff" type="logical"
category="coupling" group="coupling">
Whether to scale data ice-shelf melt fluxes by the running mean of removed ice runoff.

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

<entry id="config_ais_ice_runoff_history_days" type="integer"
category="coupling" group="coupling">
The number of days over for which the history of removed AIS runoff is stored. The default is 7301 days (20 years + 1 day).

Valid values: Any positive integer
Default: Defined in namelist_defaults.xml
</entry>


<!-- shortwaveRadiation -->

Expand Down
3 changes: 2 additions & 1 deletion components/mpas-ocean/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def buildnml(case, caseroot, compname):
ic_prefix = 'mpaso.IcoswISC30E3r5.20231120+MARBL_ICfromOMIP_64levels'
eco_forcing_file = 'ecoForcingSurfaceMonthly.IcoswISC30E3r5.20231215.nc'
if ocn_ismf == 'data':
data_ismf_file = 'prescribed_ismf_paolo2023.IcoswISC30E3r5.20240227.nc'
data_ismf_file = 'prescribed_ismf_paolo2023.IcoswISC30E3r5.20240805.nc'
if ocn_tidal_mixing == 'true':
u_tidal_rms_file = 'velocityTidalRMS_CATS2008.IcoswISC30E3r5.20231120.nc'

Expand Down Expand Up @@ -1771,6 +1771,7 @@ def buildnml(case, caseroot, compname):
lines.append(' packages="dataLandIceFluxesPKG">')
lines.append(' <var name="dataLandIceFreshwaterFlux"/>')
lines.append(' <var name="dataLandIceHeatFlux"/>')
lines.append(' <var name="areaIntegAnnMeanDataIcebergIceShelfFreshwaterFlux"/>')
lines.append('</stream>')
lines.append('')

Expand Down
2 changes: 2 additions & 0 deletions components/mpas-ocean/cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
<default_value>constant</default_value>
<values>
<value compset="MPASO_">none</value>
<value compset="MPASO%IBDISMF_">none</value>
<value compset="MPASO%DISMF_">none</value>
<value compset="2000_DATM.*_MPASO%OECO">constant</value>
<value compset="1850_DATM.*_MPASO%OECO">constant</value>
<value compset="20TR_DATM.*_MPASO%OECO">diagnostic</value>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This testdef is used to test a stealth feature in mpaso and mpassi introduced
by PR #XXXX. It simply changes sets the following namelist option in mpaso
to true
config_scale_dismf_by_removed_ice_runoff
and the following namelist option in mpassi to true
config_scale_dib_by_removed_ice_runoff
These flags only makes sense to use in a B-case runs with data icebergs (DIB)
and data ice-shelf melt fluxes (DISMF).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config_scale_dismf_by_removed_ice_runoff = .true.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config_scale_dib_by_removed_ice_runoff = .true.
47 changes: 43 additions & 4 deletions components/mpas-ocean/driver/ocn_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module ocn_comp_mct
use ocn_config
use ocn_submesoscale_eddies
use ocn_eddy_parameterization_helpers
use ocn_scaled_dismf
!
! !PUBLIC MEMBER FUNCTIONS:
implicit none
Expand Down Expand Up @@ -214,6 +215,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )!{{{
character(len=StrKIND) :: iotype
logical :: streamsExists
integer :: mesh_iotype
logical :: ocn_c2_glcshelf

logical, pointer :: tempLogicalConfig
character(len=StrKIND), pointer :: tempCharConfig
Expand All @@ -222,11 +224,14 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )!{{{
logical, pointer :: config_use_CFCTracers
logical, pointer :: config_use_activeTracers_surface_restoring
logical, pointer :: config_use_surface_salinity_monthly_restoring
logical, pointer :: config_scale_dismf_by_removed_ice_runoff
character (len=StrKIND), pointer :: config_land_ice_flux_mode

! ssh coupling interval initialization
integer, pointer :: index_avgZonalSSHGradient, index_avgMeridionalSSHGradient
real (kind=RKIND), dimension(:,:), pointer :: avgSSHGradient
real (kind=RKIND), pointer :: &
runningMeanRemovedIceRunoff ! the area integrated, running mean of removed ice runoff from the ocean

#ifdef HAVE_MOAB
character*100 outfile, wopts
Expand Down Expand Up @@ -815,6 +820,9 @@ end subroutine xml_stream_get_attributes
call ocn_time_average_coupled_accumulate(statePool, forcingPool, 1)
block_ptr => block_ptr % next
end do

! initialize scaled data ice-shelf melt fluxes based on remove ice runoff
call ocn_init_scaled_dismf(domain)
end if

!-----------------------------------------------------------------------
Expand Down Expand Up @@ -860,6 +868,9 @@ end subroutine xml_stream_get_attributes
call ocn_time_average_coupled_accumulate(statePool, forcingPool, 1)
block_ptr => block_ptr % next
end do

! initialize scaled data ice-shelf melt fluxes based on remove ice runoff
call ocn_init_scaled_dismf(domain)
end if

call t_stopf ('mpaso_mct_init')
Expand All @@ -869,14 +880,25 @@ end subroutine xml_stream_get_attributes
trim(config_land_ice_flux_mode) == 'pressure_only' .or. &
trim(config_land_ice_flux_mode) == 'data' .or. &
trim(config_land_ice_flux_mode) == 'standalone' ) then
call seq_infodata_PutData( infodata, ocn_prognostic=.true., ocnrof_prognostic=.true., &
ocn_c2_glcshelf=.false.)
ocn_c2_glcshelf = .false.
else if ( trim(config_land_ice_flux_mode) .eq. 'coupled' ) then
call seq_infodata_PutData( infodata, ocn_prognostic=.true., ocnrof_prognostic=.true., &
ocn_c2_glcshelf=.true.)
ocn_c2_glcshelf = .true.
else
call mpas_log_write('ERROR: unknown land_ice_flux_mode: ' // trim(config_land_ice_flux_mode), MPAS_LOG_CRIT)
end if
call seq_infodata_PutData(infodata, ocn_prognostic=.true., ocnrof_prognostic=.true., &
ocn_c2_glcshelf=ocn_c2_glcshelf)

call mpas_pool_get_config(domain % configs, 'config_scale_dismf_by_removed_ice_runoff', &
config_scale_dismf_by_removed_ice_runoff)
if (config_scale_dismf_by_removed_ice_runoff) then
! independent of space so should be no need to loop over blocks
block_ptr => domain % blocklist
call mpas_pool_get_subpool(block_ptr % structs, 'forcing', forcingPool)
call MPAS_pool_get_array(forcingPool, "runningMeanRemovedIceRunoff", &
runningMeanRemovedIceRunoff)
call seq_infodata_PutData(infodata, rmean_rmv_ice_runoff=runningMeanRemovedIceRunoff)
end if

!-----------------------------------------------------------------------
!
Expand Down Expand Up @@ -987,12 +1009,15 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)!{{{
logical, pointer :: config_use_CFCTracers
logical, pointer :: config_use_activeTracers_surface_restoring
logical, pointer :: config_use_surface_salinity_monthly_restoring
logical, pointer :: config_scale_dismf_by_removed_ice_runoff
character (len=StrKIND), pointer :: config_restart_timestamp_name
character (len=StrKIND), pointer :: config_sw_absorption_type

! Added for coupling interval initialization
integer, pointer :: index_avgZonalSSHGradient, index_avgMeridionalSSHGradient
real (kind=RKIND), dimension(:,:), pointer :: avgSSHGradient
real (kind=RKIND), pointer :: &
runningMeanRemovedIceRunoff ! the area integrated, running mean of removed ice runoff from the ocean

#ifdef HAVE_MOAB
#ifdef MOABCOMP
Expand Down Expand Up @@ -1193,6 +1218,9 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)!{{{
block_ptr => block_ptr % next
end do

! update scaled data ice-shelf melt fluxes based on remove ice runoff
call ocn_update_scaled_dismf(domain)

if (debugOn) call mpas_log_write(' Computing analysis members')
call ocn_analysis_compute(domain_ptr, ierr)
if (iam==0.and.debugOn) then
Expand Down Expand Up @@ -1290,6 +1318,17 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)!{{{
#endif
call check_clocks_sync(domain % clock, Eclock, ierr)

call mpas_pool_get_config(domain % configs, 'config_scale_dismf_by_removed_ice_runoff', &
config_scale_dismf_by_removed_ice_runoff)
if (config_scale_dismf_by_removed_ice_runoff) then
! independent of space so should be no need to loop over blocks
block_ptr => domain % blocklist
call mpas_pool_get_subpool(block_ptr % structs, 'forcing', forcingPool)
call MPAS_pool_get_array(forcingPool, "runningMeanRemovedIceRunoff", &
runningMeanRemovedIceRunoff)
call seq_infodata_PutData(infodata, rmean_rmv_ice_runoff=runningMeanRemovedIceRunoff)
end if

! Reset I/O logs
call shr_file_setLogUnit (shrlogunit)
call shr_file_setLogLevel(shrloglev)
Expand Down
45 changes: 45 additions & 0 deletions components/mpas-ocean/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@
<dim name="nSubgridTableLevels" definition="namelist:config_subgrid_table_levels"
description="Number of subgrid look-up table levels"
/>
<dim name="nRemovedIceRunoffHistory" definition="namelist:config_ais_ice_runoff_history_days"
description="The number of days stored in the history of removed ice runoff."
/>
</dims>

<!--*************************************-->
Expand Down Expand Up @@ -774,6 +777,14 @@
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_option name="config_scale_dismf_by_removed_ice_runoff" type="logical" default_value=".false."
description="Whether to scale data ice-shelf melt fluxes by the running mean of removed ice runoff."
possible_values=".true. or .false."
/>
<nml_option name="config_ais_ice_runoff_history_days" type="integer" default_value="7301"
description="The number of days over for which the history of removed AIS runoff is stored. The default is 7301 days (20 years + 1 day)."
possible_values="Any positive integer"
/>
</nml_record>
<nml_record name="shortwaveRadiation" mode="init;forward">
<nml_option name="config_sw_absorption_type" type="character" default_value="none"
Expand Down Expand Up @@ -1683,6 +1694,7 @@
<package name="verticalRemapPKG" description="This package is for variables required for vertical Lagrangian remapping."/>
<package name="activeWavePKG" description="This package controls variables required for wave coupling"/>
<package name="subgridWetDryPKG" description="This package includes variables required for subgrid wetting and drying."/>
<package name="scaledDISMFPKG" description="This package includes variables required scaling data ice-shelf melt fluxes based on the running mean of removed ice runoff."/>
</packages>

<streams>
Expand Down Expand Up @@ -2009,6 +2021,11 @@
<var name="gotmDissTopOfCell"/>
<var name="gotmLengthTopOfCell"/>
<var name="pgf_sal"/>
<var name="nAccumulatedRemovedIceRunoff" packages="scaledDISMFPKG"/>
<var name="avgRemovedIceRunoff" packages="scaledDISMFPKG"/>
<var name="totalRemovedIceRunoffHistory" packages="scaledDISMFPKG"/>
<var name="nValidTotalRemovedIceRunoffHistory" packages="scaledDISMFPKG"/>
<var name="runningMeanRemovedIceRunoff" packages="scaledDISMFPKG"/>
</stream>

<stream name="output"
Expand Down Expand Up @@ -3776,6 +3793,30 @@
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="nAccumulatedRemovedIceRunoff" type="integer" dimensions="Time"
description="Number of accumulations in time averaging of removed ice runoff"
packages="scaledDISMFPKG"
/>
<var name="avgRemovedIceRunoff" type="real" dimensions="Time" units="kg s^-1"
description="The daily mean, area integrated value of removedIceRunoffFlux."
packages="scaledDISMFPKG"
/>
<var name="dailyAvgRemovedIceRunoff" type="real" dimensions="Time" units="kg s^-1"
description="The daily mean, area integrated value of removedIceRunoffFlux."
packages="scaledDISMFPKG"
/>
<var name="totalRemovedIceRunoffHistory" type="real" dimensions="nRemovedIceRunoffHistory Time" units="kg"
description="The history of avgRemovedIceRunoff, used to compute a running mean."
packages="scaledDISMFPKG"
/>
<var name="nValidTotalRemovedIceRunoffHistory" type="integer" dimensions="Time"
description="The number of valid days in dailyMeanRemovedIceRunoff, used in computing the running mean."
packages="scaledDISMFPKG"
/>
<var name="runningMeanRemovedIceRunoff" type="real" dimensions="Time" units="kg s^-1"
description="The running mean of dailyMeanRemovedIceRunoff, averaged over the nValidTotalRemovedIceRunoffHistory-1 valid entries"
packages="scaledDISMFPKG"
/>
<var name="rainFlux" type="real" dimensions="nCells Time" units="kg m^-2 s^-1"
description="Fresh water flux from rain at cell centers from coupler. Positive into the ocean."
/>
Expand Down Expand Up @@ -3968,6 +4009,10 @@
description="Flux of heat into the ocean at land ice-ocean interface, as read in from a forcing file. Positive into ocean."
packages="dataLandIceFluxesPKG"
/>
<var name="areaIntegAnnMeanDataIcebergIceShelfFreshwaterFlux" type="real" dimensions="Time" units="kg s^-1"
description="The area integrated, annually averaged freshwater flux into the ocean from both data icebergs and ice-shelf melting."
packages="scaledDISMFPKG"
/>

<!-- Input fields for forcing due to tides -->
<var name="tidalInputMask" type="real" dimensions="nCells"
Expand Down
13 changes: 13 additions & 0 deletions components/mpas-ocean/src/driver/mpas_ocn_core_interface.F
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function ocn_setup_packages(configPool, packagePool, iocontext) result(ierr)!{{{
logical, pointer :: verticalRemapPKGActive
logical, pointer :: activeWavePKGActive
logical, pointer :: subgridWetDryPKGActive
logical, pointer :: scaledDISMFPKGActive

type (mpas_pool_iterator_type) :: pkgItr
logical, pointer :: packageActive
Expand Down Expand Up @@ -174,6 +175,7 @@ function ocn_setup_packages(configPool, packagePool, iocontext) result(ierr)!{{{
logical, pointer :: config_use_gotm
logical, pointer :: config_use_active_wave
logical, pointer :: config_use_subgrid_wetting_drying
logical, pointer :: config_scale_dismf_by_removed_ice_runoff

character (len=StrKIND), pointer :: config_time_integrator
character (len=StrKIND), pointer :: config_ocean_run_mode
Expand Down Expand Up @@ -438,6 +440,17 @@ function ocn_setup_packages(configPool, packagePool, iocontext) result(ierr)!{{{
subgridWetDryPKGActive = .true.
end if

!
! test for scaling data ice-shelf melt fluxes by the running mean of removed ice runoff
!
call mpas_pool_get_package(packagePool, 'scaledDISMFPKGActive', scaledDISMFPKGActive)
call mpas_pool_get_config(configPool, &
'config_scale_dismf_by_removed_ice_runoff', &
config_scale_dismf_by_removed_ice_runoff)
if (config_scale_dismf_by_removed_ice_runoff) then
scaledDISMFPKGActive = .true.
end if

!
! call into analysis member driver to set analysis member packages
!
Expand Down
1 change: 1 addition & 0 deletions components/mpas-ocean/src/ocean.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ list(APPEND RAW_SOURCES
core_ocean/shared/mpas_ocn_stokes_drift.F
core_ocean/shared/mpas_ocn_manufactured_solution.F
core_ocean/shared/mpas_ocn_subgrid.F
core_ocean/shared/mpas_ocn_scaled_dismf.F
)

set(OCEAN_DRIVER
Expand Down
Loading