FMS  2025.04
Flexible Modeling System
register_unstructured_domain_restart_variable.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 Adds restart variable for unstructured domains for different dimension to be used in
20 !! the @ref register_restart_field interface
21 
22 !> @addtogroup fms2_io_mod
23 !> @{
24 
25 !> @brief Add a domain decomposed variable.
26 subroutine register_unstructured_domain_restart_variable_0d(fileobj, variable_name, vdata, &
27  dimensions, is_optional, &
28  chunksizes)
29 
30  type(fmsnetcdfunstructureddomainfile_t), intent(inout) :: fileobj !< File object.
31  character(len=*), intent(in) :: variable_name !< Variable name.
32  class(*), intent(in), target :: vdata !< Variable data.
33  character(len=*), dimension(:), intent(in), optional :: dimensions !< Dimension names.
34  logical, intent(in), optional :: is_optional !< Prevent errors in read-only files
35  !! if a variable does not exist.
36  integer, intent(in), optional :: chunksizes(:) !< netcdf chunksize to use for this variable
37  !! This feature is only
38  !! available for netcdf4 files
39 
40  call netcdf_add_restart_variable(fileobj, variable_name, vdata, dimensions, is_optional, &
41  chunksizes=chunksizes)
43 
44 
45 !> @brief Add a domain decomposed variable.
46 subroutine register_unstructured_domain_restart_variable_1d(fileobj, variable_name, vdata, &
47  dimensions, is_optional, &
48  chunksizes)
49 
50  type(fmsnetcdfunstructureddomainfile_t), intent(inout) :: fileobj !< File object.
51  character(len=*), intent(in) :: variable_name !< Variable name.
52  class(*), dimension(:), intent(in), target :: vdata !< Variable data.
53  character(len=*), dimension(:), intent(in), optional :: dimensions !< Dimension names.
54  logical, intent(in), optional :: is_optional !< Prevent errors in read-only files
55  !! if a variable does not exist.
56  integer, intent(in), optional :: chunksizes(:) !< netcdf chunksize to use for this variable
57  !! This feature is only
58  !! available for netcdf4 files
59 
60  call netcdf_add_restart_variable(fileobj, variable_name, vdata, dimensions, is_optional, &
61  chunksizes=chunksizes)
63 
64 
65 !> @brief Add a domain decomposed variable.
66 subroutine register_unstructured_domain_restart_variable_2d(fileobj, variable_name, vdata, &
67  dimensions, is_optional, &
68  chunksizes )
69 
70  type(fmsnetcdfunstructureddomainfile_t), intent(inout) :: fileobj !< File object.
71  character(len=*), intent(in) :: variable_name !< Variable name.
72  class(*), dimension(:,:), intent(in), target :: vdata !< Variable data.
73  character(len=*), dimension(:), intent(in), optional :: dimensions !< Dimension names.
74  logical, intent(in), optional :: is_optional !< Prevent errors in read-only files
75  !! if a variable does not exist.
76  integer, intent(in), optional :: chunksizes(:) !< netcdf chunksize to use for this variable
77  !! This feature is only
78  !! available for netcdf4 files
79 
80  call netcdf_add_restart_variable(fileobj, variable_name, vdata, dimensions, is_optional, &
81  chunksizes=chunksizes)
83 
84 
85 !> @brief Add a domain decomposed variable.
86 subroutine register_unstructured_domain_restart_variable_3d(fileobj, variable_name, vdata, &
87  dimensions, is_optional, &
88  chunksizes)
89 
90  type(fmsnetcdfunstructureddomainfile_t), intent(inout) :: fileobj !< File object.
91  character(len=*), intent(in) :: variable_name !< Variable name.
92  class(*), dimension(:,:,:), intent(in), target :: vdata !< Variable data.
93  character(len=*), dimension(:), intent(in), optional :: dimensions !< Dimension names.
94  logical, intent(in), optional :: is_optional !< Prevent errors in read-only files
95  !! if a variable does not exist.
96  integer, intent(in), optional :: chunksizes(:) !< netcdf chunksize to use for this variable
97  !! This feature is only
98  !! available for netcdf4 files
99 
100  call netcdf_add_restart_variable(fileobj, variable_name, vdata, dimensions, is_optional, &
101  chunksizes=chunksizes)
103 
104 
105 !> @brief Add a domain decomposed variable.
106 subroutine register_unstructured_domain_restart_variable_4d(fileobj, variable_name, vdata, &
107  dimensions, is_optional, &
108  chunksizes)
109 
110  type(fmsnetcdfunstructureddomainfile_t), intent(inout) :: fileobj !< File object.
111  character(len=*), intent(in) :: variable_name !< Variable name.
112  class(*), dimension(:,:,:,:), intent(in), target :: vdata !< Variable data.
113  character(len=*), dimension(:), intent(in), optional :: dimensions !< Dimension names.
114  logical, intent(in), optional :: is_optional !< Prevent errors in read-only files
115  !! if a variable does not exist.
116  integer, intent(in), optional :: chunksizes(:) !< netcdf chunksize to use for this variable
117  !! This feature is only
118  !! available for netcdf4 files
119 
120  call netcdf_add_restart_variable(fileobj, variable_name, vdata, dimensions, is_optional, &
121  chunksizes=chunksizes)
123 
124 
125 !> @brief Add a domain decomposed variable.
126 subroutine register_unstructured_domain_restart_variable_5d(fileobj, variable_name, vdata, &
127  dimensions, is_optional, &
128  chunksizes)
129 
130  type(fmsnetcdfunstructureddomainfile_t), intent(inout) :: fileobj !< File object.
131  character(len=*), intent(in) :: variable_name !< Variable name.
132  class(*), dimension(:,:,:,:,:), intent(in), target :: vdata !< Variable data.
133  character(len=*), dimension(:), intent(in), optional :: dimensions !< Dimension names.
134  logical, intent(in), optional :: is_optional !< Prevent errors in read-only files
135  !! if a variable does not exist.
136  integer, intent(in), optional :: chunksizes(:) !< netcdf chunksize to use for this variable
137  !! This feature is only
138  !! available for netcdf4 files
139 
140  call netcdf_add_restart_variable(fileobj, variable_name, vdata, dimensions, is_optional, &
141  chunksizes=chunksizes)
143 !> @}
subroutine register_unstructured_domain_restart_variable_4d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine register_unstructured_domain_restart_variable_2d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine register_unstructured_domain_restart_variable_3d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine register_unstructured_domain_restart_variable_1d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine register_unstructured_domain_restart_variable_5d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine register_unstructured_domain_restart_variable_0d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.