FV3 Bundle
ncdc_metadata.F90
Go to the documentation of this file.
5  num_unlims, &
10  cli_arg_count, &
11 #ifdef use_mpi
12  data_blobs, &
13  cur_proc
14 #else
15  data_blobs
16 #endif
17  use ncdc_dims, only: nc_diag_cat_lookup_dim, &
24  use ncdc_cli_process, only: ncdc_usage
25  use netcdf, only: nf90_inquire_attribute, nf90_get_att, &
26  nf90_put_att, nf90_open, nf90_close, nf90_inquire, &
27  nf90_inq_attname, nf90_inquire_dimension, &
28  nf90_inquire_variable, nf90_def_dim, nf90_def_var, &
29  nf90_def_var_chunking, nf90_def_var_deflate, &
30  nf90_byte, nf90_short, nf90_int, nf90_float, nf90_double, &
31  nf90_char, nf90_fill_byte, nf90_fill_short, nf90_fill_int, &
32  nf90_fill_float, nf90_fill_double, nf90_fill_char, &
33  nf90_global, nf90_nowrite, nf90_enotatt, &
34  nf90_noerr, nf90_max_name, nf90_unlimited, nf90_chunked
36 
37  implicit none
38 
39  contains
40  subroutine nc_diag_cat_copy_attr(attr_name, var_id_in, var_id_out)
41  character(len=*), intent(in) :: attr_name
42  integer(i_long), intent(in) :: var_id_in
43  integer(i_long), intent(in), optional :: var_id_out
44 
45  integer(i_byte), dimension(:), allocatable :: byte_arr
46  integer(i_short),dimension(:), allocatable :: short_arr
47  integer(i_long), dimension(:), allocatable :: long_arr
48  real(r_single),dimension(:), allocatable :: rsingle_arr
49  real(r_double),dimension(:), allocatable :: rdouble_arr
50  character(len=:), allocatable :: string_arr
51 
52  integer(i_long) :: attr_type, attr_len, final_var_id_out
53 
54  call ncdc_check(nf90_inquire_attribute(ncid_input, var_id_in, attr_name, &
55  xtype = attr_type, len = attr_len))
56 
57  if (.NOT. present(var_id_out)) then
58  if (var_id_in /= nf90_global) &
59  call ncdc_error("BUG! var_id_out not specified even when var_id_in is var-specific!")
60  final_var_id_out = var_id_in
61  else
62  final_var_id_out = var_id_out
63  end if
64 
65  if (attr_type == nf90_byte) then
66  allocate(byte_arr(attr_len))
67  call ncdc_check(nf90_get_att(ncid_input, var_id_in, attr_name, byte_arr))
68  call ncdc_check(nf90_put_att(ncid_output, final_var_id_out, attr_name, byte_arr))
69  deallocate(byte_arr)
70  else if (attr_type == nf90_short) then
71  allocate(short_arr(attr_len))
72  call ncdc_check(nf90_get_att(ncid_input, var_id_in, attr_name, short_arr))
73  call ncdc_check(nf90_put_att(ncid_output, final_var_id_out, attr_name, short_arr))
74  deallocate(short_arr)
75  else if (attr_type == nf90_int) then
76  allocate(long_arr(attr_len))
77  call ncdc_check(nf90_get_att(ncid_input, var_id_in, attr_name, long_arr))
78  call ncdc_check(nf90_put_att(ncid_output, final_var_id_out, attr_name, long_arr))
79  deallocate(long_arr)
80  else if (attr_type == nf90_float) then
81  allocate(rsingle_arr(attr_len))
82  call ncdc_check(nf90_get_att(ncid_input, var_id_in, attr_name, rsingle_arr))
83  call ncdc_check(nf90_put_att(ncid_output, final_var_id_out, attr_name, rsingle_arr))
84  deallocate(rsingle_arr)
85  else if (attr_type == nf90_double) then
86  allocate(rdouble_arr(attr_len))
87  call ncdc_check(nf90_get_att(ncid_input, var_id_in, attr_name, rdouble_arr))
88  call ncdc_check(nf90_put_att(ncid_output, final_var_id_out, attr_name, rdouble_arr))
89  deallocate(rdouble_arr)
90  else if (attr_type == nf90_char) then
91  allocate(character(len=attr_len) :: string_arr)
92  call ncdc_check(nf90_get_att(ncid_input, var_id_in, attr_name, string_arr))
93  call ncdc_check(nf90_put_att(ncid_output, final_var_id_out, attr_name, string_arr))
94  deallocate(string_arr)
95  else
96  call ncdc_error("Unable to copy attribute for unknown type!")
97  end if
98  end subroutine nc_diag_cat_copy_attr
99 
100  subroutine nc_diag_cat_metadata_pass
101  character(len=1000) :: err_string
102  integer(i_long) :: old_dim_arr_total = 0, old_var_arr_total = 0
103 
104  integer(i_long) :: tmp_dim_index, tmp_attr_index
105  integer(i_long) :: input_ndims, cached_ndims = -1
106  integer(i_long) :: input_nvars, cached_nvars = -1
107  integer(i_long) :: input_nattrs
108 
109  character(len=NF90_MAX_NAME) :: tmp_var_name
110  integer(i_long) :: tmp_var_type, tmp_var_ndims
111  integer(i_long), dimension(:), allocatable :: tmp_var_dimids
112  character(len=NF90_MAX_NAME) , allocatable :: tmp_var_dim_names(:)
113 
114  integer(i_long), dimension(:), allocatable :: unlim_dims
115  logical :: is_unlim = .false.
116 
117  character(len=NF90_MAX_NAME) :: tmp_dim_name, tmp_attr_name
118  integer(i_long) :: tmp_dim_size
119 
120  integer(i_long) :: arg_index, var_index, i
121 
122  integer(i_long) :: nc_err
123 
124  character(:), allocatable :: input_file_cut
125 
127 
128 #ifndef QUIET
129 #ifdef USE_MPI
130  if (cur_proc == 0) &
131 #endif
132  call ncdc_info("Scanning NetCDF files for dimensions and variables...")
133 #endif
134 
135  do arg_index = 1, input_count
136  call get_command_argument(2 + arg_index, input_file)
137 
138  input_file_cut = trim(input_file)
139 
140  if (len(input_file_cut) <= 0) then
141  call ncdc_usage("Invalid input file name - likely blank!")
142  end if
143 
144  if (input_file_cut == output_file) then
145  call ncdc_warning(" -> Ignoring output file in input file list.")
146  call ncdc_info(" -> Skipping " // input_file_cut // " since it is the output file...")
147  else
148 #ifndef QUIET
149 #ifdef USE_MPI
150  if (cur_proc == 0) &
151 #endif
152  call ncdc_info(" -> Opening " // input_file_cut // " for reading...")
153 #endif
154 
155  call ncdc_check(nf90_open(input_file, nf90_nowrite, ncid_input))
156 
157  ! Get top level info about the file!
158  call ncdc_check(nf90_inquire(ncid_input, ndimensions = input_ndims, &
159  nvariables = input_nvars, nattributes = input_nattrs))
160 
161 #ifdef USE_MPI
162  if (cur_proc == 0) then
163 #endif
164  ! Fetch attributes and only add if they are NOT in the final file
165  do tmp_attr_index = 1, input_nattrs
166  call ncdc_check(nf90_inq_attname(ncid_input, nf90_global, tmp_attr_index, tmp_attr_name))
167 
168  nc_err = nf90_inquire_attribute(ncid_output, &
169  nf90_global, trim(tmp_attr_name))
170 
171  ! If attribute doesn't exist, add it!
172  if (nc_err == nf90_enotatt) then
173  call nc_diag_cat_copy_attr(trim(tmp_attr_name), nf90_global)
174  else if (nc_err /= nf90_noerr) then
175  ! Sanity check - could be another error!
176  call ncdc_check(nc_err)
177  end if
178  end do
179 #ifdef USE_MPI
180  end if
181 #endif
182 #ifdef DEBUG
183  write (*, "(A, I0)") "Number of dimensions: ", input_ndims
184 #endif
185 
186  if (cached_ndims == -1) &
187  cached_ndims = input_ndims
188 
189 
190  if (input_ndims == 0) then
191 #ifndef QUIET
192  call ncdc_warning("No dimensions found in file " // input_file_cut // "! Skipping file...")
193 #endif
194  call ncdc_check(nf90_close(ncid_input))
195  cycle
196  end if
197 
198 #ifndef QUIET
199  if (input_nvars == 0) &
200  call ncdc_warning("No variables found in file " // input_file_cut // "!")
201 
202  if (cached_ndims /= input_ndims) &
203  call ncdc_warning("Number of dimensions in " // trim(input_file) // " does not match first input file.")
204 #endif
205 
206  ! Get unlimited dimension information
208 
209 #ifdef DEBUG
210  write (*, "(A, I0)") "Number of unlimited dimensions: ", num_unlims
211 #endif
212 
213  allocate(unlim_dims(num_unlims))
214 
216 
217  ! Loop through each dimension!
218  do tmp_dim_index = 1, input_ndims
219  call ncdc_check(nf90_inquire_dimension(ncid_input, tmp_dim_index, &
220  tmp_dim_name, tmp_dim_size))
221 
222  is_unlim = .false.
223 
224  do i = 1, num_unlims
225  if (tmp_dim_index == unlim_dims(i)) then
226  is_unlim = .true.
227  exit
228  end if
229  end do
230 
231  if (is_unlim) then
232 #ifdef DEBUG
233  write (*, "(A, I0, A, I0, A)") " => Dimension #", tmp_dim_index, ": " // &
234  trim(tmp_dim_name) // " (size: ", &
235  tmp_dim_size, &
236  " - UNLIMITED)"
237 #endif
238  call nc_diag_cat_metadata_add_dim(tmp_dim_name, -1, tmp_dim_size)
239  else
240 #ifdef DEBUG
241  write (*, "(A, I0, A, I0, A)") " => Dimension #", tmp_dim_index, ": " // &
242  trim(tmp_dim_name) // " (size: ", &
243  tmp_dim_size, &
244  ")"
245 #endif
246  call nc_diag_cat_metadata_add_dim(trim(tmp_dim_name), tmp_dim_size)
247  end if
248  end do
249 
250  deallocate(unlim_dims)
251 
252  ! Variables
253 #ifdef DEBUG
254  write (*, "(A, I0)") "Number of variables: ", input_nvars
255 #endif
256 
257  if (cached_nvars == -1) cached_nvars = input_nvars
258 #ifndef QUIET
259  if (cached_nvars /= input_nvars) &
260  call ncdc_warning("Number of variables in " // trim(input_file) // " does not match first input file.")
261 #endif
262 
263  if (input_nvars == 0) then
264  call ncdc_check(nf90_close(ncid_input))
265  cycle
266  end if
267 
268  ! Loop through each variable!
269  do var_index = 1, input_nvars
270  ! Grab number of dimensions and attributes first
271  call ncdc_check(nf90_inquire_variable(ncid_input, var_index, name = tmp_var_name, &
272  ndims = tmp_var_ndims, xtype = tmp_var_type))
273 
274  ! Allocate temporary variable dimids storage!
275  allocate(tmp_var_dimids(tmp_var_ndims))
276  allocate(tmp_var_dim_names(tmp_var_ndims))
277 
278  ! Grab the actual dimension IDs and attributes
279 
280  call ncdc_check(nf90_inquire_variable(ncid_input, var_index, dimids = tmp_var_dimids, &
281  xtype = tmp_var_type))
282 
283  if ((tmp_var_ndims <= 2) .OR. &
284  ((tmp_var_ndims == 3) .AND. (tmp_var_type == nf90_char))) then
285 
286 #ifdef DEBUG
287  write (*, "(A, I0, A, I0)") " => Variable #", var_index, ": " // &
288  trim(tmp_var_name)
289  write (*, "(A)", advance = "NO") " => Dimension IDs: "
290 
291  do i = 1, tmp_var_ndims
292  if (i /= 1) write (*, "(A)", advance = "NO") ", "
293  write (*, "(I0)", advance = "NO") tmp_var_dimids(i)
294  end do
295 
296  write (*, "(A)") ""
297 
298  write (*, "(A)", advance = "NO") " => Dimensions: "
299 #endif
300 
301  do i = 1, tmp_var_ndims
302 #ifdef DEBUG
303  if (i /= 1) write (*, "(A)", advance = "NO") ", "
304 #endif
305  call ncdc_check(nf90_inquire_dimension(ncid_input, tmp_var_dimids(i), tmp_var_dim_names(i)))
306 #ifdef DEBUG
307  write (*, "(A)", advance = "NO") trim(tmp_var_dim_names(i))
308 #endif
309  end do
310 
311 #ifdef DEBUG
312  write (*, "(A)") ""
313 #endif
314 
315  call nc_diag_cat_metadata_add_var(trim(tmp_var_name), tmp_var_type, tmp_var_ndims, tmp_var_dim_names)
316  else
317  write (err_string, "(A, I0, A)") &
318  "Variables with >2 dimensions NOT supported." // &
319  char(10) // " " // &
320  "(Variable '" // trim(tmp_var_name) // "' has ", &
321  tmp_var_ndims, &
322  " dimensions!)"
323  call ncdc_error(trim(err_string))
324  end if
325  ! Deallocate
326  deallocate(tmp_var_dimids)
327  deallocate(tmp_var_dim_names)
328  end do
329 
330 #ifdef DEBUG
331  write (*, "(A)") " => For all variables, the order of dimensions are INVERTED!"
332 #endif
333 
334  call ncdc_check(nf90_close(ncid_input))
335 
336  old_dim_arr_total = dim_arr_total
337  old_var_arr_total = var_arr_total
338  end if
339  end do
340  end subroutine nc_diag_cat_metadata_pass
341 
342  subroutine nc_diag_cat_metadata_define
343  integer(i_long) :: i, j
344 
345  call ncdc_info("Creating new dimensions and variables for output file...")
346 
347  call ncdc_info(" -> Defining dimensions...")
348 
349  if (dim_arr_total == 0) &
350  call ncdc_warning("No dimensions found in input files, so not defining anything.")
351 
352  do i = 1, dim_arr_total
353  if (dim_sizes(i) == -1) then
354  call ncdc_check(nf90_def_dim(ncid_output, dim_names(i), &
355  nf90_unlimited, dim_output_ids(i)))
356  else
357  call ncdc_check(nf90_def_dim(ncid_output, dim_names(i), &
358  dim_sizes(i), dim_output_ids(i)))
359  end if
360 #ifdef DEBUG
361  write(*, "(A, I0, A, I0)") "STORED DIMID for dim " // trim(dim_names(i)) // ": ", &
362  dim_output_ids(i), " | size: ", dim_sizes(i)
363 #endif
364  end do
365 
366  if (var_arr_total == 0) &
367  call ncdc_warning("No variables found in input files, so not defining anything.")
368 
369  call ncdc_info(" -> Defining variables...")
370  do i = 1, var_arr_total
371  do j = 1, var_dim_names(i)%num_names
372  var_dim_names(i)%output_dim_ids(j) = &
374 #ifdef DEBUG
375  write(*, "(A, I0)") "Paired ID for dim " // trim(var_dim_names(i)%dim_names(j)) // ": ", &
376  var_dim_names(i)%output_dim_ids(j)
377 #endif
378  end do
379 
380 #ifdef DEBUG
381  write (*, "(A, I0, A)") "Defining variable: " // trim(var_names(i)) // " (type = ", var_types(i), ")"
382 
383  print *, "var_dim_names(i)%output_dim_ids", var_dim_names(i)%output_dim_ids
384  print *, "LEN var_dim_names(i)%output_dim_ids", size(var_dim_names(i)%output_dim_ids)
385 #endif
386 
387  call ncdc_check(nf90_def_var(ncid_output, var_names(i), var_types(i), &
388  var_dim_names(i)%output_dim_ids, &
389  var_output_ids(i)))
390 
391 #ifdef DEBUG
392  if (var_dim_names(i)%num_names == 1) print *, "DIM #1", var_dim_names(i)%dim_names(1)
393  if (var_dim_names(i)%num_names == 2) print *, "DIM #2", var_dim_names(i)%dim_names(2)
394  if (var_dim_names(i)%num_names == 3) print *, "DIM #3", var_dim_names(i)%dim_names(3)
395 #endif
396 
397  if (var_hasunlim(i)) then
398  if (var_dim_names(i)%num_names == 1) then
399  call ncdc_check(nf90_def_var_chunking(ncid_output, var_output_ids(i), &
400  nf90_chunked, (/ nc_diag_cat_chunk_size /) ))
401  else if (var_dim_names(i)%num_names == 2) then
402  call ncdc_check(nf90_def_var_chunking(ncid_output, var_output_ids(i), &
403  nf90_chunked, (/ dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(1))), &
405  else if (var_dim_names(i)%num_names == 3) then
406  call ncdc_check(nf90_def_var_chunking(ncid_output, var_output_ids(i), &
407  nf90_chunked, &
408  (/ dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(1))), &
409  dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(2))), &
411  end if
412  else
413  if (var_dim_names(i)%num_names == 1) then
414  call ncdc_check(nf90_def_var_chunking(ncid_output, var_output_ids(i), &
415  nf90_chunked, (/ dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(1))) /) ))
416  else if (var_dim_names(i)%num_names == 2) then
417  call ncdc_check(nf90_def_var_chunking(ncid_output, var_output_ids(i), &
418  nf90_chunked, (/ dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(1))), &
419  dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(2))) /) ))
420  else if (var_dim_names(i)%num_names == 3) then
421  call ncdc_check(nf90_def_var_chunking(ncid_output, var_output_ids(i), &
422  nf90_chunked, &
423  (/ dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(1))), &
424  dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(2))), &
425  dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(3))) /) ))
426  end if
427  end if
428 
429  call ncdc_check(nf90_def_var_deflate(ncid_output, var_output_ids(i), &
430  shuffle = 1, deflate = 1, deflate_level = nc_diag_cat_gzip_compress))
431  end do
432  end subroutine nc_diag_cat_metadata_define
433 
434  subroutine nc_diag_cat_metadata_alloc
435  integer(i_long), dimension(3) :: alloc_dim_sizes = 0
436  integer(i_long) :: i
437 
438  ! Next portion depends on defines/vars in ncdc_data_decl.F90
439  call ncdc_info(" -> Allocating data storage for variables...")
440 
441  allocate(data_blobs(var_arr_total))
442 
443  do i = 1, var_arr_total
444  if (var_dim_names(i)%num_names == 1) then
445  alloc_dim_sizes = (/ &
446  dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(1))), &
447  0, &
448  0 /)
449 
450  ! Check for unlimited sizes and replace them!
451  if (alloc_dim_sizes(1) == -1) &
452  alloc_dim_sizes(1) = &
454 
455  if (var_types(i) == nf90_byte) allocate(data_blobs(i)%byte_buffer(alloc_dim_sizes(1)))
456  if (var_types(i) == nf90_short) allocate(data_blobs(i)%short_buffer(alloc_dim_sizes(1)))
457  if (var_types(i) == nf90_int) allocate(data_blobs(i)%long_buffer(alloc_dim_sizes(1)))
458  if (var_types(i) == nf90_float) allocate(data_blobs(i)%rsingle_buffer(alloc_dim_sizes(1)))
459  if (var_types(i) == nf90_double) allocate(data_blobs(i)%rdouble_buffer(alloc_dim_sizes(1)))
460  if (var_types(i) == nf90_char) call ncdc_error("1D character variable type not supported!")
461 
462  if (var_types(i) == nf90_byte) data_blobs(i)%byte_buffer = nf90_fill_byte
463  if (var_types(i) == nf90_short) data_blobs(i)%short_buffer = nf90_fill_short
464  if (var_types(i) == nf90_int) data_blobs(i)%long_buffer = nf90_fill_int
465  if (var_types(i) == nf90_float) data_blobs(i)%rsingle_buffer = nf90_fill_float
466  if (var_types(i) == nf90_double) data_blobs(i)%rdouble_buffer = nf90_fill_double
467  else if (var_dim_names(i)%num_names == 2) then
468  alloc_dim_sizes = (/ &
469  dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(1))), &
470  dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(2))), &
471  0 /)
472 
473  ! Check for unlimited sizes and replace them!
474  if (alloc_dim_sizes(2) == -1) &
475  alloc_dim_sizes(2) = &
477 
478  if (var_types(i) == nf90_byte) allocate(data_blobs(i)%byte_2d_buffer(alloc_dim_sizes(1), alloc_dim_sizes(2)))
479  if (var_types(i) == nf90_short) allocate(data_blobs(i)%short_2d_buffer(alloc_dim_sizes(1), alloc_dim_sizes(2)))
480  if (var_types(i) == nf90_int) allocate(data_blobs(i)%long_2d_buffer(alloc_dim_sizes(1), alloc_dim_sizes(2)))
481  if (var_types(i) == nf90_float) allocate(data_blobs(i)%rsingle_2d_buffer(alloc_dim_sizes(1), alloc_dim_sizes(2)))
482  if (var_types(i) == nf90_double) allocate(data_blobs(i)%rdouble_2d_buffer(alloc_dim_sizes(1), alloc_dim_sizes(2)))
483  if (var_types(i) == nf90_char) allocate(data_blobs(i)%string_buffer(alloc_dim_sizes(1), alloc_dim_sizes(2)))
484 
485  if (var_types(i) == nf90_byte) data_blobs(i)%byte_2d_buffer = nf90_fill_byte
486  if (var_types(i) == nf90_short) data_blobs(i)%short_2d_buffer = nf90_fill_short
487  if (var_types(i) == nf90_int) data_blobs(i)%long_2d_buffer = nf90_fill_int
488  if (var_types(i) == nf90_float) data_blobs(i)%rsingle_2d_buffer = nf90_fill_float
489  if (var_types(i) == nf90_double) data_blobs(i)%rdouble_2d_buffer = nf90_fill_double
490  if (var_types(i) == nf90_char) data_blobs(i)%string_buffer = nf90_fill_char
491 
492  else if (var_dim_names(i)%num_names == 3) then
493  alloc_dim_sizes = (/ &
494  dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(1))), &
495  dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(2))), &
496  dim_sizes(nc_diag_cat_lookup_dim(var_dim_names(i)%dim_names(3))) /)
497 
498  ! Check for unlimited sizes and replace them!
499  ! (Though, this should always be the case...)
500  if (alloc_dim_sizes(3) == -1) &
501  alloc_dim_sizes(3) = &
503 
504  if (var_types(i) == nf90_char) then
505  allocate(data_blobs(i)%string_2d_buffer(alloc_dim_sizes(1), alloc_dim_sizes(2), alloc_dim_sizes(3)))
506  data_blobs(i)%string_2d_buffer = nf90_fill_char
507  else
508  call ncdc_error("3D non-character variable type not supported!")
509  end if
510  end if
511 
512  data_blobs(i)%alloc_size = alloc_dim_sizes
513  !print *, trim(var_names(i)), data_blobs(i)%alloc_size
514  end do
515 
516 #ifdef DEBUG
517  print *, "!! END DEFINITION PASS"
518 #endif
519  end subroutine nc_diag_cat_metadata_alloc
520 end module ncdc_metadata
integer(i_long) var_arr_total
Definition: ncdc_state.F90:43
integer(i_long), dimension(:), allocatable dim_output_ids
Definition: ncdc_state.F90:19
integer(i_long), parameter nc_diag_cat_gzip_compress
Definition: ncdc_types.f90:6
integer, parameter, public i_byte
Definition: ncd_kinds.F90:45
character(len=10000000) output_file
Definition: ncdc_state.F90:11
subroutine nc_diag_cat_metadata_add_dim(dim_name, dim_size, dim_ul_size)
Definition: ncdc_dims.F90:30
integer(c_int) function pf_nf90_inq_unlimdims(ncid, num_unlim_dims, unlim_dims)
integer(i_long), dimension(:), allocatable var_types
Definition: ncdc_state.F90:36
integer, parameter, public i_long
Definition: ncd_kinds.F90:47
character(len=100), dimension(:), allocatable dim_names
Definition: ncdc_state.F90:17
integer(i_long) cli_arg_count
Definition: ncdc_state.F90:12
subroutine ncdc_usage(err)
integer(i_long), parameter nc_diag_cat_chunk_size
Definition: ncdc_types.f90:7
subroutine nc_diag_cat_metadata_pass
integer(i_long) function nc_diag_cat_lookup_dim(dim_name)
Definition: ncdc_dims.F90:14
subroutine nc_diag_cat_copy_attr(attr_name, var_id_in, var_id_out)
character(len=100), dimension(:), allocatable var_names
Definition: ncdc_state.F90:35
integer(i_long) ncid_output
Definition: ncdc_state.F90:14
subroutine ncdc_error(err)
Definition: ncdc_climsg.F90:29
integer(i_long) ncid_input
Definition: ncdc_state.F90:14
subroutine ncdc_info(ifo)
Definition: ncdc_climsg.F90:72
subroutine ncdc_warning(warn)
Definition: ncdc_climsg.F90:58
integer(i_long), dimension(:), allocatable dim_unlim_sizes
Definition: ncdc_state.F90:21
integer(i_long) input_count
Definition: ncdc_state.F90:12
subroutine nc_diag_cat_metadata_define
subroutine ncdc_check(status)
Definition: ncdc_climsg.F90:21
subroutine nc_diag_cat_metadata_add_var(var_name, var_type, var_ndims, var_dims)
Definition: ncdc_vars.F90:34
logical, dimension(:), allocatable var_hasunlim
Definition: ncdc_state.F90:40
integer, parameter, public i_short
Definition: ncd_kinds.F90:46
type(nc_diag_cat_dim_names), dimension(:), allocatable var_dim_names
Definition: ncdc_state.F90:37
integer(i_long), dimension(:), allocatable var_output_ids
Definition: ncdc_state.F90:38
integer(i_long) dim_arr_total
Definition: ncdc_state.F90:24
integer, parameter, public r_double
Definition: ncd_kinds.F90:80
subroutine nc_diag_cat_metadata_alloc
integer, parameter, public r_single
Definition: ncd_kinds.F90:79
integer(i_long), dimension(:), allocatable dim_sizes
Definition: ncdc_state.F90:18
character(len=10000000) input_file
Definition: ncdc_state.F90:11
integer(i_long) num_unlims
Definition: ncdc_state.F90:27