Skip to content

Commit a203993

Browse files
committed
Merge gfdl_cryo
Merge remote-tracking branch 'gfdl_cryo/dev/cryo' into gfdl_cryo_merge
2 parents 79b0b28 + a5c8502 commit a203993

8 files changed

Lines changed: 287 additions & 36 deletions

File tree

config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ module MOM_surface_forcing_gfdl
204204
!! for divergence damping, as determined
205205
!! outside of the ocean model [m3 s-1]
206206
real, pointer, dimension(:,:) :: shelf_sfc_mass_flux =>NULL() !< mass flux to surface of ice sheet [kg m-2 s-1]
207+
real :: IS_adot_int_land !< The total surface mass flux to the ice sheet from land,
208+
!! area-integrated over the land grid [kg s-1]
207209
integer :: xtype !< The type of the exchange - REGRID, REDIST or DIRECT
208210
type(coupler_2d_bc_type) :: fluxes !< A structure that may contain an array of named fields
209211
!! used for passive tracer fluxes.
@@ -678,6 +680,8 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
678680
! Allow for user-written code to alter fluxes after all the above
679681
call user_alter_forcing(sfc_state, fluxes, Time, G, CS%urf_CS)
680682

683+
fluxes%IS_adot_int_land = IOB%IS_adot_int_land / (US%RZL2_to_kg * US%s_to_T)
684+
681685
call cpu_clock_end(id_clock_forcing)
682686

683687
end subroutine convert_IOB_to_fluxes

config_src/drivers/FMS_cap/ocean_model_MOM.F90

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,9 +1039,17 @@ subroutine Ocean_stock_pe(OS, index, value, time_index)
10391039
select case (index)
10401040
case (ISTOCK_WATER) ! Return the mass of fresh water in the ocean in [kg].
10411041
if (OS%GV%Boussinesq) then
1042-
call get_ocean_stocks(OS%MOM_CSp, mass=value, on_PE_only=.true.)
1042+
if (OS%use_ice_shelf) then
1043+
call get_ocean_stocks(OS%MOM_CSp, mass=value, ice_shelf_CSp=OS%ice_shelf_CSp, on_PE_only=.true.)
1044+
else
1045+
call get_ocean_stocks(OS%MOM_CSp, mass=value, on_PE_only=.true.)
1046+
endif
10431047
else ! In non-Boussinesq mode, the mass of salt needs to be subtracted.
1044-
call get_ocean_stocks(OS%MOM_CSp, mass=value, salt=salt, on_PE_only=.true.)
1048+
if (OS%use_ice_shelf) then
1049+
call get_ocean_stocks(OS%MOM_CSp, mass=value, salt=salt, ice_shelf_CSp=OS%ice_shelf_CSp, on_PE_only=.true.)
1050+
else
1051+
call get_ocean_stocks(OS%MOM_CSp, mass=value, salt=salt, on_PE_only=.true.)
1052+
endif
10451053
value = value - salt
10461054
endif
10471055
case (ISTOCK_HEAT) ! Return the heat content of the ocean in [J].

src/core/MOM.F90

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ module MOM
171171
use MOM_offline_main, only : offline_fw_fluxes_into_ocean, offline_fw_fluxes_out_ocean
172172
use MOM_offline_main, only : offline_advection_layer, offline_transport_end
173173
use MOM_ice_shelf, only : ice_shelf_CS, ice_shelf_query, initialize_ice_shelf
174+
use MOM_ice_shelf, only : get_ice_shelf_mass_stock
174175
use MOM_particles_mod, only : particles, particles_init, particles_run, particles_save_restart, particles_end
175176
use MOM_particles_mod, only : particles_to_k_space, particles_to_z_space
176177
implicit none ; private
@@ -4400,11 +4401,12 @@ subroutine get_MOM_state_elements(CS, G, GV, US, C_p, C_p_scaled, use_temp)
44004401
end 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
44184423
end subroutine get_ocean_stocks
44194424

44204425

src/core/MOM_forcing_type.F90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ module MOM_forcing_type
212212
real :: saltFluxGlobalScl = 0. !< scaling of restoring salt flux to zero out global net ( -1..1 ) [nondim]
213213
real :: netFWGlobalScl = 0. !< scaling of net fresh water to zero out global net ( -1..1 ) [nondim]
214214

215+
real :: IS_adot_int_land = 0. !< The total surface mass flux to the ice sheet,
216+
!! area-integrated over the land grid [R Z L2 T-1 ~> kg s-1]
215217
logical :: fluxes_used = .true. !< If true, all of the heat, salt, and mass
216218
!! fluxes have been applied to the ocean.
217219
real :: dt_buoy_accum = -1.0 !< The amount of time over which the buoyancy fluxes
@@ -3827,8 +3829,7 @@ subroutine deallocate_forcing_type(fluxes)
38273829
if (associated(fluxes%ustar_tidal)) deallocate(fluxes%ustar_tidal)
38283830
if (associated(fluxes%ustar_shelf)) deallocate(fluxes%ustar_shelf)
38293831
if (associated(fluxes%iceshelf_melt)) deallocate(fluxes%iceshelf_melt)
3830-
if (associated(fluxes%shelf_sfc_mass_flux)) &
3831-
deallocate(fluxes%shelf_sfc_mass_flux)
3832+
if (associated(fluxes%shelf_sfc_mass_flux)) deallocate(fluxes%shelf_sfc_mass_flux)
38323833
if (associated(fluxes%frac_shelf_h)) deallocate(fluxes%frac_shelf_h)
38333834
if (associated(fluxes%ustar_berg)) deallocate(fluxes%ustar_berg)
38343835
if (associated(fluxes%area_berg)) deallocate(fluxes%area_berg)

0 commit comments

Comments
 (0)