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