7 use netcdf,
only: nf90_inquire_dimension, nf90_max_name
47 integer(i_long),
intent(in) :: file_ncid
48 integer(i_long),
intent(in) :: file_index
49 integer(i_long),
intent(in) :: num_dims
51 integer(i_long),
dimension(:),
allocatable :: unlim_dims
52 integer(i_long) :: num_unlims
53 integer(i_long) :: i, j
55 character(len=NF90_MAX_NAME) :: dim_name
58 allocate(
ncdr_files(file_index)%dims(num_dims))
63 allocate(unlim_dims(num_unlims))
74 ncdr_files(file_index)%dims(i)%dim_name = trim(dim_name)
75 ncdr_files(file_index)%dims(i)%dim_unlim = .false.
78 if (i == unlim_dims(j))
then 79 ncdr_files(file_index)%dims(i)%dim_unlim = .true.
87 integer(i_long),
intent(in) :: file_ncdr_id
88 character(len=*),
intent(in) :: dim_name
90 integer(i_long) :: dim_index
94 do dim_index = 1,
ncdr_files(file_ncdr_id)%ndims
95 if (
ncdr_files(file_ncdr_id)%dims(dim_index)%dim_name == dim_name) &
104 character(len=*),
intent(in) :: dim_name
106 integer(i_long) :: dim_index
114 integer(i_long),
intent(in) :: file_ncdr_id
115 character(len=*),
intent(in) :: dim_name
117 integer(i_long) :: dim_index
125 if (dim_index == -1) &
126 call ncdr_error(
"The specified dimension '" // dim_name //
"' does not exist!")
130 character(len=*),
intent(in) :: dim_name
132 integer(i_long) :: dim_index
140 integer(i_long),
intent(in) :: file_ncdr_id
141 character(len=*),
intent(in) :: dim_name
143 logical :: dim_exists
156 character(len=*),
intent(in) :: dim_name
158 logical :: dim_exists
171 integer(i_long),
intent(in) :: file_ncdr_id
172 character(len=*),
intent(in) :: dim_name
174 integer(i_long) :: dim_index, dim_size
180 dim_size =
ncdr_files(file_ncdr_id)%dims(dim_index)%dim_size
184 character(len=*),
intent(in) :: dim_name
186 integer(i_long) :: dim_size
194 integer(i_long),
intent(in) :: file_ncdr_id
195 character(len=*),
intent(in) :: dim_name
197 integer(i_long) :: dim_index
198 logical :: dim_isunlim
204 dim_isunlim =
ncdr_files(file_ncdr_id)%dims(dim_index)%dim_unlim
208 character(len=*),
intent(in) :: dim_name
210 logical :: dim_isunlim
218 integer(i_long),
intent(in) :: file_ncdr_id
219 integer(i_long),
intent(out),
optional :: num_dims
220 integer(i_long),
intent(out),
optional :: dim_name_mlen
221 character(len=:),
intent(inout),
dimension(:),
allocatable,
optional:: dim_names
223 integer(i_long) :: dim_index, ndims, max_dim_name_len
231 if (
present(num_dims)) &
235 do dim_index = 1, ndims
236 if (len(
ncdr_files(file_ncdr_id)%dims(dim_index)%dim_name) > max_dim_name_len) &
237 max_dim_name_len = len(
ncdr_files(file_ncdr_id)%dims(dim_index)%dim_name)
240 if (
present(dim_name_mlen)) &
241 dim_name_mlen = max_dim_name_len
243 if (
present(dim_names))
then 244 if (.NOT.
allocated(dim_names))
then 245 allocate(
character(max_dim_name_len) :: dim_names(ndims))
247 if (
size(dim_names) /= ndims) &
248 call ncdr_error(
"Invalid allocated array size for dimension names storage!")
249 if (len(dim_names) < max_dim_name_len) &
250 call ncdr_error(
"Invalid allocated array size for dimension names storage! (String length does not match!)")
253 do dim_index = 1, ndims
254 dim_names(dim_index) =
ncdr_files(file_ncdr_id)%dims(dim_index)%dim_name
260 integer(i_long),
intent(out),
optional :: num_dims
261 integer(i_long),
intent(out),
optional :: dim_name_mlen
262 character(len=:),
intent(inout),
dimension(:),
allocatable,
optional:: dim_names
266 if (
present(num_dims))
then 267 if (
present(dim_name_mlen))
then 268 if (
present(dim_names))
then 274 if (
present(dim_names))
then 281 if (
present(dim_name_mlen))
then 282 if (
present(dim_names))
then 284 dim_names = dim_names)
289 if (
present(dim_names))
then logical function nc_diag_read_id_check_dim(file_ncdr_id, dim_name)
integer(c_int) function pf_nf90_inq_unlimdims(ncid, num_unlim_dims, unlim_dims)
integer, parameter, public i_long
integer(i_long) function nc_diag_read_noid_assert_dim(dim_name)
subroutine ncdr_nc_check(status)
integer(i_long) function nc_diag_read_id_lookup_dim(file_ncdr_id, dim_name)
integer(i_long) current_ncdr_id
type(ncdr_file), dimension(:), allocatable ncdr_files
subroutine ncdr_check_current_ncdr_id
subroutine nc_diag_read_id_get_dim_names(file_ncdr_id, num_dims, dim_name_mlen, dim_names)
integer(i_long) function nc_diag_read_id_assert_dim(file_ncdr_id, dim_name)
integer(i_long) function nc_diag_read_id_get_dim(file_ncdr_id, dim_name)
logical function nc_diag_read_noid_check_dim(dim_name)
logical function nc_diag_read_noid_check_dim_unlim(dim_name)
subroutine ncdr_check_ncdr_id(file_ncdr_id)
integer(i_long) function nc_diag_read_noid_get_dim(dim_name)
integer(i_long) function nc_diag_read_noid_lookup_dim(dim_name)
subroutine nc_diag_read_parse_file_dims(file_ncid, file_index, num_dims)
logical function nc_diag_read_id_check_dim_unlim(file_ncdr_id, dim_name)
subroutine ncdr_error(err)