FMS  2025.04
Flexible Modeling System
mpp_parameter.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_parameter_mod mpp_parameter_mod
19 !> @ingroup mpp
20 !> @brief Parameters values for use in various @ref mpp modules
21 !> If needed, these values should be imported from their corresponding mpp module
22 
23 !> @addtogroup mpp_parameter_mod
24 !> @{
25 module mpp_parameter_mod
26  use platform_mod
27 
28  implicit none
29  private
30 
31 ! Include variable "version" to be written to log file.
32 #include<file_version.h>
33  public version
34 
35  !--- public parameters which is used by mpp_mod and its components.
36  !--- All othere modules should import these parameters from mpp_mod.
37  public :: maxpes, mpp_verbose, mpp_debug, all_pes, any_pe, null_pe, note, warning, fatal
38  public :: mpp_wait, mpp_ready, max_clocks, max_event_types, max_events, mpp_clock_sync
39  public :: mpp_clock_detailed, clock_component, clock_subcomponent, clock_module_driver
40  public :: clock_module, clock_routine, clock_loop, clock_infra, max_bins
41  public :: event_allreduce, event_broadcast, event_recv, event_send, event_wait
42  public :: event_alltoall, event_type_create, event_type_free
43  public :: default_tag
44  public :: comm_tag_1, comm_tag_2, comm_tag_3, comm_tag_4
45  public :: comm_tag_5, comm_tag_6, comm_tag_7, comm_tag_8
46  public :: comm_tag_9, comm_tag_10, comm_tag_11, comm_tag_12
47  public :: comm_tag_13, comm_tag_14, comm_tag_15, comm_tag_16
48  public :: comm_tag_17, comm_tag_18, comm_tag_19, comm_tag_20
49  public :: mpp_fill_int, mpp_fill_float, mpp_fill_double
50 
51  !--- public parameters which is used by mpp_domains_mod and its components.
52  !--- All othere modules should import these parameters from mpp_domains_mod.
53  public :: global_data_domain, cyclic_global_domain, bgrid_ne, bgrid_sw, cgrid_ne, cgrid_sw
54  public :: dgrid_ne, dgrid_sw, fold_west_edge, fold_east_edge, fold_south_edge, fold_north_edge
55  public :: wupdate, eupdate, supdate, nupdate, xupdate, yupdate, bitwise_exact_sum, non_bitwise_exact_sum
56  public :: mpp_domain_time, west, east, south, north, scalar_bit, scalar_pair, bitwise_efp_sum
57  public :: north_east, south_east, south_west, north_west
58  public :: agrid, global, cyclic, domain_id_base, center, corner
59  public :: max_domain_fields, max_tiles
60  public :: zero, ninety, minus_ninety, one_hundred_eighty
61  public :: nonblock_update_tag, edgeupdate, edgeonly, nonsymedgeupdate, nonsymedge
62 
63  !--- public parameters which is used by mpp_domains_mod and its components.
64  !--- All othere modules should import these parameters from mpp_io_mod.
65  public :: mpp_wronly, mpp_rdonly, mpp_append, mpp_overwr, mpp_ascii, mpp_ieee32
66  public :: mpp_native, mpp_netcdf, mpp_sequential, mpp_direct, mpp_single, mpp_multi
67  public :: mpp_delete, mpp_collect, nullunit, nulltime
68  public :: max_file_size, root_global, global_root_only
69 
70  !--- The following parameters are used by mpp_mod and its components.
71  integer, parameter :: MAXPES=2048 !used for dimensioning stuff that might be indexed by pe
72  integer, parameter :: MPP_VERBOSE=1, mpp_debug=2
73  integer, parameter :: ALL_PES=-1, any_pe=-2, null_pe=-3
74  integer, parameter :: NOTE=0, warning=1, fatal=2
75  integer, parameter :: MAX_CLOCKS=400, max_event_types=5, max_events=40000
76  integer, parameter :: EVENT_ALLREDUCE=1, event_broadcast=2, event_recv=3, event_send=4, event_wait=5
77  integer, parameter :: EVENT_ALLTOALL=6
78  integer, parameter :: EVENT_TYPE_CREATE=7, event_type_free=8
79  integer, parameter :: MPP_CLOCK_SYNC=1, mpp_clock_detailed=2
80  integer :: DEFAULT_TAG = 1
81  !--- implimented to centralize _FILL_ values for land_model.F90 into mpp_mod
82  !------- instead of multiple includes of netcdf.inc and manual assignments
83  integer(i4_kind) , parameter :: MPP_FILL_INT = -2147483647 !NF_FILL_INT
84  real(r8_kind) , parameter :: MPP_FILL_DOUBLE = 9.9692099683868690e+36 !NF_FILL_DOUBLE
85  real(r4_kind) , parameter :: MPP_FILL_FLOAT = 9.9692099683868690e+36 !NF_FILL_DOUBLE
86  !--- predefined clock granularities, but you can use any integer
87  !--- using CLOCK_LOOP and above may distort coarser-grain measurements
88  integer, parameter :: CLOCK_COMPONENT=1 !< component level, e.g model, exchange
89  integer, parameter :: CLOCK_SUBCOMPONENT=11 !< top level within a model component, e.g dynamics, physics
90  integer, parameter :: CLOCK_MODULE_DRIVER=21 !< module driver level, e.g adriver that calls multiple
91  !< related physics routines
92  integer, parameter :: CLOCK_MODULE=31 !< module level, e.g main subroutine of a physics module
93  integer, parameter :: CLOCK_ROUTINE=41 !< level of individual subroutine or function
94  integer, parameter :: CLOCK_LOOP=51 !< loops or blocks within a routine
95  integer, parameter :: CLOCK_INFRA=61 !< infrastructure level, e.g halo update
96  integer, parameter :: MAX_BINS=20
97  integer(i8_kind), parameter :: MPP_WAIT=-1, mpp_ready=-2
98 
99  !--- The following parameters are used by mpp_domains_mod and its components.
100  integer, parameter :: GLOBAL=0, cyclic=1
101  integer, parameter :: WEST=2, east=3, south=4, north=5, scalar_bit=6, center=7, corner=8
102  integer, parameter :: SOUTH_WEST=7, south_east=8, north_west=9, north_east=10
103  integer, parameter :: EDGEONLY = 11
104  integer, parameter :: NONSYMEDGE = 12
105  integer, parameter :: SEND=1, recv=2
106  integer, parameter :: GLOBAL_DATA_DOMAIN=2**global, cyclic_global_domain=2**cyclic
107  integer, parameter :: AGRID=0, bgrid=1, cgrid=2, dgrid=3
108  integer, parameter :: BGRID_NE=bgrid+2**north+2**east
109  integer, parameter :: BGRID_SW=bgrid+2**south+2**west
110  integer, parameter :: CGRID_NE=cgrid+2**north+2**east
111  integer, parameter :: CGRID_SW=cgrid+2**south+2**west
112  integer, parameter :: DGRID_NE=dgrid+2**north+2**east
113  integer, parameter :: DGRID_SW=dgrid+2**south+2**west
114  integer, parameter :: FOLD_WEST_EDGE = 2**west, fold_east_edge = 2**east
115  integer, parameter :: FOLD_SOUTH_EDGE=2**south, fold_north_edge=2**north
116  integer, parameter :: WUPDATE=2**west, eupdate=2**east, supdate=2**south, nupdate=2**north
117  integer, parameter :: XUPDATE=wupdate+eupdate, yupdate=supdate+nupdate, scalar_pair=2**scalar_bit
118  integer, parameter :: EDGEUPDATE=2**edgeonly, nonsymedgeupdate=2**nonsymedge
119  integer, parameter :: ZERO=0, ninety=90, minus_ninety=-90, one_hundred_eighty=180
120  integer, parameter :: NONBLOCK_UPDATE_TAG = 2
121 
122 !> @var DOMAIN_ID_BASE acts as a counter increment for domains as they are defined. It's used in
123 !! combination with the flag parameter defined above to create a unique identifier for
124 !! each Domain+flags combination. Therefore, the value of any flag must not exceed DOMAIN_ID_BASE.
125 !! integer(i8_kind), parameter :: DOMAIN_ID_BASE=INT( 2**(4*i8_kind),KIND=i8_kind )
126  integer(i8_kind), parameter :: DOMAIN_ID_BASE = 4294967296_i8_kind !! =(0x100000000)
127  integer, parameter :: NON_BITWISE_EXACT_SUM=0
128  integer, parameter :: BITWISE_EXACT_SUM=1
129  integer, parameter :: BITWISE_EFP_SUM=2
130  integer, parameter :: MPP_DOMAIN_TIME=mpp_debug+1
131  integer, parameter :: MAX_DOMAIN_FIELDS=100
132  integer, parameter :: MAX_TILES=10
133 
134  !--- The following parameters are used by mpp_io_mod and its components.
135  integer, parameter :: MPP_WRONLY=100, mpp_rdonly=101, mpp_append=102, mpp_overwr=103 !< action on open
136  integer, parameter :: MPP_ASCII=200, mpp_ieee32=201, mpp_native=202, mpp_netcdf=203 !< format
137  integer, parameter :: MPP_SEQUENTIAL=300, mpp_direct=301 !< access
138  integer, parameter :: MPP_SINGLE=400, mpp_multi=401 !< threading, fileset
139  integer, parameter :: MPP_DELETE=501, mpp_collect=502 !< action on close
140  integer, parameter :: NULLUNIT=-1 !< returned by PEs not participating in
141  !! IO after collective call with threading
142  !! equal to MPP_SINGLE
143  !--- unique tag used in FMS
144  integer, parameter :: COMM_TAG_1 = 1, comm_tag_2 = 2, comm_tag_3 = 3, comm_tag_4 = 4
145  integer, parameter :: COMM_TAG_5 = 5, comm_tag_6 = 6, comm_tag_7 = 7, comm_tag_8 = 8
146  integer, parameter :: COMM_TAG_9 = 9, comm_tag_10 = 10, comm_tag_11 = 11, comm_tag_12 = 12
147  integer, parameter :: COMM_TAG_13 = 13, comm_tag_14 = 14, comm_tag_15 = 15, comm_tag_16 = 16
148  integer, parameter :: COMM_TAG_17 = 17, comm_tag_18 = 18, comm_tag_19 = 19, comm_tag_20 = 20
149 
150  integer, parameter :: ROOT_GLOBAL = 9
151  integer, parameter :: GLOBAL_ROOT_ONLY = 2**root_global
152  real(r8_kind), parameter :: NULLTIME=-1.
153 #ifdef LARGE_FILE
154  integer(i8_kind), parameter :: MAX_FILE_SIZE = 4294967295
155 #else
156  integer(i8_kind), parameter :: MAX_FILE_SIZE = 2147483647
157 #endif
158 
159  !#####################################################################
160 
161 end module mpp_parameter_mod
162 !> @}
163 ! close documentation grouping