@@ -171,6 +171,7 @@ module MOM
171171use MOM_offline_main, only : offline_fw_fluxes_into_ocean, offline_fw_fluxes_out_ocean
172172use MOM_offline_main, only : offline_advection_layer, offline_transport_end
173173use MOM_ice_shelf, only : ice_shelf_CS, ice_shelf_query, initialize_ice_shelf
174+ use MOM_ice_shelf, only : get_ice_shelf_mass_stock
174175use MOM_particles_mod, only : particles, particles_init, particles_run, particles_save_restart, particles_end
175176use MOM_particles_mod, only : particles_to_k_space, particles_to_z_space
176177implicit none ; private
@@ -4400,11 +4401,12 @@ subroutine get_MOM_state_elements(CS, G, GV, US, C_p, C_p_scaled, use_temp)
44004401end subroutine get_MOM_state_elements
44014402
44024403! > Find the global integrals of various quantities.
4403- subroutine get_ocean_stocks (CS , mass , heat , salt , on_PE_only )
4404+ subroutine get_ocean_stocks (CS , mass , heat , salt , ice_shelf_CSp , on_PE_only )
44044405 type (MOM_control_struct), intent (inout ) :: CS ! < MOM control structure
44054406 real , optional , intent (out ) :: heat ! < The globally integrated integrated ocean heat [J].
44064407 real , optional , intent (out ) :: salt ! < The globally integrated integrated ocean salt [kg].
44074408 real , optional , intent (out ) :: mass ! < The globally integrated integrated ocean mass [kg].
4409+ type (ice_shelf_CS), optional , pointer :: ice_shelf_CSp ! < A pointer to an ice shelf control structure
44084410 logical , optional , intent (in ) :: on_PE_only ! < If present and true, only sum on the local PE.
44094411
44104412 if (present (mass)) &
@@ -4415,6 +4417,9 @@ subroutine get_ocean_stocks(CS, mass, heat, salt, on_PE_only)
44154417 if (present (salt)) &
44164418 salt = 1.0e-3 * global_mass_integral(CS% h, CS% G, CS% GV, CS% tv% S, on_PE_only= on_PE_only, unscale= CS% US% S_to_ppt)
44174419
4420+ if (present (ice_shelf_CSp) .and. present (mass)) then ! add ice shelf contribution
4421+ mass = mass + CS% US% RZL2_to_kg * get_ice_shelf_mass_stock(ice_shelf_CSp, CS% G, CS% US, on_PE_only)
4422+ endif
44184423end subroutine get_ocean_stocks
44194424
44204425
0 commit comments