gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
gtvarsliceauto.f90 File Reference

入出力範囲の自動指定 More...

Go to the source code of this file.

Functions/Subroutines

subroutine gtvarsliceauto (var, compatible)

Detailed Description

入出力範囲の自動指定

Author
Eizi TOYODA, Yasuhiro MORIKAWA

このサブルーチンは gtdata_generic から gtdata_generic#Slice として提供されます。

Definition in file gtvarsliceauto.f90.

Function/Subroutine Documentation

◆ gtvarsliceauto()

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

入出力範囲を自動指定

変数 var の入出力範囲を「適当に」小さくします。 compatible を指定すると、その変数と全く同じ入出力範囲に指定します。

Slice は複数のサブルーチンの総称名であり、 他にも文字列や番号で指定する方法があります。

Slice に関連する手続きとして、Get_Slice と Slice_Next があります。 Get_Slice は設定された入出力範囲を取得します。 Slice_Next は入出力範囲を移動することによって、変数全体を読み取る ために利用するサブルーチンです。

Parameters
[in,out]var変数ハンドル
[in]compatible入出力範囲を合わせる変数 (省略可能)

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: