historyaxiscopy.f90
Go to the documentation of this file.
1 != GT_HISTORY_AXIS のコピー
2 != Copy GT_HISTORY_AXIS
3 !
4 ! Authors:: Yasuhiro MORIKAWA
5 ! Version:: $Id: historyaxiscopy.f90,v 1.2 2009-05-25 09:45:20 morikawa Exp $
6 ! Tag Name:: $Name: $
7 ! Copyright:: Copyright (C) GFD Dennou Club, 2004-2009. All rights reserved.
8 ! License:: See COPYRIGHT[link:../../../COPYRIGHT]
9 !
10  subroutine historyaxiscopy1(axis_dest, axis_src, err, &
11  & name, length, longname, units, xtype)
12  !
13  !== GT_HISTORY_AXIS 型変数コピー
14  !
15  ! GT_HISTORY_AXIS 型の変数 *axis_src* を
16  ! *axis_dest* にコピーします。
17  ! *axis_src* は HistoryAxisCreate によって初期設定されている必要が
18  ! あります。
19  ! さらに属性を付加する場合には HistoryAxisAddAttr
20  ! を用いてください。
21  !
22  ! *err* を与えておくと、コピーの際何らかの不具合が生じても
23  ! 終了せずに err が真になって返ります。
24  !
25  ! *err* 以降の引数は、コピーの際に上書きする値です。
26  !
29  use dc_trace, only: beginsub, endsub, dbgmessage
30  use dc_present,only: present_select
31  implicit none
32  type(gt_history_axis),intent(out) :: axis_dest ! コピー先 GT_HISTORY_AXIS
33  type(gt_history_axis),intent(in) :: axis_src ! コピー元 GT_HISTORY_AXIS
34  logical, intent(out), optional :: err
35  character(*) , intent(in), optional:: name ! 次元変数名
36  integer, intent(in), optional:: length ! 次元長 (配列サイズ)
37  character(*) , intent(in), optional:: longname ! 次元変数の記述的名称
38  character(*) , intent(in), optional:: units ! 次元変数の単位
39  character(*) , intent(in), optional:: xtype ! 次元変数の型
40  character(*), parameter:: subname = "HistoryAxisCopy1"
41  continue
42  call beginsub(subname)
43  axis_dest % name = present_select('', axis_src % name, name)
44  axis_dest % length = present_select(.false., axis_src % length, length)
45  axis_dest % longname = present_select('', axis_src % longname, longname)
46  axis_dest % units = present_select('', axis_src % units, units)
47  axis_dest % xtype = present_select('', axis_src % xtype, xtype)
48 
49  if (associated( axis_src % attrs ) ) then
50  allocate( axis_dest % attrs( size( axis_src % attrs) ) )
51  call copy_attrs( from = axis_src % attrs, &
52  & to = axis_dest % attrs, err = err)
53  end if
54  call endsub(subname)
55  end subroutine historyaxiscopy1
56 
57  !-------------------------------------------------------------------
58 
59  subroutine historyaxiscopy2(axis_dest, axis_src, err, &
60  & name, length, longname, units, xtype)
61  !
62  ! 使用方法は HistoryAxisCopy と同様です.
63  !
64  ! Usage is same as "HistoryAxisCopy".
65  !
66  !--
67  ! 総称名 Copy として提供するための関数です.
68  ! 機能は HistoryAxisCopy1 と同じです.
69  !++
72  use dc_trace, only: beginsub, endsub, dbgmessage
73  implicit none
74  type(gt_history_axis),intent(out) :: axis_dest ! コピー先 GT_HISTORY_AXIS
75  type(gt_history_axis),intent(in) :: axis_src ! コピー元 GT_HISTORY_AXIS
76  logical, intent(out), optional :: err
77  character(*) , intent(in), optional:: name ! 次元変数名
78  integer, intent(in), optional:: length ! 次元長 (配列サイズ)
79  character(*) , intent(in), optional:: longname ! 次元変数の記述的名称
80  character(*) , intent(in), optional:: units ! 次元変数の単位
81  character(*) , intent(in), optional:: xtype ! 次元変数の型
82  character(*), parameter:: subname = "HistoryAxisCopy2"
83  continue
84  call beginsub(subname)
85  call historyaxiscopy(axis_dest, axis_src, err, &
86  & name, length, longname, units, xtype)
87  call endsub(subname)
88  end subroutine historyaxiscopy2
type(gt_history), target, save, public default
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
subroutine historyaxiscopy1(axis_dest, axis_src, err, name, length, longname, units, xtype)
subroutine historyaxiscopy2(axis_dest, axis_src, err, name, length, longname, units, xtype)
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446