FMS  2024.03
Flexible Modeling System
unstructured_domain_write.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 to write data from an unstructured domain decomposition.
21 !! Used in the @ref write_data interface
22 
23 !> @addtogroup fms2_io_mod
24 !> @{
25 
26 !> @brief Wrapper to distinguish interfaces.
27 subroutine unstructured_domain_write_0d(fileobj, variable_name, variable_data, &
28  unlim_dim_level, corner)
29 
30  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
31  character(len=*), intent(in) :: variable_name !< Variable name.
32  class(*), intent(in) :: variable_data !< Data that will be
33  !! written.
34  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
35  !! level.
36  integer, intent(in), optional :: corner !< Array of starting
37  !! indices describing
38  !! where the data
39  !! will be written to.
40 
41  call compressed_write(fileobj, variable_name, variable_data, unlim_dim_level, corner)
42 end subroutine unstructured_domain_write_0d
43 
44 
45 !> @brief Wrapper to distinguish interfaces.
46 subroutine unstructured_domain_write_1d(fileobj, variable_name, variable_data, &
47  unlim_dim_level, corner, edge_lengths)
48 
49  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
50  character(len=*), intent(in) :: variable_name !< Variable name.
51  class(*), dimension(:), intent(in) :: variable_data !< Data that will be
52  !! written.
53  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
54  !! level.
55  integer, dimension(1), intent(in), optional :: corner !< Array of starting
56  !! indices describing
57  !! where the data
58  !! will be written to.
59  integer, dimension(1), intent(in), optional :: edge_lengths !< The number of
60  !! elements that
61  !! will be written
62  !! in each dimension.
63 
64  call compressed_write(fileobj, variable_name, variable_data, unlim_dim_level, corner, &
65  edge_lengths=edge_lengths)
66 end subroutine unstructured_domain_write_1d
67 
68 
69 !> @brief Wrapper to distinguish interfaces.
70 subroutine unstructured_domain_write_2d(fileobj, variable_name, variable_data, &
71  unlim_dim_level, corner, edge_lengths)
72 
73  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
74  character(len=*), intent(in) :: variable_name !< Variable name.
75  class(*), dimension(:,:), intent(in) :: variable_data !< Data that will be
76  !! written.
77  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
78  !! level.
79  integer, dimension(2), intent(in), optional :: corner !< Array of starting
80  !! indices describing
81  !! where the data
82  !! will be written to.
83  integer, dimension(2), intent(in), optional :: edge_lengths !< The number of
84  !! elements that
85  !! will be written
86  !! in each dimension.
87 
88  call compressed_write(fileobj, variable_name, variable_data, unlim_dim_level, corner, &
89  edge_lengths=edge_lengths)
90 end subroutine unstructured_domain_write_2d
91 
92 
93 !> @brief Wrapper to distinguish interfaces.
94 subroutine unstructured_domain_write_3d(fileobj, variable_name, variable_data, &
95  unlim_dim_level, corner, edge_lengths)
96 
97  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
98  character(len=*), intent(in) :: variable_name !< Variable name.
99  class(*), dimension(:,:,:), intent(in) :: variable_data !< Data that will be
100  !! written.
101  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
102  !! level.
103  integer, dimension(3), intent(in), optional :: corner !< Array of starting
104  !! indices describing
105  !! where the data
106  !! will be written to.
107  integer, dimension(3), intent(in), optional :: edge_lengths !< The number of
108  !! elements that
109  !! will be written
110  !! in each dimension.
111 
112  call compressed_write(fileobj, variable_name, variable_data, unlim_dim_level, corner, &
113  edge_lengths=edge_lengths)
114 end subroutine unstructured_domain_write_3d
115 
116 
117 !> @brief Wrapper to distinguish interfaces.
118 subroutine unstructured_domain_write_4d(fileobj, variable_name, variable_data, &
119  unlim_dim_level, corner, edge_lengths)
120 
121  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
122  character(len=*), intent(in) :: variable_name !< Variable name.
123  class(*), dimension(:,:,:,:), intent(in) :: variable_data !< Data that will be
124  !! written.
125  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
126  !! level.
127  integer, dimension(4), intent(in), optional :: corner !< Array of starting
128  !! indices describing
129  !! where the data
130  !! will be written to.
131  integer, dimension(4), intent(in), optional :: edge_lengths !< The number of
132  !! elements that
133  !! will be written
134  !! in each dimension.
135 
136  call compressed_write(fileobj, variable_name, variable_data, unlim_dim_level, corner, &
137  edge_lengths=edge_lengths)
138 end subroutine unstructured_domain_write_4d
139 
140 
141 !> @brief Wrapper to distinguish interfaces.
142 subroutine unstructured_domain_write_5d(fileobj, variable_name, variable_data, &
143  unlim_dim_level, corner, edge_lengths)
144 
145  type(fmsnetcdfunstructureddomainfile_t), intent(in) :: fileobj !< File object.
146  character(len=*), intent(in) :: variable_name !< Variable name.
147  class(*), dimension(:,:,:,:,:), intent(in) :: variable_data !< Data that will be
148  !! written.
149  integer, intent(in), optional :: unlim_dim_level !< Unlimited dimension
150  !! level.
151  integer, dimension(5), intent(in), optional :: corner !< Array of starting
152  !! indices describing
153  !! where the data
154  !! will be written to.
155  integer, dimension(5), intent(in), optional :: edge_lengths !< The number of
156  !! elements that
157  !! will be written
158  !! in each dimension.
159 
160  call compressed_write(fileobj, variable_name, variable_data, unlim_dim_level, corner, &
161  edge_lengths=edge_lengths)
162 end subroutine unstructured_domain_write_5d
163 !> @}
subroutine unstructured_domain_write_2d(fileobj, variable_name, variable_data, unlim_dim_level, corner, edge_lengths)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_write_3d(fileobj, variable_name, variable_data, unlim_dim_level, corner, edge_lengths)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_write_0d(fileobj, variable_name, variable_data, unlim_dim_level, corner)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_write_4d(fileobj, variable_name, variable_data, unlim_dim_level, corner, edge_lengths)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_write_1d(fileobj, variable_name, variable_data, unlim_dim_level, corner, edge_lengths)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_write_5d(fileobj, variable_name, variable_data, unlim_dim_level, corner, edge_lengths)
Wrapper to distinguish interfaces.