1 !***********************************************************************
2 !* GNU Lesser General Public License
4 !* This file is part of the GFDL Flexible Modeling System (FMS).
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.
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
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
21 !> @brief Parameters values for use in various @ref mpp modules
22 !> If needed, these values should be imported from their corresponding mpp module
24 !> @addtogroup mpp_parameter_mod
26 module mpp_parameter_mod
32 ! Include variable "version" to be written to log file.
33 #include<file_version.h>
36 !--- public paramters 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
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
52 !--- public paramters 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
64 !--- public paramters 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
71 !--- The following paramters 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
100 !--- The following paramters 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
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
135 !--- The following paramters 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
151 integer, parameter :: ROOT_GLOBAL = 9
152 integer, parameter :: GLOBAL_ROOT_ONLY = 2**ROOT_GLOBAL
153 real(r8_kind), parameter :: NULLTIME=-1.
155 integer(i8_kind), parameter :: MAX_FILE_SIZE = 4294967295
157 integer(i8_kind), parameter :: MAX_FILE_SIZE = 2147483647
160 !#####################################################################
162 end module mpp_parameter_mod
164 ! close documentation grouping