Skip to content
3 changes: 2 additions & 1 deletion config_src/drivers/FMS_cap/ocean_model_MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, wind_stagger, gas

!allocate(OS%sfc_state)
call allocate_surface_state(OS%sfc_state, OS%grid, use_temperature, do_integrals=.true., &
gas_fields_ocn=gas_fields_ocn, use_meltpot=use_melt_pot)
gas_fields_ocn=gas_fields_ocn, use_meltpot=use_melt_pot, &
use_iceshelves=OS%use_ice_shelf)

if (present(wind_stagger)) then
call surface_forcing_init(Time_in, OS%grid, OS%US, param_file, OS%diag, &
Expand Down
3 changes: 2 additions & 1 deletion config_src/drivers/STALE_mct_cap/mom_ocean_model_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
! Consider using a run-time flag to determine whether to do the diagnostic
! vertical integrals, since the related 3-d sums are not negligible in cost.
call allocate_surface_state(OS%sfc_state, OS%grid, use_temperature, &
do_integrals=.true., gas_fields_ocn=gas_fields_ocn, use_meltpot=use_melt_pot)
do_integrals=.true., gas_fields_ocn=gas_fields_ocn, &
use_meltpot=use_melt_pot, use_iceshelves=OS%use_ice_shelf)

call surface_forcing_init(Time_in, OS%grid, OS%US, param_file, OS%diag, &
OS%forcing_CSp, OS%restore_salinity, OS%restore_temp)
Expand Down
4 changes: 2 additions & 2 deletions config_src/drivers/nuopc_cap/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module MOM_cap_mod
use MOM_file_parser, only: get_param, log_version, param_file_type, close_param_file
use MOM_get_input, only: get_MOM_input, directories
use MOM_domains, only: pass_var, pe_here
use MOM_error_handler, only: MOM_error, FATAL, is_root_pe
use MOM_error_handler, only: MOM_error, FATAL, is_root_pe, WARNING
use MOM_grid, only: ocean_grid_type, get_global_grid_size
use MOM_ocean_model_nuopc, only: ice_ocean_boundary_type
use MOM_ocean_model_nuopc, only: ocean_model_restart, ocean_public_type, ocean_state_type
Expand Down Expand Up @@ -1347,7 +1347,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
frmt = "('ERROR: ESMF mesh and MOM6 domain masks are inconsistent! - "//&
"MOM n, maskMesh(n), mask(n) = ',3(i8,2x))"
write(err_msg, frmt)n,maskMesh(n),mask(n)
call MOM_error(FATAL, err_msg)
call MOM_error(WARNING, err_msg)
endif
end do

Expand Down
2 changes: 1 addition & 1 deletion config_src/drivers/nuopc_cap/mom_cap_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ subroutine mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock,
jg = j + ocean_grid%jsc - jsc
do i = isc, iec
ig = i + ocean_grid%isc - isc
omask(i,j) = nint(ocean_grid%mask2dT(ig,jg))
omask(i,j) = nint(ocean_grid%mask2dT(ig,jg)) - ceiling(ocean_state%fluxes%frac_shelf_h(ig,jg))
enddo
enddo

Expand Down
24 changes: 17 additions & 7 deletions config_src/drivers/nuopc_cap/mom_ocean_model_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ module MOM_ocean_model_nuopc
use MOM_verticalGrid, only : verticalGrid_type
use MOM_ice_shelf, only : initialize_ice_shelf, shelf_calc_flux, ice_shelf_CS
use MOM_ice_shelf, only : add_shelf_forces, ice_shelf_end, ice_shelf_save_restart
use MOM_ice_shelf, only : initialize_ice_shelf_fluxes, initialize_ice_shelf_forces
use MOM_ice_shelf, only : ice_shelf_query
use MOM_data_override, only : data_override_init
use MOM_coupler_types, only : coupler_1d_bc_type, coupler_2d_bc_type
use MOM_coupler_types, only : coupler_type_spawn, coupler_type_write_chksums
use MOM_coupler_types, only : coupler_type_initialized, coupler_type_copy_data
Expand Down Expand Up @@ -132,7 +135,7 @@ module MOM_ocean_model_nuopc
!> The ocean_state_type contains all information about the state of the ocean,
!! with a format that is private so it can be readily changed without disrupting
!! other coupled components.
type, public :: ocean_state_type ; private
type, public :: ocean_state_type
! This type is private, and can therefore vary between different ocean models.
logical :: is_ocean_PE = .false. !< True if this is an ocean PE.
type(time_type) :: Time !< The ocean model's time and master clock.
Expand Down Expand Up @@ -208,6 +211,7 @@ module MOM_ocean_model_nuopc
Ice_shelf_CSp => NULL() !< A pointer to the control structure for the
!! ice shelf model that couples with MOM6. This
!! is null if there is no ice shelf.
logical :: override_melt !< If true, override melt using data_override
type(marine_ice_CS), pointer :: &
marine_ice_CSp => NULL() !< A pointer to the control structure for the
!! marine ice effects module.
Expand Down Expand Up @@ -386,14 +390,20 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
! vertical integrals, since the related 3-d sums are not negligible in cost.
call allocate_surface_state(OS%sfc_state, OS%grid, use_temperature, &
do_integrals=.true., gas_fields_ocn=gas_fields_ocn, &
use_meltpot=use_melt_pot, use_marbl_tracers=OS%use_MARBL)
use_meltpot=use_melt_pot, use_iceshelves=OS%use_ice_shelf, &
use_marbl_tracers=OS%use_MARBL)

