57 type(ncdf_value),
pointer,
intent(in) :: element
58 integer,
intent(in) :: i
59 integer,
intent(in) :: count
65 type(ncdf_value),
pointer,
intent(in) :: element
66 integer,
intent(in) :: i1, i2
67 integer,
intent(in) :: count1, count2
83 character(len=*) :: path
84 integer :: i, length, child_i
95 length = len_trim(path)
102 do while (
associated (p % parent))
112 if (child_i < i)
then 119 if(.not.
associated(p))
then 133 print *,
"ERROR: Unexpected ], not missing preceding [" 145 if (child_i <= length)
then 147 if(.not.
associated(p))
then 160 character(len=*) :: chars
165 do i=1, len_trim(chars)
174 integral = integral * 10
177 integral = integral + tmp
190 type(ncdf_value),
pointer :: this, p
191 character(len=*),
optional :: path
196 if(
present(path))
then 202 if(.not.
associated(p))
then 203 print *,
"Unable to resolve path: ", path
209 value = p % value_integer
210 else if (p % value_type ==
type_real)
then 211 value = p % value_real
213 if (p % value_logical)
then 219 print *,
"Unable to resolve value to integer: ", path
229 type(ncdf_value),
pointer :: this, p
230 character(len=*),
optional :: path
236 if(
present(path))
then 242 if(.not.
associated(p))
then 243 print *,
"Unable to resolve path: ", path
249 value = p % value_integer
250 else if (p % value_type ==
type_real)
then 251 value = p % value_real
253 if (p % value_logical)
then 259 print *,
"Unable to resolve value to real: ", path
269 type(ncdf_value),
pointer :: this, p
270 character(len=*),
optional :: path
271 double precision ::
value 276 if(
present(path))
then 282 if(.not.
associated(p))
then 283 print *,
"Unable to resolve path: ", path
289 value = p % value_integer
290 else if (p % value_type ==
type_real)
then 291 value = p % value_double
293 if (p % value_logical)
then 299 print *,
"Unable to resolve value to double: ", path
310 type(ncdf_value),
pointer :: this, p
311 character(len=*),
optional :: path
317 if(
present(path))
then 323 if(.not.
associated(p))
then 324 print *,
"Unable to resolve path: ", path
330 value = (p % value_integer > 0)
332 value = p % value_logical
334 print *,
"Unable to resolve value to real: ", path
344 type(ncdf_value),
pointer :: this, p
345 character(len=*),
optional :: path
346 character(len=*) ::
value 350 if(
present(path))
then 356 if(.not.
associated(p))
then 357 print *,
"Unable to resolve path: ", path
365 print *,
"Unable to resolve value to characters: ", path
376 type(ncdf_value),
pointer :: this
377 character(len = *),
optional :: path
378 procedure(ncdf_array_callback_1d) :: array_callback
380 type(ncdf_value),
pointer :: p, element
381 integer :: index, count
386 if(
present(path))
then 392 if(.not.
associated(p))
then 393 print *,
"Unable to resolve path: ", path
399 element => p % children
401 call array_callback(element, index, count)
402 element => element % next
405 print *,
"Resolved value is not an array. ", path
409 if (
associated(p))
nullify(p)
419 type(ncdf_value),
pointer,
intent(in) :: this
420 character(len=*),
intent(in),
optional :: path
421 integer,
allocatable,
intent(out) :: arr(:)
423 if (
allocated(arr))
deallocate(arr)
430 type(ncdf_value),
pointer,
intent(in) :: element
431 integer,
intent(in) :: i, count
432 if (.not.
allocated(arr))
allocate(arr(count))
444 type(ncdf_value),
pointer,
intent(in) :: this
445 character(len=*),
intent(in),
optional :: path
446 real,
allocatable,
intent(out) :: arr(:)
448 if (
allocated(arr))
deallocate(arr)
455 type(ncdf_value),
pointer,
intent(in) :: element
456 integer,
intent(in) :: i, count
457 if (.not.
allocated(arr))
allocate(arr(count))
469 type(ncdf_value),
pointer,
intent(in) :: this
470 character(len=*),
intent(in),
optional :: path
471 double precision,
allocatable,
intent(out) :: arr(:)
473 if (
allocated(arr))
deallocate(arr)
480 type(ncdf_value),
pointer,
intent(in) :: element
481 integer,
intent(in) :: i, count
482 if (.not.
allocated(arr))
allocate(arr(count))
494 type(ncdf_value),
pointer,
intent(in) :: this
495 character(len=*),
intent(in),
optional :: path
496 logical,
allocatable,
intent(out) :: arr(:)
498 if (
allocated(arr))
deallocate(arr)
505 type(ncdf_value),
pointer,
intent(in) :: element
506 integer,
intent(in) :: i, count
507 if (.not.
allocated(arr))
allocate(arr(count))
518 type(ncdf_value),
pointer :: this
519 character(len = *),
optional :: path
520 procedure(ncdf_array_callback_2d) :: array_callback
522 type(ncdf_value),
pointer :: p, element, item
523 integer :: i1, i2, count1, count2, c
528 if(
present(path))
then 534 if(.not.
associated(p))
then 535 print *,
"Unable to resolve path: ", path
541 element => p % children
547 else if (c /= count2)
then 548 print *,
"Resolved value has the wrong number of elements. ", &
552 item => element % children
554 call array_callback(item, i1, i2, count1, count2)
557 element => element % next
559 print *,
"Resolved value is not an array. ", path,
"[", i1,
"]" 564 print *,
"Resolved value is not an array. ", path
568 if (
associated(p))
nullify(p)
578 type(ncdf_value),
pointer,
intent(in) :: this
579 character(len=*),
intent(in),
optional :: path
580 integer,
allocatable,
intent(out) :: arr(:, :)
582 if (
allocated(arr))
deallocate(arr)
589 type(ncdf_value),
pointer,
intent(in) :: element
590 integer,
intent(in) :: i1, i2, count1, count2
591 if (.not.
allocated(arr))
allocate(arr(count1, count2))
603 type(ncdf_value),
pointer,
intent(in) :: this
604 character(len=*),
intent(in),
optional :: path
605 real,
allocatable,
intent(out) :: arr(:, :)
607 if (
allocated(arr))
deallocate(arr)
614 type(ncdf_value),
pointer,
intent(in) :: element
615 integer,
intent(in) :: i1, i2, count1, count2
616 if (.not.
allocated(arr))
allocate(arr(count1, count2))
628 type(ncdf_value),
pointer,
intent(in) :: this
629 character(len=*),
intent(in),
optional :: path
630 double precision,
allocatable,
intent(out) :: arr(:, :)
632 if (
allocated(arr))
deallocate(arr)
639 type(ncdf_value),
pointer,
intent(in) :: element
640 integer,
intent(in) :: i1, i2, count1, count2
641 if (.not.
allocated(arr))
allocate(arr(count1, count2))
653 type(ncdf_value),
pointer,
intent(in) :: this
654 character(len=*),
intent(in),
optional :: path
655 logical,
allocatable,
intent(out) :: arr(:, :)
657 if (
allocated(arr))
deallocate(arr)
664 type(ncdf_value),
pointer,
intent(in) :: element
665 integer,
intent(in) :: i1, i2, count1, count2
666 if (.not.
allocated(arr))
allocate(arr(count1, count2))
subroutine ncdf_array_callback_2d_real(element, i1, i2, count1, count2)
subroutine ncdf_get_double(this, path, value)
integer, parameter, public type_real
subroutine ncdf_array_callback_2d_double(element, i1, i2, count1, count2)
subroutine ncdf_get_array_2d_logical(this, path, arr)
subroutine ncdf_array_callback_1d_double(element, i, count)
integer, parameter, public type_logical
subroutine ncdf_get_array_1d_double(this, path, arr)
subroutine ncdf_get_array_2d(this, path, array_callback)
integer, parameter, public type_integer
integer, parameter, public type_array
integer, parameter, public type_string
subroutine ncdf_get_integer(this, path, value)
subroutine ncdf_get_array_2d_double(this, path, arr)
subroutine ncdf_get_array_1d_logical(this, path, arr)
subroutine ncdf_array_callback_2d_logical(element, i1, i2, count1, count2)
subroutine ncdf_get_array_2d_real(this, path, arr)
subroutine ncdf_array_callback_1d_real(element, i, count)
subroutine ncdf_get_array_1d(this, path, array_callback)
subroutine ncdf_array_callback_1d_integer(element, i, count)
integer function parse_integer(chars)
subroutine ncdf_get_array_2d_integer(this, path, arr)
subroutine ncdf_get_real(this, path, value)
recursive subroutine ncdf_get_by_path(this, path, p)
subroutine ncdf_array_callback_2d_integer(element, i1, i2, count1, count2)
subroutine ncdf_get_logical(this, path, value)
subroutine ncdf_get_array_1d_real(this, path, arr)
subroutine ncdf_array_callback_1d_logical(element, i, count)
subroutine ncdf_get_chars(this, path, value)
subroutine ncdf_get_array_1d_integer(this, path, arr)
integer function, public ncdf_value_count(this)