Skip to content

Commit

Permalink
Access infrastructure routines via SIS_framework
Browse files Browse the repository at this point in the history
  Altered module use statements to access various infrastructure routines and
types via the new SIS_framework module.  Some unused routines were also removed
from module use statements, and the formats of the module use statements were
cleaned up in many files.  All module use references ultimately resolve to the
same code, and all answers are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Aug 10, 2020
1 parent 9b73944 commit 6b1f497
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 124 deletions.
32 changes: 13 additions & 19 deletions src/SIS_ctrl_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,30 @@
!! types, including allocation, deallocation, registration for restarts, and checksums.
module SIS_ctrl_types

! use mpp_mod, only: mpp_sum, stdout, input_nml_file, PE_here => mpp_pe
! use mpp_domains_mod, only: domain2D, mpp_get_compute_domain, CORNER, EAST, NORTH
use mpp_domains_mod, only : domain2D, CORNER, EAST, NORTH
! use mpp_parameter_mod, only : CGRID_NE, BGRID_NE, AGRID
use coupler_types_mod, only : coupler_2d_bc_type, coupler_3d_bc_type
use coupler_types_mod, only : coupler_type_initialized, coupler_type_set_diags

use SIS_dyn_trans, only : dyn_trans_CS
use SIS_fast_thermo, only : fast_thermo_CS
use SIS_slow_thermo, only : slow_thermo_CS
use specified_ice, only : specified_ice_CS

use SIS_hor_grid, only : SIS_hor_grid_type
use ice_grid, only : ice_grid_type
use SIS_types, only : ice_state_type, ice_ocean_flux_type, ocean_sfc_state_type
use SIS_types, only : fast_ice_avg_type, ice_rad_type, simple_OSS_type
use SIS_types, only : total_sfc_flux_type
use SIS_optics, only : SIS_optics_CS

use MOM_coms, only : PE_here
use MOM_error_handler, only : SIS_error=>MOM_error, FATAL, WARNING, SIS_mesg=>MOM_mesg, is_root_pe
use ice_grid, only : ice_grid_type
use MOM_error_handler, only : SIS_error=>MOM_error, FATAL, WARNING, SIS_mesg=>MOM_mesg
use MOM_file_parser, only : param_file_type
use MOM_hor_index, only : hor_index_type
use MOM_time_manager, only : time_type, time_type_to_real
use MOM_unit_scaling, only : unit_scale_type
use SIS_diag_mediator, only : SIS_diag_ctrl, post_data=>post_SIS_data
use SIS_diag_mediator, only : register_SIS_diag_field, register_static_field
use SIS_sum_output, only : SIS_sum_out_CS
use SIS_dyn_trans, only : dyn_trans_CS
use SIS_fast_thermo, only : fast_thermo_CS
use SIS_framework, only : domain2D, CORNER, EAST, NORTH
use SIS_hor_grid, only : SIS_hor_grid_type
use SIS_optics, only : SIS_optics_CS
use SIS_slow_thermo, only : slow_thermo_CS
use SIS_sum_output, only : SIS_sum_out_CS
! use SIS_tracer_registry, only : SIS_tracer_registry_type
use SIS_tracer_flow_control, only : SIS_tracer_flow_control_CS
use SIS_types, only : ice_state_type, ice_ocean_flux_type, ocean_sfc_state_type
use SIS_types, only : fast_ice_avg_type, ice_rad_type, simple_OSS_type
use SIS_types, only : total_sfc_flux_type
use specified_ice, only : specified_ice_CS

implicit none ; private

Expand Down
18 changes: 9 additions & 9 deletions src/SIS_dyn_bgrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ module SIS_dyn_bgrid
! Recoded for consistency with MOM6 and symmetry by R. Hallberg, 7/2013. !
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!

use MOM_domains, only : pass_var, pass_vector, BGRID_NE
use MOM_error_handler, only : SIS_error=>MOM_error, FATAL, WARNING, SIS_mesg=>MOM_mesg
use MOM_file_parser, only : get_param, log_param, read_param, log_version, param_file_type
use MOM_hor_index, only : hor_index_type
use MOM_unit_scaling, only : unit_scale_type
use SIS_diag_mediator, only : post_SIS_data, query_SIS_averaging_enabled, SIS_diag_ctrl
use SIS_diag_mediator, only : register_diag_field=>register_SIS_diag_field, time_type
use SIS_debugging, only : chksum, Bchksum, hchksum, check_redundant_B
use SIS_debugging, only : Bchksum_pair
use MOM_domains, only : pass_var, pass_vector, BGRID_NE
use MOM_error_handler, only : SIS_error=>MOM_error, FATAL, WARNING, SIS_mesg=>MOM_mesg
use MOM_file_parser, only : get_param, log_param, read_param, log_version, param_file_type
use MOM_hor_index, only : hor_index_type
use MOM_unit_scaling, only : unit_scale_type
use SIS_hor_grid, only : SIS_hor_grid_type
use fms_io_mod, only : register_restart_field, restart_file_type
use mpp_domains_mod, only : domain2D
use ice_ridging_mod, only : ridge_rate
use SIS_framework, only : register_restart_field, restart_file_type
use SIS_framework, only : domain2D
use SIS_hor_grid, only : SIS_hor_grid_type
use ice_ridging_mod, only : ridge_rate

implicit none ; private

Expand Down
27 changes: 14 additions & 13 deletions src/SIS_dyn_cgrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@ module SIS_dyn_cgrid
! !
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!

use MOM_error_handler, only : SIS_error=>MOM_error, FATAL, WARNING, NOTE, SIS_mesg=>MOM_mesg
use MOM_file_parser, only : get_param, log_param, read_param, log_version, param_file_type
use MOM_domains, only : pass_var, pass_vector, CGRID_NE, CORNER, pe_here
use MOM_domains, only : MOM_domain_type, clone_MOM_domain
use MOM_hor_index, only : hor_index_type
use MOM_io, only : open_file, APPEND_FILE, ASCII_FILE, MULTIPLE, SINGLE_FILE
use MOM_time_manager, only : time_type, real_to_time, operator(+), operator(-)
use MOM_time_manager, only : set_date, get_time, get_date
use MOM_unit_scaling, only : unit_scale_type

use SIS_diag_mediator, only : post_SIS_data, SIS_diag_ctrl
use SIS_diag_mediator, only : query_SIS_averaging_enabled, enable_SIS_averaging
use SIS_diag_mediator, only : register_diag_field=>register_SIS_diag_field
use SIS_debugging, only : chksum, Bchksum, hchksum, uvchksum
use SIS_debugging, only : check_redundant_B, check_redundant_C
use MOM_error_handler, only : SIS_error=>MOM_error, FATAL, WARNING, NOTE, SIS_mesg=>MOM_mesg
use MOM_file_parser, only : get_param, log_param, read_param, log_version, param_file_type
use MOM_domains, only : pass_var, pass_vector, CGRID_NE, CORNER, pe_here
use MOM_domains, only : MOM_domain_type, clone_MOM_domain
use MOM_hor_index, only : hor_index_type
use MOM_io, only : open_file, APPEND_FILE, ASCII_FILE, MULTIPLE, SINGLE_FILE
use MOM_time_manager, only : time_type, real_to_time, operator(+), operator(-)
use MOM_time_manager, only : set_date, get_time, get_date
use MOM_unit_scaling, only : unit_scale_type
use SIS_hor_grid, only : SIS_hor_grid_type
use fms_io_mod, only : register_restart_field, restart_file_type
use fms_io_mod, only : restore_state, query_initialized
use mpp_domains_mod, only : domain2D
use SIS_framework, only : register_restart_field, restart_file_type
use SIS_framework, only : restore_state, query_initialized
use SIS_framework, only : domain2D
use SIS_hor_grid, only : SIS_hor_grid_type

implicit none ; private

Expand Down
69 changes: 34 additions & 35 deletions src/SIS_dyn_trans.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,20 @@ module SIS_dyn_trans
! and lateral transport. !
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!

use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_COMPONENT, CLOCK_SUBCOMPONENT, CLOCK_LOOP, CLOCK_ROUTINE
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_COMPONENT, CLOCK_SUBCOMPONENT, CLOCK_LOOP, CLOCK_ROUTINE
use MOM_domains, only : pass_var, pass_vector, AGRID, BGRID_NE, CGRID_NE
use MOM_error_handler, only : SIS_error=>MOM_error, FATAL, WARNING, SIS_mesg=>MOM_mesg
use MOM_error_handler, only : callTree_enter, callTree_leave, callTree_waypoint
use MOM_file_parser, only : get_param, read_param, log_param, log_version, param_file_type
use MOM_hor_index, only : hor_index_type
use MOM_time_manager, only : time_type, time_type_to_real, real_to_time
use MOM_time_manager, only : operator(+), operator(-)
use MOM_time_manager, only : operator(>), operator(*), operator(/), operator(/=)
use MOM_unit_scaling, only : unit_scale_type
use MOM_EOS, only : EOS_type, calculate_density_derivs

use coupler_types_mod, only: coupler_type_initialized, coupler_type_send_data
use fms_io_mod, only : restart_file_type
use mpp_domains_mod, only : domain2D
use MOM_file_parser, only : get_param, read_param, log_param, log_version, param_file_type
use MOM_hor_index, only : hor_index_type
use MOM_time_manager, only : time_type, time_type_to_real, real_to_time
use MOM_time_manager, only : operator(+), operator(-)
use MOM_time_manager, only : operator(>), operator(*), operator(/), operator(/=)
use MOM_unit_scaling, only : unit_scale_type
use MOM_EOS, only : EOS_type, calculate_density_derivs

use coupler_types_mod, only : coupler_type_initialized, coupler_type_send_data

use SIS_continuity, only : SIS_continuity_CS, summed_continuity, ice_cover_transport
use SIS_debugging, only : chksum, Bchksum, hchksum
Expand All @@ -40,29 +38,30 @@ module SIS_dyn_trans
use SIS_diag_mediator, only : post_SIS_data, post_data=>post_SIS_data
use SIS_diag_mediator, only : query_SIS_averaging_enabled, SIS_diag_ctrl, safe_alloc_alloc
use SIS_diag_mediator, only : register_diag_field=>register_SIS_diag_field
use SIS_dyn_bgrid, only : SIS_B_dyn_CS, SIS_B_dynamics, SIS_B_dyn_init
use SIS_dyn_bgrid, only : SIS_B_dyn_register_restarts, SIS_B_dyn_end
use SIS_dyn_cgrid, only : SIS_C_dyn_CS, SIS_C_dynamics, SIS_C_dyn_init
use SIS_dyn_cgrid, only : SIS_C_dyn_register_restarts, SIS_C_dyn_end
use SIS_dyn_cgrid, only : SIS_C_dyn_read_alt_restarts
use SIS_hor_grid, only : SIS_hor_grid_type
use SIS_ice_diags, only : ice_state_diags_type, register_ice_state_diagnostics
use SIS_ice_diags, only : post_ocean_sfc_diagnostics, post_ice_state_diagnostics
use SIS_sum_output, only : write_ice_statistics, SIS_sum_output_init, SIS_sum_out_CS
use SIS_dyn_bgrid, only : SIS_B_dyn_CS, SIS_B_dynamics, SIS_B_dyn_init
use SIS_dyn_bgrid, only : SIS_B_dyn_register_restarts, SIS_B_dyn_end
use SIS_dyn_cgrid, only : SIS_C_dyn_CS, SIS_C_dynamics, SIS_C_dyn_init
use SIS_dyn_cgrid, only : SIS_C_dyn_register_restarts, SIS_C_dyn_end
use SIS_dyn_cgrid, only : SIS_C_dyn_read_alt_restarts
use SIS_framework, only : restart_file_type, domain2D
use SIS_hor_grid, only : SIS_hor_grid_type
use SIS_ice_diags, only : ice_state_diags_type, register_ice_state_diagnostics
use SIS_ice_diags, only : post_ocean_sfc_diagnostics, post_ice_state_diagnostics
use SIS_sum_output, only : write_ice_statistics, SIS_sum_output_init, SIS_sum_out_CS
use SIS_tracer_flow_control, only : SIS_tracer_flow_control_CS
use SIS_transport, only : SIS_transport_init, SIS_transport_end
use SIS_transport, only : SIS_transport_CS, adjust_ice_categories, cell_average_state_type
use SIS_transport, only : alloc_cell_average_state_type, dealloc_cell_average_state_type
use SIS_transport, only : cell_ave_state_to_ice_state, ice_state_to_cell_ave_state
use SIS_transport, only : ice_cat_transport, finish_ice_transport
use SIS_types, only : ocean_sfc_state_type, ice_ocean_flux_type, fast_ice_avg_type
use SIS_types, only : ice_state_type, IST_chksum, IST_bounds_check
use SIS_utils, only : get_avg, post_avg, ice_line !, ice_grid_chksum
use SIS2_ice_thm, only : get_SIS2_thermo_coefs, enthalpy_liquid_freeze
use SIS2_ice_thm, only : enth_from_TS, Temp_from_En_S
use slab_ice, only : slab_ice_advect, slab_ice_dynamics
use ice_bergs, only : icebergs, icebergs_run, icebergs_init, icebergs_end
use ice_grid, only : ice_grid_type
use SIS_transport, only : SIS_transport_init, SIS_transport_end
use SIS_transport, only : SIS_transport_CS, adjust_ice_categories, cell_average_state_type
use SIS_transport, only : alloc_cell_average_state_type, dealloc_cell_average_state_type
use SIS_transport, only : cell_ave_state_to_ice_state, ice_state_to_cell_ave_state
use SIS_transport, only : ice_cat_transport, finish_ice_transport
use SIS_types, only : ocean_sfc_state_type, ice_ocean_flux_type, fast_ice_avg_type
use SIS_types, only : ice_state_type, IST_chksum, IST_bounds_check
use SIS_utils, only : get_avg, post_avg, ice_line !, ice_grid_chksum
use SIS2_ice_thm, only : get_SIS2_thermo_coefs, enthalpy_liquid_freeze
use SIS2_ice_thm, only : enth_from_TS, Temp_from_En_S
use slab_ice, only : slab_ice_advect, slab_ice_dynamics
use ice_bergs, only : icebergs, icebergs_run, icebergs_init, icebergs_end
use ice_grid, only : ice_grid_type

implicit none ; private

Expand Down
3 changes: 0 additions & 3 deletions src/SIS_hor_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ module SIS_hor_grid
! metric terms in a way that is very similar to MOM6. - Robert Hallberg !
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!

use mpp_domains_mod, only : mpp_get_compute_domain, mpp_get_data_domain
use mpp_domains_mod, only : mpp_get_global_domain

use MOM_hor_index, only : hor_index_type, hor_index_init
use MOM_domains, only : MOM_domain_type, get_domain_extent, compute_block_extent
use MOM_domains, only : MOM_domains_init, clone_MOM_domain
Expand Down
32 changes: 15 additions & 17 deletions src/SIS_state_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,24 @@ module SIS_state_initialization
! routines have options that just read and log their input parameters. !
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!

use data_override_mod, only : data_override, data_override_init, data_override_unset_domains
use ice_grid, only : ice_grid_type
use ice_type_mod, only : ice_data_type, dealloc_ice_arrays
use ice_type_mod, only : ice_type_slow_reg_restarts
use MOM_domains, only : MOM_domain_type
use MOM_error_handler, only : SIS_error=>MOM_error, FATAL, WARNING, SIS_mesg=>MOM_mesg
use MOM_error_handler, only : callTree_enter, callTree_leave, callTree_waypoint
use MOM_file_parser, only : get_param, log_param, log_version, read_param, param_file_type
use MOM_hor_index, only : hor_index_type, hor_index_init
use MOM_io, only : file_exists, MOM_read_data, slasher
use MOM_time_manager, only : time_type, time_type_to_real, real_to_time
use MOM_unit_scaling, only : unit_scale_type

use data_override_mod, only : data_override, data_override_init, data_override_unset_domains
use fms_io_mod, only : restore_state, query_initialized
use fms_io_mod, only : register_restart_field, restart_file_type

use ice_grid, only : ice_grid_type
use ice_type_mod, only : ice_data_type, dealloc_ice_arrays
use ice_type_mod, only : ice_type_slow_reg_restarts
use SIS_get_input, only : directories
use SIS_types, only : ice_state_type
use SIS_hor_grid, only : SIS_hor_grid_type, set_hor_grid, SIS_hor_grid_end
use SIS2_ice_thm, only : get_SIS2_thermo_coefs, enth_from_TS, Temp_from_En_S, T_freeze, ice_thermo_type
use MOM_file_parser, only : get_param, log_param, log_version, read_param, param_file_type
use MOM_hor_index, only : hor_index_type, hor_index_init
use MOM_io, only : file_exists, MOM_read_data, slasher
use MOM_time_manager, only : time_type, time_type_to_real, real_to_time
use MOM_unit_scaling, only : unit_scale_type
use SIS_framework, only : restore_state, query_initialized
use SIS_framework, only : register_restart_field, restart_file_type
use SIS_get_input, only : directories
use SIS_types, only : ice_state_type
use SIS_hor_grid, only : SIS_hor_grid_type, set_hor_grid, SIS_hor_grid_end
use SIS2_ice_thm, only : get_SIS2_thermo_coefs, enth_from_TS, Temp_from_En_S, T_freeze, ice_thermo_type

