2001年10月01日 豊田英司
変数に関する問い合わせには Get_Slice, Inquire, Dimname_to_Dimord があります。
Inquire サブルーチンは INQUIRE 文を模して作られたもので、オブジェクト・変数・属性に関する問い合わせを行います。文字型の実引数の長さが足りないと、結果が損なわれます。
subroutine Inquire(var, xtype, name, url, & & rank, alldims, allcount, size, growable) type(gt_variable), intent(in):: var ! 外部型の名前 character(len=*), intent(out), optional:: xtype ! name は変数名の最小の単位を返す。 ! ファイル名を含まないためプログラム内での一意性は保証されない。 character(len=*), intent(out), optional:: name ! url はファイル名のついた変数名を返す。プログラム内で ! 一意である。 character(len=*), intent(out), optional:: url ! コンパクト(縮退)次元を数えない, 次元の数 integer, intent(out), optional:: rank ! 縮退次元を含む全次元数。dimord には基本的にこちらを使う integer, intent(out), optional:: alldims ! 変数が次元変数である場合、総数を返す。エラーはゼロ。 integer, intent(out), optional:: allcount ! 変数の入出力領域の大きさ。 integer, intent(out), optional:: size ! 変数が次元変数である場合、自動拡張可能か否かを返す。 ! そうでない場合は不定。 logical, intent(out), optional:: growable end subroutine
subroutine Inquire(var, allcount) type(GT_VARIABLE), intent(in):: var ! alldims 個必要 integer, intent(out), optional:: allcount(:) end subroutine
subroutine Inquire(var, allcount) type(GT_VARIABLE), intent(in):: var ! alldims 個必要 integer, intent(out), optional:: allcount(:) end subroutine
subroutine Inquire(var, attrname, xtype) type(GT_VARIABLE), intent(in):: var character(len=*), intent(in):: attrname character(len=*), intent(out), optional:: xtype end subroutine
属性に関してはいまのところ外部型だけを問い合わせることができます。