FMS  2025.04
Flexible Modeling System
mpp_data.F90
1 !***********************************************************************
2 !* Apache License 2.0
3 !*
4 !* This file is part of the GFDL Flexible Modeling System (FMS).
5 !*
6 !* Licensed under the Apache License, Version 2.0 (the "License");
7 !* you may not use this file except in compliance with the License.
8 !* You may obtain a copy of the License at
9 !*
10 !* http://www.apache.org/licenses/LICENSE-2.0
11 !*
12 !* FMS is distributed in the hope that it will be useful, but WITHOUT
13 !* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied;
14 !* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15 !* PARTICULAR PURPOSE. See the License for the specific language
16 !* governing permissions and limitations under the License.
17 !***********************************************************************
18 !> @defgroup mpp_data_mod mpp_data_mod
19 !> @ingroup mpp
20 !> @brief Module to hold pointer and stack data for use in @ref mpp modules.
21 !!
22 !> Makes stack and pointer data publicly available from @ref mpp_data_mpi.inc or @ref
23 !! mpp_data_nocomm.inc for use in @ref mpp modules. This module is mainly
24 !! for internal use within @ref mpp_mod and @ref mpp_domains_mod .
25 
26 !> @addtogroup mpp_data_mod
27 !> @{
28 module mpp_data_mod
29 
30 #if defined(use_libMPI)
31  use mpi
32 #endif
33 
34  use mpp_parameter_mod, only : maxpes
35  use platform_mod
36 
37  implicit none
38  private
39 
40 ! Include variable "version" to be written to log file.
41 #include<file_version.h>
42  public version
43 
44  !> public data used by mpp_mod
45  public :: stat, mpp_stack, ptr_stack, status, ptr_status, sync, ptr_sync
46  public :: mpp_from_pe, ptr_from, remote_data_loc, ptr_remote
47 
48  !--- All othere modules should import these parameters from mpp_domains_mod.
49  !> public data which is used by mpp_domains_mod.
50  public :: mpp_domains_stack, ptr_domains_stack
51  public :: mpp_domains_stack_nonblock, ptr_domains_stack_nonblock
52 
53  !-------------------------------------------------------------------------------!
54  ! The following data included in the .inc file are diffrent for sma or mpi case !
55  !-------------------------------------------------------------------------------!
56 
57 #ifdef use_libMPI
58 #include <mpp_data_mpi.inc>
59 #else
60 #include <mpp_data_nocomm.inc>
61 #endif
62 
63 end module mpp_data_mod
64 !> @}
65 ! close documentation grouping