gtvarcopyattrall.f90
Go to the documentation of this file.
1 !
2 != 属性のコピー
3 !
4 ! Authors:: Eizi TOYODA, Yasuhiro MORIKAWA
5 ! Version:: $Id: gtvarcopyattrall.f90,v 1.1 2009-03-20 09:09:52 morikawa Exp $
6 ! Tag Name:: $Name: $
7 ! Copyright:: Copyright (C) GFD Dennou Club, 2000-2005. All rights reserved.
8 ! License:: See COPYRIGHT[link:../../COPYRIGHT]
9 !
10 ! 以下のサブルーチン、関数は gtdata_generic から gtdata_generic#Copy_Attr
11 ! として提供されます。
12 
13 subroutine gtvarcopyattrall(to, from, err, global)
14  !
15  !== 属性のコピー
16  !
17  ! 変数 *from* の全ての属性を変数 *to* へコピーします。
18  !
19  ! デフォルトでは大域属性もコピーしますが、
20  ! *global* に .false. を与える場合、大域属性をコピーしません。
21  !
22  ! *Copy_Attr* は 2 つのサブルーチンの総称名であり、
23  ! 他にも属性を指定してコピーする方法もあります。
24  ! 上記のサブルーチンを参照ください。
25  !
26  use gtdata_types, only: gt_variable
29  use dc_url, only: gt_plus
30  use dc_error, only: dumperror
31  use dc_trace, only: beginsub, endsub, dbgmessage
32  use dc_types, only: string
33  type(gt_variable), intent(inout):: to
34  type(gt_variable), intent(inout):: from
35  logical, intent(out), optional:: err
36  logical, intent(in), optional:: global
37  character(len = *), parameter:: subnam = "GTVarCopyAttrAll"
38  character(len = STRING):: aname
39  logical:: end
40 continue
41  if (present(err)) err = .false.
42  call beginsub(subnam)
43  call attr_rewind(from)
44  do
45  call attr_next(from, aname, end)
46  if (end) exit
47  if ( (present_and_false(global)) .and. (aname(1:1) == gt_plus) ) then
48  call dbgmessage("Ignored attr=%c", c1=aname)
49  cycle
50  end if
51  call dbgmessage("Copied attr=%c", c1=aname)
52  call gtvarcopyattr(to=to, attrname=aname, from=from, err=err)
53  if (present_and_true(err)) err = .false.
54  enddo
55  call endsub(subnam)
56 end subroutine gtvarcopyattrall
logical function, public present_and_true(arg)
Definition: dc_present.f90:80
character, parameter, public gt_plus
Definition: dc_url.f90:92
logical function, public present_and_false(arg)
Definition: dc_present.f90:99
subroutine gtvarcopyattr(to, attrname, from, err)
subroutine, public dbgmessage(fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:509
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
種別型パラメタを提供します。
Definition: dc_types.f90:49
subroutine gtvarcopyattrall(to, from, err, global)
subroutine dumperror()
Definition: dc_error.f90:942
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118