gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
gtvarsliceauto.f90
Go to the documentation of this file.
1
21
57subroutine gtvarsliceauto(var, compatible)
58 use gtdata_types, only: gt_variable
60 type(gt_variable), intent(inout):: var
61 type(gt_variable), intent(in), optional:: compatible
62 integer:: nd, i
63 integer, allocatable:: start(:), count(:), stride(:)
64 call inquire(var, alldims=nd)
65 if (nd <= 0) return
66 allocate(start(nd), count(nd), stride(nd))
67 if (present(compatible)) then
68 call get_slice(compatible, start, count, stride)
69 do, i = 1, nd
70 call gtvarslice(var, i, start(i), count(i), stride(i))
71 enddo
72 else
73 call get_slice(var, start, count, stride)
74 do, i = 1, nd
75 if (count(i) < 1) count(i) = 1
76 call gtvarslice(var, i, start(i), count(i), stride(i))
77 enddo
78 endif
79 deallocate(start, count, stride)
80end subroutine gtvarsliceauto
subroutine gtvarslice(var, dimord, start, count, stride)
subroutine gtvarsliceauto(var, compatible)