Skip to content

Commit dec9ee3

Browse files
authored
Add diag send complete calls (#210)
Add diag_send_compete calls to the SIS_diag_mediator, and adds call to it
1 parent 280feb5 commit dec9ee3

File tree

7 files changed

+25
-4
lines changed

7 files changed

+25
-4
lines changed

src/SIS_diag_mediator.F90

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module SIS_diag_mediator
88
use MOM_diag_manager_infra, only : diag_manager_init=>MOM_diag_manager_init
99
use MOM_diag_manager_infra, only : register_diag_field_infra, register_static_field_infra
1010
use MOM_diag_manager_infra, only : send_data_infra, diag_axis_init=>MOM_diag_axis_init, EAST, NORTH
11+
use MOM_diag_manager_infra, only : diag_send_complete_infra
1112
use MOM_error_handler, only : SIS_error=>MOM_error, FATAL, is_root_pe
1213
use MOM_file_parser, only : get_param, log_param, log_version, param_file_type
1314
use MOM_safe_alloc, only : safe_alloc_ptr, safe_alloc_alloc
@@ -22,7 +23,7 @@ module SIS_diag_mediator
2223
public enable_SIS_averaging, disable_SIS_averaging, query_SIS_averaging_enabled
2324
public SIS_diag_mediator_init, SIS_diag_mediator_end, set_SIS_diag_mediator_grid
2425
public SIS_diag_mediator_close_registration, get_SIS_diag_time_end
25-
public diag_axis_init, register_static_field
26+
public diag_axis_init, register_static_field, SIS_diag_send_complete
2627

2728
!> Make a diagnostic available for averaging or output.
2829
interface post_SIS_data
@@ -975,4 +976,8 @@ subroutine assert(logical_arg, msg)
975976

976977
end subroutine assert
977978

979+
subroutine SIS_diag_send_complete()
980+
call diag_send_complete_infra()
981+
end subroutine SIS_diag_send_complete
982+
978983
end module SIS_diag_mediator

src/SIS_dyn_cgrid.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module SIS_dyn_cgrid
2929

3030
use SIS_diag_mediator, only : post_SIS_data, SIS_diag_ctrl
3131
use SIS_diag_mediator, only : query_SIS_averaging_enabled, enable_SIS_averaging
32+
use SIS_diag_mediator, only : SIS_diag_send_complete
3233
use SIS_diag_mediator, only : register_diag_field=>register_SIS_diag_field
3334
use SIS_debugging, only : chksum, Bchksum, hchksum, uvchksum
3435
use SIS_debugging, only : check_redundant_B, check_redundant_C
@@ -1372,7 +1373,7 @@ subroutine SIS_C_dynamics(ci, mis, mice, ui, vi, uo, vo, fxat, fyat, &
13721373
call uvchksum("Cor_[uv] in SIS_C_dynamics", Cor_u, Cor_v, G, scale=US%L_T_to_m_s*US%s_to_T)
13731374
call uvchksum("[uv]i in SIS_C_dynamics", ui, vi, G, scale=US%L_T_to_m_s)
13741375
endif
1375-
1376+
call SIS_diag_send_complete()
13761377
enddo ! l=1,EVP_steps
13771378

13781379
if (CS%debug .or. CS%debug_redundant) &
@@ -1578,6 +1579,7 @@ subroutine SIS_C_dynamics(ci, mis, mice, ui, vi, uo, vo, fxat, fyat, &
15781579
endif
15791580

15801581
endif
1582+
call SIS_diag_send_complete()
15811583

15821584
end subroutine SIS_C_dynamics
15831585

src/SIS_dyn_trans.F90

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ module SIS_dyn_trans
3939
use SIS_diag_mediator, only : post_SIS_data, post_data=>post_SIS_data
4040
use SIS_diag_mediator, only : query_SIS_averaging_enabled, SIS_diag_ctrl
4141
use SIS_diag_mediator, only : register_diag_field=>register_SIS_diag_field
42+
use SIS_diag_mediator, only : SIS_diag_send_complete
4243
use SIS_dyn_bgrid, only : SIS_B_dyn_CS, SIS_B_dynamics, SIS_B_dyn_init
4344
use SIS_dyn_bgrid, only : SIS_B_dyn_register_restarts, SIS_B_dyn_end
4445
use SIS_dyn_cgrid, only : SIS_C_dyn_CS, SIS_C_dynamics, SIS_C_dyn_init
@@ -311,6 +312,7 @@ subroutine update_icebergs(IST, OSS, IOF, FIA, icebergs_CS, dt_slow, G, US, IG,
311312
if (IOF%id_mass_berg>0 .and. associated(IOF%mass_berg)) then
312313
call post_data(IOF%id_mass_berg, IOF%mass_berg, CS%diag)
313314
endif
315+
call SIS_diag_send_complete()
314316
call disable_SIS_averaging(CS%diag)
315317

316318
end subroutine update_icebergs
@@ -606,7 +608,7 @@ subroutine SIS_dynamics_trans(IST, OSS, FIA, IOF, dt_slow, CS, icebergs_CS, G, U
606608
DS2d%avg_ridge_rate(i,j) = wt_new * rdg_rate(i,j) + wt_prev * DS2d%avg_ridge_rate(i,j)
607609
enddo ; enddo
608610
endif
609-
611+
call SIS_diag_send_complete()
610612
call cpu_clock_end(iceClock4)
611613

612614
enddo ! nds=1,ndyn_steps
@@ -818,6 +820,7 @@ subroutine ice_state_cleanup(IST, OSS, IOF, dt_slow, G, US, IG, CS, tracer_CSp)
818820

819821
call enable_SIS_averaging(US%T_to_s*dt_slow, CS%Time, CS%diag)
820822
call post_ice_state_diagnostics(CS%IDs, IST, OSS, IOF, dt_slow, CS%Time, G, US, IG, CS%diag)
823+
call SIS_diag_send_complete()
821824
call disable_SIS_averaging(CS%diag)
822825

823826
if (CS%verbose) call ice_line(CS%Time, IST%part_size(:,:,0), OSS%SST_C(:,:), G)
@@ -1140,7 +1143,7 @@ subroutine SIS_merged_dyn_cont(OSS, FIA, IOF, DS2d, IST, dt_cycle, Time_start, G
11401143
enddo
11411144
DS2d%nts = DS2d%nts + CS%adv_substeps
11421145
call cpu_clock_end(iceClock4)
1143-
1146+
call SIS_diag_send_complete()
11441147
enddo ! nds=1,ndyn_steps
11451148

11461149
end subroutine SIS_merged_dyn_cont
@@ -1360,6 +1363,7 @@ subroutine slab_ice_dyn_trans(IST, OSS, FIA, IOF, dt_slow, CS, G, US, IG, tracer
13601363
call write_ice_statistics(IST, CS%Time, CS%n_calls, G, US, IG, CS%sum_output_CSp, &
13611364
message=" Post_transport")! , check_column=.true.)
13621365

1366+
call SIS_diag_send_complete()
13631367
enddo ! nds=1,ndyn_steps
13641368
call finish_ocean_top_stresses(IOF, G)
13651369

src/SIS_slow_thermo.F90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module SIS_slow_thermo
4141
use SIS_diag_mediator, only : post_SIS_data, post_data=>post_SIS_data
4242
use SIS_diag_mediator, only : query_SIS_averaging_enabled, SIS_diag_ctrl
4343
use SIS_diag_mediator, only : register_diag_field=>register_SIS_diag_field
44+
use SIS_diag_mediator, only : SIS_diag_send_complete
4445
use SIS_framework, only : coupler_type_spawn, coupler_type_initialized
4546
use SIS_framework, only : coupler_type_increment_data, coupler_type_rescale_data
4647
use SIS_framework, only : coupler_type_send_data
@@ -415,6 +416,7 @@ subroutine slow_thermodynamics(IST, dt_slow, CS, OSS, FIA, XSF, IOF, G, US, IG)
415416
! Save out diagnostics of fluxes. This must go before SIS2_thermodynamics.
416417
call post_flux_diagnostics(IST, FIA, IOF, CS, G, US, IG, Idt_slow)
417418

419+
call SIS_diag_send_complete()
418420
call disable_SIS_averaging(CS%diag)
419421

420422
call accumulate_input_2(IST, FIA, IOF, OSS, IST%part_size, dt_slow, G, US, IG, CS%sum_output_CSp)
@@ -446,6 +448,7 @@ subroutine slow_thermodynamics(IST, dt_slow, CS, OSS, FIA, XSF, IOF, G, US, IG)
446448
! Do tracer column physics
447449
call enable_SIS_averaging(US%T_to_s*dt_slow, CS%Time, CS%diag)
448450
call SIS_call_tracer_column_fns(dt_slow, G, IG, CS%tracer_flow_CSp, IST%mH_ice, mi_old)
451+
call SIS_diag_send_complete()
449452
call disable_SIS_averaging(CS%diag)
450453

451454
call accumulate_bottom_input(IST, OSS, FIA, IOF, dt_slow, G, US, IG, CS%sum_output_CSp)
@@ -1367,6 +1370,7 @@ subroutine SIS2_thermodynamics(IST, dt_slow, CS, OSS, FIA, IOF, G, US, IG)
13671370
if (coupler_type_initialized(IOF%tr_flux_ocn_top)) &
13681371
call coupler_type_send_data(IOF%tr_flux_ocn_top, CS%Time)
13691372

1373+
call SIS_diag_send_complete()
13701374
call disable_SIS_averaging(CS%diag)
13711375

13721376
! Combine the liquid precipitation with the net melt of ice and snow for

src/SIS_transport.F90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module SIS_transport
1515
use SIS_continuity, only : summed_continuity, proportionate_continuity
1616
use SIS_diag_mediator, only : post_SIS_data, query_SIS_averaging_enabled, SIS_diag_ctrl
1717
use SIS_diag_mediator, only : register_diag_field=>register_SIS_diag_field, time_type
18+
use SIS_diag_mediator, only : SIS_diag_send_complete
1819
use SIS_framework, only : safe_alloc
1920
use SIS_hor_grid, only : SIS_hor_grid_type
2021
use SIS_tracer_advect, only : advect_tracers_thicker, SIS_tracer_advect_CS
@@ -218,6 +219,7 @@ subroutine ice_cat_transport(CAS, TrReg, dt_slow, nsteps, G, US, IG, CS, uc, vc,
218219
write(mesg,'(i4)') n
219220
call check_SIS_tracer_bounds(TrReg, G, IG, "After advect_SIS_tracers "//trim(mesg))
220221
endif
222+
call SIS_diag_send_complete()
221223
enddo
222224

223225
end subroutine ice_cat_transport

src/ice_model.F90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ module ice_model_mod
6363
use SIS_diag_mediator, only : set_SIS_axes_info, SIS_diag_mediator_init, SIS_diag_mediator_end
6464
use SIS_diag_mediator, only : enable_SIS_averaging, disable_SIS_averaging
6565
use SIS_diag_mediator, only : post_SIS_data, post_data=>post_SIS_data
66+
use SIS_diag_mediator, only : SIS_diag_send_complete
6667
use SIS_dyn_trans, only : SIS_dynamics_trans, SIS_multi_dyn_trans, update_icebergs
6768
use SIS_dyn_trans, only : slab_ice_dyn_trans
6869
use SIS_dyn_trans, only : SIS_dyn_trans_register_restarts, SIS_dyn_trans_init, SIS_dyn_trans_end
@@ -1548,6 +1549,7 @@ subroutine fast_radiation_diagnostics(ABT, Ice, IST, Rad, FIA, G, US, IG, CS, &
15481549

15491550
if (Rad%id_coszen>0) call post_data(Rad%id_coszen, Rad%coszen_nextrad, CS%diag)
15501551

1552+
call SIS_diag_send_complete()
15511553
call disable_SIS_averaging(CS%diag)
15521554

15531555
end subroutine fast_radiation_diagnostics

src/specified_ice.F90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module specified_ice
1717
use MOM_unit_scaling, only : unit_scale_type
1818

1919
use SIS_diag_mediator, only : enable_SIS_averaging, disable_SIS_averaging
20+
use SIS_diag_mediator, only : SIS_diag_send_complete
2021
use SIS_diag_mediator, only : query_SIS_averaging_enabled, SIS_diag_ctrl
2122
use SIS_hor_grid, only : SIS_hor_grid_type
2223
use SIS_ice_diags, only : ice_state_diags_type, register_ice_state_diagnostics
@@ -93,6 +94,7 @@ subroutine specified_ice_dynamics(IST, OSS, FIA, IOF, dt_slow, CS, G, US, IG)
9394

9495
call enable_SIS_averaging(US%T_to_s*dt_slow, CS%Time, CS%diag)
9596
call post_ice_state_diagnostics(CS%IDs, IST, OSS, IOF, dt_slow, CS%Time, G, US, IG, CS%diag)
97+
call SIS_diag_send_complete()
9698
call disable_SIS_averaging(CS%diag)
9799

98100
if (CS%debug) call IST_chksum("End specified_ice_dynamics", IST, G, US, IG)

0 commit comments

Comments
 (0)