call surface_forcing_init(Time_in, OS%grid, OS%US, param_file, OS%diag, &
OS%forcing_CSp, OS%restore_salinity, OS%restore_temp, OS%use_waves)

if (OS%use_ice_shelf) then
call initialize_ice_shelf(param_file, OS%grid, OS%Time, OS%ice_shelf_CSp, &
OS%diag, Time_init, OS%dirs%output_directory, OS%forces, OS%fluxes)
OS%diag, Time_init, OS%dirs%output_directory)
call initialize_ice_shelf_fluxes(OS%ice_shelf_CSp, OS%grid, OS%US, OS%fluxes)
call initialize_ice_shelf_fluxes(OS%ice_shelf_CSp, OS%grid, OS%US, OS%flux_tmp)
call initialize_ice_shelf_forces(OS%ice_shelf_CSp, OS%grid, OS%US, OS%forces)
call ice_shelf_query(OS%ice_shelf_CSp, OS%grid, data_override_melt=OS%override_melt)
if (OS%override_melt) call data_override_init(Ocean_Domain_in=OS%grid%domain%mpp_domain)
endif
if (OS%icebergs_alter_ocean) then
call marine_ice_init(OS%Time, OS%grid, param_file, OS%diag, OS%marine_ice_CSp)
Expand Down Expand Up @@ -738,7 +748,7 @@ subroutine ocean_model_restart(OS, timestamp, restartname, stoch_restartname, nu
OS%dirs%restart_output_dir) ! Is this needed?
if (OS%use_ice_shelf) then
call ice_shelf_save_restart(OS%Ice_shelf_CSp, OS%Time, &
OS%dirs%restart_output_dir)
'./RESTART/') !OS%dirs%restart_output_dir)
endif
else
if (BTEST(OS%Restart_control,1)) then
Expand All @@ -747,7 +757,7 @@ subroutine ocean_model_restart(OS, timestamp, restartname, stoch_restartname, nu
call forcing_save_restart(OS%forcing_CSp, OS%grid, OS%Time, &
OS%dirs%restart_output_dir, time_stamped=.true.)
if (OS%use_ice_shelf) then
call ice_shelf_save_restart(OS%Ice_shelf_CSp, OS%Time, OS%dirs%restart_output_dir, .true.)
call ice_shelf_save_restart(OS%Ice_shelf_CSp, OS%Time, './RESTART/', .true.) ! OS%dirs%restart_output_dir, .true.)
endif
endif
if (BTEST(OS%Restart_control,0)) then
Expand All @@ -756,7 +766,7 @@ subroutine ocean_model_restart(OS, timestamp, restartname, stoch_restartname, nu
call forcing_save_restart(OS%forcing_CSp, OS%grid, OS%Time, &
OS%dirs%restart_output_dir)
if (OS%use_ice_shelf) then
call ice_shelf_save_restart(OS%Ice_shelf_CSp, OS%Time, OS%dirs%restart_output_dir)
call ice_shelf_save_restart(OS%Ice_shelf_CSp, OS%Time, './RESTART/') !OS%dirs%restart_output_dir)
endif
endif
endif
Expand Down Expand Up @@ -817,7 +827,7 @@ subroutine ocean_model_save_restart(OS, Time, directory, filename_suffix)
call forcing_save_restart(OS%forcing_CSp, OS%grid, Time, restart_dir)

if (OS%use_ice_shelf) then
call ice_shelf_save_restart(OS%Ice_shelf_CSp, OS%Time, OS%dirs%restart_output_dir)
call ice_shelf_save_restart(OS%Ice_shelf_CSp, OS%Time, './RESTART/') ! OS%dirs%restart_output_dir)
endif
end subroutine ocean_model_save_restart

Expand Down
Loading
Loading