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

Automatic I/O range specification. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gtvarsliceauto (var, compatible)

Detailed Description

Automatic I/O range specification.

Author
Eizi TOYODA, Yasuhiro MORIKAWA

This subroutine is provided as gtdata_generic#Slice through gtdata_generic.

Definition in file gtvarsliceauto.f90.

Function/Subroutine Documentation

◆ gtvarsliceauto()

subroutine gtvarsliceauto ( type(gt_variable), intent(inout) var,
type(gt_variable), intent(in), optional compatible )

Automatically specify I/O range

Makes the I/O range of variable var "appropriately" small. If compatible is specified, sets it to the exact same I/O range as that variable.

Slice is a generic name for multiple subroutines; there are also methods to specify by string or number.

Related procedures to Slice include Get_Slice and Slice_Next. Get_Slice retrieves the set I/O range. Slice_Next is used to read the entire variable by moving the I/O range.

Parameters
[in,out]varVariable handle
[in]compatibleVariable to match I/O range (optional)

Definition at line 57 of file gtvarsliceauto.f90.

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)
subroutine gtvarslice(var, dimord, start, count, stride)

References gtvarslice().

Here is the call graph for this function: