From ae5b3f1e2bbae55f9223fad3286ae83b7f4bcbaf Mon Sep 17 00:00:00 2001 From: Robert Hallberg Date: Mon, 10 Aug 2020 10:45:56 -0400 Subject: [PATCH] +Add the new module SIS_framework Added the new module SIS_framework as a wrapper for all calls to FMS infrastructure routines that are not already going through routines in the MOM6 framework directory. This includes renaming several mpp-specific routines to allow for flexibility in future implementations, like calling redistribute_data instead of mpp_redistribute or SIS_chksum instead of mpp_chksum. All answers are bitwise identical, but there are new public interfaces. --- src/SIS_framework.F90 | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/SIS_framework.F90 diff --git a/src/SIS_framework.F90 b/src/SIS_framework.F90 new file mode 100644 index 00000000..34aeeae4 --- /dev/null +++ b/src/SIS_framework.F90 @@ -0,0 +1,50 @@ +!> Provides wrapped interfaces for infrastructure calls used by SIS2 that can not be +!! found in the MOM6 framework directory. +module SIS_framework + +! This file is part of SIS2. See LICENSE.md for the license. + +use fms_io_mod, only : set_domain, nullify_domain +use fms_io_mod, only : restart_file_type, register_restart_field +use fms_io_mod, only : save_restart, restore_state, query_initialized +use mpp_mod, only : SIS_chksum=>mpp_chksum +use mpp_domains_mod, only : domain2D, CORNER, EAST, NORTH +use mpp_domains_mod, only : get_layout=>mpp_get_layout, get_compute_domain=>mpp_get_compute_domain +use mpp_domains_mod, only : redistribute_data=>mpp_redistribute +use mpp_domains_mod, only : broadcast_domain=>mpp_broadcast_domain + +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 + +implicit none ; private + +public :: SIS_chksum, redistribute_data, domain2D, CORNER, EAST, NORTH +public :: set_domain, nullify_domain, get_layout, get_compute_domain, broadcast_domain +public :: restart_file_type, register_restart_field, save_restart, restore_state, query_initialized +public :: SIS_initialize_framework + +contains + +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! +!> SIS_initialize_framework is a template that might be used later to initialize structrures +!! and types that are used for the SIS2 infrastructure. +subroutine SIS_initialize_framework(PF) + type(param_file_type), intent(in) :: PF !< A structure indicating the open file + !! to parse for model parameter values. + + character(len=200) :: inputdir ! The directory where NetCDF input files are. + character(len=200) :: config + character(len=40) :: mdl = "SIS_framework" ! This module's name. + logical :: debug + ! This include declares and sets the variable "version". +# include "version_variable.h" + + call callTree_enter("SIS_initialize_framework(), SIS_framework.F90") + call log_version(PF, mdl, version, "") + call get_param(PF, mdl, "DEBUG", debug, default=.false.) + + call callTree_leave('SIS_initialize_framework()') + +end subroutine SIS_initialize_framework + +end module SIS_framework