implicit none ; private

Expand Down
14 changes: 6 additions & 8 deletions src/SIS_tracer_flow_control.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@ module SIS_tracer_flow_control
!* *
!********+*********+*********+*********+*********+*********+*********+**

use SIS_diag_mediator, only : time_type, SIS_diag_ctrl
use MOM_error_handler, only : SIS_error=>MOM_error, FATAL, WARNING
use MOM_coms, only : sum_across_PEs
use ice_grid, only : ice_grid_type
use ice_grid, only : ice_grid_type
use MOM_error_handler, only : SIS_error=>MOM_error, FATAL, WARNING
use MOM_file_parser, only : get_param, log_version, param_file_type
use SIS_diag_mediator, only : time_type, SIS_diag_ctrl
use SIS_framework, only : restart_file_type
use SIS_hor_grid, only : SIS_hor_grid_type
use SIS_tracer_registry, only : SIS_tracer_registry_type
use SIS_tracer_registry, only : register_SIS_tracer, register_SIS_tracer_pair
use SIS_hor_grid, only : SIS_hor_grid_type

use fms_io_mod, only : restart_file_type
use MOM_file_parser, only : get_param, log_version, param_file_type

#include <SIS2_memory.h>

Expand Down
19 changes: 7 additions & 12 deletions src/ice_age_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ module ice_age_tracer
! ashao: Get all the dependencies from other modules (check against
! ideal_age_example.F90)

use SIS_diag_mediator, only : register_SIS_diag_field, &
safe_alloc_ptr
use SIS_diag_mediator, only : SIS_diag_ctrl, post_data=>post_SIS_data
use SIS_tracer_registry, only : register_SIS_tracer, SIS_tracer_registry_type
use SIS_hor_grid, only : sis_hor_grid_type
use SIS_utils, only : post_avg

use MOM_file_parser, only : get_param, log_param, log_version, param_file_type
use MOM_restart, only : query_initialized, MOM_restart_CS
use MOM_io, only : vardesc, var_desc, query_vardesc, file_exists
Expand All @@ -22,11 +15,13 @@ module ice_age_tracer
use MOM_error_handler, only : SIS_mesg=>MOM_mesg
use MOM_string_functions, only : slasher
use MOM_unit_scaling, only : unit_scale_type

use fms_mod, only : read_data
use fms_io_mod, only : register_restart_field, restore_state
use fms_io_mod, only : restart_file_type

use SIS_diag_mediator, only : register_SIS_diag_field, safe_alloc_ptr
use SIS_diag_mediator, only : SIS_diag_ctrl, post_data=>post_SIS_data
use SIS_framework, only : register_restart_field, restore_state
use SIS_framework, only : restart_file_type
use SIS_hor_grid, only : SIS_hor_grid_type
use SIS_tracer_registry, only : register_SIS_tracer, SIS_tracer_registry_type
use SIS_utils, only : post_avg
use ice_grid, only : ice_grid_type

implicit none ; private
Expand Down
2 changes: 1 addition & 1 deletion src/ice_ridge.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module ice_ridging_mod
use MOM_file_parser, only : get_param, log_param, read_param, log_version, param_file_type
use MOM_unit_scaling, only : unit_scale_type
use SIS_hor_grid, only : SIS_hor_grid_type
use fms_io_mod, only : register_restart_field, restart_file_type
use SIS_framework, only : register_restart_field, restart_file_type

implicit none ; private

Expand Down
15 changes: 8 additions & 7 deletions src/ice_spec.F90
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
!> sea ice and SST specified from data as per GFDL climate group
module ice_spec_mod

use fms_mod, only: open_namelist_file, check_nml_error, close_file, &
stdlog, stdout, mpp_pe, mpp_root_pe, write_version_number
use mpp_mod, only: input_nml_file
use mpp_domains_mod, only : domain2d
use MOM_hor_index, only : hor_index_type

use time_manager_mod, only: time_type, get_date, set_date
use data_override_mod, only : data_override, data_override_init, data_override_unset_domains
use fms_mod, only : write_version_number
use mpp_mod, only : input_nml_file

use MOM_error_handler, only : stdlog, stdout
use MOM_hor_index, only : hor_index_type
use MOM_io, only : open_namelist_file, check_nml_error, close_file
use MOM_time_manager, only : time_type, get_date, set_date
use SIS_framework, only : domain2d

implicit none ; private

Expand Down

0 comments on commit 6b1f497

Please sign in to comment.