MOM_database_comms.F90
1! This file is part of MOM6, the Modular Ocean Model version 6.
2! See the LICENSE file for licensing information.
3! SPDX-License-Identifier: Apache-2.0
4
5!> Contains routines necessary to initialize communication with a database
6module mom_database_comms
7use mom_file_parser, only : param_file_type
8use mom_error_handler, only : mom_error, warning
9use database_client_interface, only : dbclient_type
10
11implicit none ; private
12
13!> Control structure to store Database communication related parameters and objects
14type, public :: dbcomms_cs_type
15 type(dbclient_type) :: client !< The Database client itself
16 logical :: use_dbclient !< If True, use Database within MOM6
17 logical :: colocated !< If True, the orchestrator was setup in 'co-located' mode
18 logical :: cluster !< If True, the orchestrator has three shards or more
19 integer :: colocated_stride !< Sets which ranks will load the model from the file
20 !! e.g. mod(rank,colocated_stride) == 0
21end type dbcomms_cs_type
22
23public :: database_comms_init
24public :: dbclient_type
25
26contains
27
28subroutine database_comms_init(param_file, CS, client_in)
29 type(param_file_type), intent(in ) :: param_file !< Parameter file structure
30 type(dbcomms_cs_type), intent(inout) :: cs !< Control structure for Database
31 type(dbclient_type), optional, intent(in ) :: client_in !< If present, use a previously initialized
32 !! Database client
33
34 call mom_error(warning,"dbcomms_init was compiled using the dummy module. If this was\n"//&
35 "a mistake, please follow the instructions in:\n"//&
36 "MOM6/config_src/external/dbclient/README.md")
37end subroutine database_comms_init
38
39end module mom_database_comms
40