From cad417b94ed8a6fd01b103241028d6faebc91094 Mon Sep 17 00:00:00 2001 From: NJSchlegel Date: Mon, 4 Nov 2024 20:06:45 -0500 Subject: [PATCH 01/10] Commit for coupling of land to ocean adot --- .../drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 b/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 index 4076575cb6..67482b7e4c 100644 --- a/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 +++ b/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 @@ -201,6 +201,7 @@ module MOM_surface_forcing_gfdl !! ice-shelves, expressed as a coefficient !! for divergence damping, as determined !! outside of the ocean model [m3 s-1] + real, pointer, dimension(:,:) :: shelf_sfc_mass_flux =>NULL() !< mass flux to surface of ice sheet [kg m-2 s-1] integer :: xtype !< The type of the exchange - REGRID, REDIST or DIRECT type(coupler_2d_bc_type) :: fluxes !< A structure that may contain an array of named fields !! used for passive tracer fluxes. @@ -208,6 +209,7 @@ module MOM_surface_forcing_gfdl !! This flag may be set by the flux-exchange code, based on what !! the sea-ice model is providing. Otherwise, the value from !! the surface_forcing_CS is used. + logical :: Ice_Sheet_enabled = .false. !< Ice sheet adot is passed through the coupler end type ice_ocean_boundary_type integer :: id_clock_forcing !< A CPU time clock @@ -464,6 +466,10 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G, call check_mask_val_consistency(IOB%calving(i-i0,j-j0), G%mask2dT(i,j), i, j, 'calving', G) endif + if (associated(IOB%shelf_sfc_mass_flux)) then + fluxes%shelf_sfc_mass_flux(i,j) = kg_m2_s_conversion * IOB%shelf_sfc_mass_flux(i-i0,j-j0) + endif + if (associated(IOB%ustar_berg)) then fluxes%ustar_berg(i,j) = US%m_to_Z*US%T_to_s * IOB%ustar_berg(i-i0,j-j0) * G%mask2dT(i,j) if (CS%check_no_land_fluxes) & @@ -1795,6 +1801,10 @@ subroutine ice_ocn_bnd_type_chksum(id, timestep, iobt) chks = field_chksum( iobt%runoff ) ; if (root) write(outunit,100) 'iobt%runoff ', chks chks = field_chksum( iobt%calving ) ; if (root) write(outunit,100) 'iobt%calving ', chks chks = field_chksum( iobt%p ) ; if (root) write(outunit,100) 'iobt%p ', chks + if (associated(iobt%shelf_sfc_mass_flux)) then + chks = field_chksum( iobt%shelf_sfc_mass_flux ) ; if (root) write(outunit,100) 'iobt%shelf_sfc_mass_flux ',& + chks + endif if (associated(iobt%ustar_berg)) then chks = field_chksum( iobt%ustar_berg ) ; if (root) write(outunit,100) 'iobt%ustar_berg ', chks endif From 2198cb401e3e86d673cc3da0d8f59b0234441bf9 Mon Sep 17 00:00:00 2001 From: NJSchlegel Date: Tue, 19 Nov 2024 19:12:02 -0500 Subject: [PATCH 02/10] Remove unused ice sheet enabled flag --- config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 b/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 index 67482b7e4c..f8c46c8926 100644 --- a/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 +++ b/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 @@ -209,7 +209,6 @@ module MOM_surface_forcing_gfdl !! This flag may be set by the flux-exchange code, based on what !! the sea-ice model is providing. Otherwise, the value from !! the surface_forcing_CS is used. - logical :: Ice_Sheet_enabled = .false. !< Ice sheet adot is passed through the coupler end type ice_ocean_boundary_type integer :: id_clock_forcing !< A CPU time clock From e1b472a7d2b8d553c3e53e43a1434add80612799 Mon Sep 17 00:00:00 2001 From: NJSchlegel Date: Wed, 4 Dec 2024 19:00:47 -0500 Subject: [PATCH 03/10] add adot to Shelf restart --- src/ice_shelf/MOM_ice_shelf.F90 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90 index 99b5aeaa36..9843efaf41 100644 --- a/src/ice_shelf/MOM_ice_shelf.F90 +++ b/src/ice_shelf/MOM_ice_shelf.F90 @@ -2002,6 +2002,9 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init, 'ice shelf surface mass flux deposition from atmosphere', & 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) endif + CS%id_shelf_sfc_mass_flux = register_diag_field('ice_shelf_model', 'sfc_mass_flux', CS%diag%axesT1, CS%Time, & + 'ice shelf surface mass flux deposition from atmosphere', & + 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) ! Scalars (area integrated over all ice sheets) CS%id_vaf = register_scalar_field('ice_shelf_model', 'int_vaf', CS%diag%axesT1, CS%Time, & @@ -2232,6 +2235,10 @@ subroutine initialize_ice_shelf_fluxes(CS, ocn_grid, US, fluxes_in) deallocate(fluxes) endif + call register_restart_field(fluxes_in%shelf_sfc_mass_flux, "sfc_mass_flux", .true., CS%restart_CSp, & + "ice shelf surface mass flux deposition from atmosphere", & + 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) + end subroutine initialize_ice_shelf_fluxes !> Allocate and initialize the ice-shelf forcing elements of a mechanical forcing type. @@ -2351,8 +2358,8 @@ subroutine initialize_shelf_mass(G, param_file, CS, ISS, new_sim) end subroutine initialize_shelf_mass !> This subroutine applies net accumulation/ablation at the top surface to the dynamic ice shelf. -!>>acc_rate[m-s]=surf_mass_flux/density_ice is ablation/accumulation rate -!>>positive for accumulation negative for ablation +!! acc_rate[m-s]=surf_mass_flux/density_ice is ablation/accumulation rate +!! positive for accumulation negative for ablation subroutine change_thickness_using_precip(CS, ISS, G, US, fluxes, time_step, Time) type(ice_shelf_CS), intent(in) :: CS !< A pointer to the ice shelf control structure type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure. From 821dd6e4bd50a71aa80b0fefe607ec5cdbb0e1c4 Mon Sep 17 00:00:00 2001 From: NJSchlegel Date: Mon, 9 Dec 2024 00:19:01 -0500 Subject: [PATCH 04/10] Register sfc mass flux outside of initialize fluxes --- src/ice_shelf/MOM_ice_shelf.F90 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90 index 9843efaf41..7a3b0668d6 100644 --- a/src/ice_shelf/MOM_ice_shelf.F90 +++ b/src/ice_shelf/MOM_ice_shelf.F90 @@ -2181,7 +2181,12 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init, call MOM_IS_diag_mediator_close_registration(CS%diag) - if (present(fluxes_in)) call initialize_ice_shelf_fluxes(CS, ocn_grid, US, fluxes_in) + if (present(fluxes_in)) then + call initialize_ice_shelf_fluxes(CS, ocn_grid, US, fluxes_in) + call register_restart_field(fluxes_in%shelf_sfc_mass_flux, "sfc_mass_flux", .true., CS%restart_CSp, & + "ice shelf surface mass flux deposition from atmosphere", & + 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) + endif if (present(forces_in)) call initialize_ice_shelf_forces(CS, ocn_grid, US, forces_in) end subroutine initialize_ice_shelf @@ -2235,10 +2240,6 @@ subroutine initialize_ice_shelf_fluxes(CS, ocn_grid, US, fluxes_in) deallocate(fluxes) endif - call register_restart_field(fluxes_in%shelf_sfc_mass_flux, "sfc_mass_flux", .true., CS%restart_CSp, & - "ice shelf surface mass flux deposition from atmosphere", & - 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) - end subroutine initialize_ice_shelf_fluxes !> Allocate and initialize the ice-shelf forcing elements of a mechanical forcing type. From eebb0cfb5fc7f7eb0f8bafd7135b9fc886f441db Mon Sep 17 00:00:00 2001 From: OlgaSergienko <39838355+OlgaSergienko@users.noreply.github.com> Date: Mon, 13 Jan 2025 09:21:19 -0500 Subject: [PATCH 05/10] Gfdl cryo merge (#3) * Removed second registration of sfc_mass_flux with register_diag_field. * Registered sfc_mass_flux to runs with static and dynamic ice sheets. --- src/ice_shelf/MOM_ice_shelf.F90 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90 index 7a3b0668d6..9868f24aba 100644 --- a/src/ice_shelf/MOM_ice_shelf.F90 +++ b/src/ice_shelf/MOM_ice_shelf.F90 @@ -1998,13 +1998,11 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init, if (CS%active_shelf_dynamics) then CS%id_h_mask = register_diag_field('ice_shelf_model', 'h_mask', CS%diag%axesT1, CS%Time, & 'ice shelf thickness mask', 'none', conversion=1.0) - CS%id_shelf_sfc_mass_flux = register_diag_field('ice_shelf_model', 'sfc_mass_flux', CS%diag%axesT1, CS%Time, & - 'ice shelf surface mass flux deposition from atmosphere', & - 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) endif + CS%id_shelf_sfc_mass_flux = register_diag_field('ice_shelf_model', 'sfc_mass_flux', CS%diag%axesT1, CS%Time, & - 'ice shelf surface mass flux deposition from atmosphere', & - 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) + 'ice shelf surface mass flux deposition from atmosphere', & + 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) ! Scalars (area integrated over all ice sheets) CS%id_vaf = register_scalar_field('ice_shelf_model', 'int_vaf', CS%diag%axesT1, CS%Time, & From 60c634aa347e87db72fbe50b36eee46d2427fa89 Mon Sep 17 00:00:00 2001 From: Olga Sergienko Date: Mon, 27 Jan 2025 10:46:53 -0500 Subject: [PATCH 06/10] This commit removed the second registration of 'sfc_mass_flux' in 'register_diag_field()' --- src/ice_shelf/MOM_ice_shelf.F90 | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90 index 9868f24aba..2279a50fce 100644 --- a/src/ice_shelf/MOM_ice_shelf.F90 +++ b/src/ice_shelf/MOM_ice_shelf.F90 @@ -1962,9 +1962,6 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init, 'ice shelf thickness', 'm', conversion=US%Z_to_m) CS%id_dhdt_shelf = register_diag_field('ice_shelf_model', 'dhdt_shelf', CS%diag%axesT1, CS%Time, & 'change in ice shelf thickness over time', 'm s-1', conversion=US%Z_to_m*US%s_to_T) - CS%id_mass_flux = register_diag_field('ice_shelf_model', 'mass_flux', CS%diag%axesT1,& - CS%Time, 'Total mass flux of freshwater across the ice-ocean interface.', & - 'kg/s', conversion=US%RZ_T_to_kg_m2s*US%L_to_m**2) if (CS%const_gamma) then ! use ISOMIP+ eq. with rho_fw = 1000. kg m-3 meltrate_conversion = 86400.0*365.0*US%Z_to_m*US%s_to_T / (1000.0*US%kg_m3_to_R) From 9d7392489435bfa5f718162adc93a835ef933d7d Mon Sep 17 00:00:00 2001 From: Olga Sergienko Date: Mon, 3 Feb 2025 13:21:48 -0500 Subject: [PATCH 07/10] Testing shelf_sfc_mass_flux restart. --- src/ice_shelf/MOM_ice_shelf.F90 | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90 index 2279a50fce..dc792f6f60 100644 --- a/src/ice_shelf/MOM_ice_shelf.F90 +++ b/src/ice_shelf/MOM_ice_shelf.F90 @@ -1875,7 +1875,12 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init, CS%restart_output_dir = dirs%restart_output_dir - + if (present(fluxes_in)) then + call initialize_ice_shelf_fluxes(CS, ocn_grid, US, fluxes_in) + call register_restart_field(fluxes_in%shelf_sfc_mass_flux, "sfc_mass_flux", .true., CS%restart_CSp, & + "ice shelf surface mass flux deposition from atmosphere", & + 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) + endif if (new_sim .and. (.not. (CS%override_shelf_movement .and. CS%mass_from_file))) then ! This model is initialized internally or from a file. @@ -2176,12 +2181,12 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init, call MOM_IS_diag_mediator_close_registration(CS%diag) - if (present(fluxes_in)) then - call initialize_ice_shelf_fluxes(CS, ocn_grid, US, fluxes_in) - call register_restart_field(fluxes_in%shelf_sfc_mass_flux, "sfc_mass_flux", .true., CS%restart_CSp, & - "ice shelf surface mass flux deposition from atmosphere", & - 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) - endif +! if (present(fluxes_in)) then +! call initialize_ice_shelf_fluxes(CS, ocn_grid, US, fluxes_in) +! call register_restart_field(fluxes_in%shelf_sfc_mass_flux, "sfc_mass_flux", .true., CS%restart_CSp, & +! "ice shelf surface mass flux deposition from atmosphere", & +! 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) +! endif if (present(forces_in)) call initialize_ice_shelf_forces(CS, ocn_grid, US, forces_in) end subroutine initialize_ice_shelf From 2556cb4783bd3578805459a8ea808e470369e8e2 Mon Sep 17 00:00:00 2001 From: Olga Sergienko Date: Mon, 10 Feb 2025 14:06:26 -0500 Subject: [PATCH 08/10] The earlier removed 'register_diag_field()' for 'mass_flux' has been added back and 'register_restart_field()' of 'fluxes_in%shelf_sfc_mass_flux' is moved before 'restore_state()' --- src/ice_shelf/MOM_ice_shelf.F90 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90 index dc792f6f60..97df48a1ed 100644 --- a/src/ice_shelf/MOM_ice_shelf.F90 +++ b/src/ice_shelf/MOM_ice_shelf.F90 @@ -856,7 +856,7 @@ subroutine shelf_calc_flux(sfc_state_in, fluxes_in, Time, time_step_in, CS) if (CS%id_h_shelf > 0) call post_data(CS%id_h_shelf, ISS%h_shelf, CS%diag) if (CS%id_dhdt_shelf > 0) call post_data(CS%id_dhdt_shelf, ISS%dhdt_shelf, CS%diag) if (CS%id_h_mask > 0) call post_data(CS%id_h_mask,ISS%hmask,CS%diag) - call process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh_adott, dh_bdott) + if (CS%active_shelf_dynamics) call process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh_adott, dh_bdott) call disable_averaging(CS%diag) call cpu_clock_end(id_clock_shelf) @@ -2181,12 +2181,6 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init, call MOM_IS_diag_mediator_close_registration(CS%diag) -! if (present(fluxes_in)) then -! call initialize_ice_shelf_fluxes(CS, ocn_grid, US, fluxes_in) -! call register_restart_field(fluxes_in%shelf_sfc_mass_flux, "sfc_mass_flux", .true., CS%restart_CSp, & -! "ice shelf surface mass flux deposition from atmosphere", & -! 'kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) -! endif if (present(forces_in)) call initialize_ice_shelf_forces(CS, ocn_grid, US, forces_in) end subroutine initialize_ice_shelf From 5d021afa25bbf2c3d614644ecdbc8a3f1d56f841 Mon Sep 17 00:00:00 2001 From: Olga Sergienko Date: Mon, 10 Feb 2025 14:54:22 -0500 Subject: [PATCH 09/10] Corrected the line length error. --- src/ice_shelf/MOM_ice_shelf.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90 index 97df48a1ed..3ada09a200 100644 --- a/src/ice_shelf/MOM_ice_shelf.F90 +++ b/src/ice_shelf/MOM_ice_shelf.F90 @@ -856,7 +856,8 @@ subroutine shelf_calc_flux(sfc_state_in, fluxes_in, Time, time_step_in, CS) if (CS%id_h_shelf > 0) call post_data(CS%id_h_shelf, ISS%h_shelf, CS%diag) if (CS%id_dhdt_shelf > 0) call post_data(CS%id_dhdt_shelf, ISS%dhdt_shelf, CS%diag) if (CS%id_h_mask > 0) call post_data(CS%id_h_mask,ISS%hmask,CS%diag) - if (CS%active_shelf_dynamics) call process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh_adott, dh_bdott) + if (CS%active_shelf_dynamics) & + call process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh_adott, dh_bdott) call disable_averaging(CS%diag) call cpu_clock_end(id_clock_shelf) From 2f06732650836cc148b45d1e6e5db41d3944edff Mon Sep 17 00:00:00 2001 From: Olga Sergienko Date: Thu, 13 Feb 2025 16:04:13 -0500 Subject: [PATCH 10/10] Added back 'CS%id_mass_flux = register_diag_field()' --- src/ice_shelf/MOM_ice_shelf.F90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90 index 3ada09a200..2def8097ea 100644 --- a/src/ice_shelf/MOM_ice_shelf.F90 +++ b/src/ice_shelf/MOM_ice_shelf.F90 @@ -1968,6 +1968,9 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init, 'ice shelf thickness', 'm', conversion=US%Z_to_m) CS%id_dhdt_shelf = register_diag_field('ice_shelf_model', 'dhdt_shelf', CS%diag%axesT1, CS%Time, & 'change in ice shelf thickness over time', 'm s-1', conversion=US%Z_to_m*US%s_to_T) + CS%id_mass_flux = register_diag_field('ice_shelf_model', 'mass_flux', CS%diag%axesT1,& + CS%Time, 'Total mass flux of freshwater across the ice-ocean interface.', & + 'kg/s', conversion=US%RZ_T_to_kg_m2s*US%L_to_m**2) if (CS%const_gamma) then ! use ISOMIP+ eq. with rho_fw = 1000. kg m-3 meltrate_conversion = 86400.0*365.0*US%Z_to_m*US%s_to_T / (1000.0*US%kg_m3_to_R)