gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
gtvargetslice.f90 File Reference

Get variable I/O range restriction information. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gtvargetslice (var, dimord, start, count, stride, count_compact)

Detailed Description

Get variable I/O range restriction information.

Author
Eizi TOYODA, Yasuhiro MORIKAWA

This subroutine is provided as gtdata_generic#Get_Slice through gtdata_generic.

Definition in file gtvargetslice.f90.

Function/Subroutine Documentation

◆ gtvargetslice()

subroutine gtvargetslice ( type(gt_variable), intent(in) var,
integer, intent(in) dimord,
integer, intent(out), optional start,
integer, intent(out), optional count,
integer, intent(out), optional stride,
logical, intent(in), optional count_compact )

Get I/O range information for specified dimension

Gets I/O range information set by Slice for dimension dimord of variable var. See Slice for start, count, stride.

If count_compact is set to .true., queries including degenerate dimensions.

Get_Slice is a generic name for 2 subroutines; there is also a method to bulk get information for all dimensions.

Parameters
[in]varVariable handle
[in]dimordDimension order number
[out]startStart index (optional)
[out]countCount (optional)
[out]strideStride (optional)
[in]count_compactInclude degenerate dimensions (optional)

Definition at line 60 of file gtvargetslice.f90.

61 use gtdata_types, only: gt_variable
63 implicit none
64 type(GT_VARIABLE), intent(in):: var
65 integer, intent(in):: dimord
66 integer, intent(out), optional:: start
67 integer, intent(out), optional:: count
68 integer, intent(out), optional:: stride
69 logical, intent(in), optional:: count_compact
70 type(GT_DIMMAP), allocatable:: map(:)
71 integer:: vid, udimord, ndims
72 logical:: allmode
73continue
74 allmode = .true.
75 if (present(count_compact)) allmode = count_compact
76 call map_lookup(var, vid=vid, ndims=ndims)
77 if (vid < 0 .or. ndims <= 0) goto 999
78 allocate(map(ndims))
79 call map_lookup(var, map=map)
80 if (allmode) then
81 udimord = dimord
82 else
83 udimord = dimord_skip_compact(dimord, map)
84 endif
85 if (udimord < 1 .or. udimord > size(map)) goto 997
86
87 if (present(start)) start = map(udimord)%start
88 if (present(count)) count = map(udimord)%count
89 if (present(stride)) stride = map(udimord)%stride
90 deallocate(map)
91 return
92
93997 continue
94 deallocate(map)
95999 continue
96 if (present(start)) start = -1
97 if (present(count)) count = -1
98 if (present(stride)) stride = -1
subroutine, public map_lookup(var, vid, map, ndims)
integer function dimord_skip_compact(dimord, map)

References gtdata_internal_map::dimord_skip_compact(), and gtdata_internal_map::map_lookup().

Here is the call graph for this function: