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