FMS  2025.04
Flexible Modeling System
unstructured_domain_read.inc
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 !> @file
19 !> @brief Routines for reading unstructured domain data, used in @ref read_data interface
20 
21 !> @addtogroup fms2_io_mod
22 !> @{
23 
24 !> @brief Wrapper to distinguish interfaces.
25 subroutine unstructured_domain_read_0d(fileobj, &
26  variable_name, &
27  buf, &
28  unlim_dim_level, &
29  corner, &
30 
31  broadcast)
32  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
33  character(len=*), intent(in) :: variable_name !< Variable name.
34  class(*), intent(inout) :: buf !< Array that the data
35  !! will be read into.
36  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
37  !! level.
38  integer, intent(in), optional :: corner !< Array of starting
39  !! indices describing
40  !! where the data
41  !! will be read from.
42 
43  logical, intent(in), optional :: broadcast !< Flag controlling whether or
44  !! not the data will be
45  !! broadcasted to non
46  !! "I/O root" ranks.
47  !! The broadcast will be done
48  !! by default.
49 
50  call netcdf_read_data(fileobj, variable_name, buf, unlim_dim_level, corner, &
51 
52  broadcast)
53 end subroutine unstructured_domain_read_0d
54 !> @brief Wrapper to distinguish interfaces.
55 subroutine unstructured_domain_read_1d(fileobj, &
56  variable_name, &
57  buf, &
58  unlim_dim_level, &
59  corner, &
60  edge_lengths, &
61  broadcast)
62  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
63  character(len=*), intent(in) :: variable_name !< Variable name.
64  class(*), dimension(:), intent(inout) :: buf !< Array that the data
65  !! will be read into.
66  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
67  !! level.
68  integer, dimension(:), intent(in), optional :: corner !< Array of starting
69  !! indices describing
70  !! where the data
71  !! will be read from.
72  integer, dimension(:), intent(in), optional :: edge_lengths !< The number of
73  !! elements that
74  !! will be read
75  !! in each dimension.
76  logical, intent(in), optional :: broadcast !< Flag controlling whether or
77  !! not the data will be
78  !! broadcasted to non
79  !! "I/O root" ranks.
80  !! The broadcast will be done
81  !! by default.
82 
83  call netcdf_read_data(fileobj, variable_name, buf, unlim_dim_level, corner, &
84  edge_lengths, &
85  broadcast)
86 end subroutine unstructured_domain_read_1d
87 !> @brief Wrapper to distinguish interfaces.
88 subroutine unstructured_domain_read_2d(fileobj, &
89  variable_name, &
90  buf, &
91  unlim_dim_level, &
92  corner, &
93  edge_lengths, &
94  broadcast)
95  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
96  character(len=*), intent(in) :: variable_name !< Variable name.
97  class(*), dimension(:,:), intent(inout) :: buf !< Array that the data
98  !! will be read into.
99  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
100  !! level.
101  integer, dimension(:), intent(in), optional :: corner !< Array of starting
102  !! indices describing
103  !! where the data
104  !! will be read from.
105  integer, dimension(:), intent(in), optional :: edge_lengths !< The number of
106  !! elements that
107  !! will be read
108  !! in each dimension.
109  logical, intent(in), optional :: broadcast !< Flag controlling whether or
110  !! not the data will be
111  !! broadcasted to non
112  !! "I/O root" ranks.
113  !! The broadcast will be done
114  !! by default.
115 
116  call netcdf_read_data(fileobj, variable_name, buf, unlim_dim_level, corner, &
117  edge_lengths, &
118  broadcast)
119 end subroutine unstructured_domain_read_2d
120 !> @brief Wrapper to distinguish interfaces.
121 subroutine unstructured_domain_read_3d(fileobj, &
122  variable_name, &
123  buf, &
124  unlim_dim_level, &
125  corner, &
126  edge_lengths, &
127  broadcast)
128  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
129  character(len=*), intent(in) :: variable_name !< Variable name.
130  class(*), dimension(:,:,:), intent(inout) :: buf !< Array that the data
131  !! will be read into.
132  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
133  !! level.
134  integer, dimension(:), intent(in), optional :: corner !< Array of starting
135  !! indices describing
136  !! where the data
137  !! will be read from.
138  integer, dimension(:), intent(in), optional :: edge_lengths !< The number of
139  !! elements that
140  !! will be read
141  !! in each dimension.
142  logical, intent(in), optional :: broadcast !< Flag controlling whether or
143  !! not the data will be
144  !! broadcasted to non
145  !! "I/O root" ranks.
146  !! The broadcast will be done
147  !! by default.
148 
149  call netcdf_read_data(fileobj, variable_name, buf, unlim_dim_level, corner, &
150  edge_lengths, &
151  broadcast)
152 end subroutine unstructured_domain_read_3d
153 !> @brief Wrapper to distinguish interfaces.
154 subroutine unstructured_domain_read_4d(fileobj, &
155  variable_name, &
156  buf, &
157  unlim_dim_level, &
158  corner, &
159  edge_lengths, &
160  broadcast)
161  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
162  character(len=*), intent(in) :: variable_name !< Variable name.
163  class(*), dimension(:,:,:,:), intent(inout) :: buf !< Array that the data
164  !! will be read into.
165  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
166  !! level.
167  integer, dimension(:), intent(in), optional :: corner !< Array of starting
168  !! indices describing
169  !! where the data
170  !! will be read from.
171  integer, dimension(:), intent(in), optional :: edge_lengths !< The number of
172  !! elements that
173  !! will be read
174  !! in each dimension.
175  logical, intent(in), optional :: broadcast !< Flag controlling whether or
176  !! not the data will be
177  !! broadcasted to non
178  !! "I/O root" ranks.
179  !! The broadcast will be done
180  !! by default.
181 
182  call netcdf_read_data(fileobj, variable_name, buf, unlim_dim_level, corner, &
183  edge_lengths, &
184  broadcast)
185 end subroutine unstructured_domain_read_4d
186 !> @brief Wrapper to distinguish interfaces.
187 subroutine unstructured_domain_read_5d(fileobj, &
188  variable_name, &
189  buf, &
190  unlim_dim_level, &
191  corner, &
192  edge_lengths, &
193  broadcast)
194  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
195  character(len=*), intent(in) :: variable_name !< Variable name.
196  class(*), dimension(:,:,:,:,:), intent(inout) :: buf !< Array that the data
197  !! will be read into.
198  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
199  !! level.
200  integer, dimension(:), intent(in), optional :: corner !< Array of starting
201  !! indices describing
202  !! where the data
203  !! will be read from.
204  integer, dimension(:), intent(in), optional :: edge_lengths !< The number of
205  !! elements that
206  !! will be read
207  !! in each dimension.
208  logical, intent(in), optional :: broadcast !< Flag controlling whether or
209  !! not the data will be
210  !! broadcasted to non
211  !! "I/O root" ranks.
212  !! The broadcast will be done
213  !! by default.
214 
215  call netcdf_read_data(fileobj, variable_name, buf, unlim_dim_level, corner, &
216  edge_lengths, &
217  broadcast)
218 end subroutine unstructured_domain_read_5d
219 !> @}
subroutine unstructured_domain_read_4d(fileobj, variable_name, buf, unlim_dim_level, corner, edge_lengths, broadcast)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_read_3d(fileobj, variable_name, buf, unlim_dim_level, corner, edge_lengths, broadcast)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_read_0d(fileobj, variable_name, buf, unlim_dim_level, corner, broadcast)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_read_5d(fileobj, variable_name, buf, unlim_dim_level, corner, edge_lengths, broadcast)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_read_2d(fileobj, variable_name, buf, unlim_dim_level, corner, edge_lengths, broadcast)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_read_1d(fileobj, variable_name, buf, unlim_dim_level, corner, edge_lengths, broadcast)
Wrapper to distinguish interfaces.