Skip to content

Commit

Permalink
Add diag_manager_set_time_end calls to the solo drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriel Ramirez authored and marshallward committed May 30, 2024
1 parent 705a384 commit 7305528
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions config_src/drivers/ice_solo_driver/ice_shelf_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ program Shelf_main
use MOM_debugging, only : MOM_debugging_init
use MOM_diag_mediator, only : diag_mediator_init, diag_mediator_infrastructure_init, set_axes_info
use MOM_diag_mediator, only : diag_mediator_end, diag_ctrl, diag_mediator_close_registration
use MOM_diag_manager_infra, only : diag_manager_set_time_end_infra
use MOM_domains, only : MOM_infra_init, MOM_infra_end
use MOM_domains, only : MOM_domains_init, clone_MOM_domain, pass_var
use MOM_dyn_horgrid, only : dyn_horgrid_type, create_dyn_horgrid, destroy_dyn_horgrid
Expand Down Expand Up @@ -325,6 +326,8 @@ program Shelf_main
Time_end = daymax
endif

call diag_manager_set_time_end_infra (Time_end)

if (Time >= Time_end) call MOM_error(FATAL, &
"Shelf_driver: The run has been started at or after the end time of the run.")

Expand Down
3 changes: 3 additions & 0 deletions config_src/drivers/solo_driver/MOM_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ program MOM6
use MOM_cpu_clock, only : CLOCK_COMPONENT
use MOM_data_override, only : data_override_init
use MOM_diag_mediator, only : diag_mediator_end, diag_ctrl, diag_mediator_close_registration
use MOM_diag_manager_infra, only : diag_manager_set_time_end_infra
use MOM, only : initialize_MOM, step_MOM, MOM_control_struct, MOM_end
use MOM, only : extract_surface_state, finish_MOM_initialization
use MOM, only : get_MOM_state_elements, MOM_state_is_synchronized
Expand Down Expand Up @@ -375,6 +376,8 @@ program MOM6
Time_end = daymax
endif

call diag_manager_set_time_end_infra(Time_end)

call get_param(param_file, mod_name, "SINGLE_STEPPING_CALL", single_step_call, &
"If true, advance the state of MOM with a single step "//&
"including both dynamics and thermodynamics. If false "//&
Expand Down
9 changes: 7 additions & 2 deletions config_src/infra/FMS1/MOM_diag_manager_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module MOM_diag_manager_infra
public MOM_diag_manager_end
public send_data_infra
public diag_send_complete_infra
public diag_manager_set_time_end_infra
public MOM_diag_field_add_attribute
public register_diag_field_infra
public register_static_field_infra
Expand Down Expand Up @@ -452,9 +453,13 @@ subroutine MOM_diag_field_add_attribute_i1d(diag_field_id, att_name, att_value)

end subroutine MOM_diag_field_add_attribute_i1d

!> Finishes the diag manager reduction methods as needed for the time_step
!! Needed for backwards compatibility, does nothing
!> Needed for backwards compatibility, does nothing
subroutine diag_send_complete_infra ()
end subroutine diag_send_complete_infra

!> Needed for backwards compatibility, does nothing
subroutine diag_manager_set_time_end_infra(time)
type(time_type), intent(in) :: time !< The model time that simulation ends
end subroutine diag_manager_set_time_end_infra

end module MOM_diag_manager_infra
9 changes: 9 additions & 0 deletions config_src/infra/FMS2/MOM_diag_manager_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module MOM_diag_manager_infra
use diag_manager_mod, only : fms_diag_manager_init => diag_manager_init
use diag_manager_mod, only : fms_diag_manager_end => diag_manager_end
use diag_manager_mod, only : diag_send_complete
use diag_manager_mod, only : diag_manager_set_time_end
use diag_manager_mod, only : send_data_fms => send_data
use diag_manager_mod, only : fms_diag_field_add_attribute => diag_field_add_attribute
use diag_manager_mod, only : DIAG_FIELD_NOT_FOUND
Expand Down Expand Up @@ -59,6 +60,7 @@ module MOM_diag_manager_infra
public MOM_diag_manager_end
public send_data_infra
public diag_send_complete_infra
public diag_manager_set_time_end_infra
public MOM_diag_field_add_attribute
public register_diag_field_infra
public register_static_field_infra
Expand Down Expand Up @@ -461,4 +463,11 @@ subroutine diag_send_complete_infra ()
call diag_send_complete (set_time(0))
end subroutine diag_send_complete_infra

!> Sets the time that the simulation ends in the diag manager
subroutine diag_manager_set_time_end_infra(time)
type(time_type), optional, intent(in) :: time !< The time the simulation ends

call diag_manager_set_time_end(time)
end subroutine diag_manager_set_time_end_infra

end module MOM_diag_manager_infra

0 comments on commit 7305528

Please sign in to comment.