1 | MODULE mod_axis_group |
---|
2 | USE mod_axis |
---|
3 | USE mod_xmlio_parameters |
---|
4 | |
---|
5 | IMPLICIT NONE |
---|
6 | |
---|
7 | TYPE axis_group |
---|
8 | CHARACTER(LEN=str_len) :: id |
---|
9 | LOGICAL :: has_id |
---|
10 | TYPE(vector_axis_group), POINTER :: groups |
---|
11 | TYPE(vector_axis),POINTER :: axis |
---|
12 | TYPE(axis), POINTER :: default_attribut |
---|
13 | END TYPE axis_group |
---|
14 | |
---|
15 | INCLUDE "vector_axis_group_def.inc" |
---|
16 | |
---|
17 | TYPE(vector_axis_group),POINTER :: axis_group_Ids |
---|
18 | TYPE(sorted_list),POINTER,PRIVATE :: Ids |
---|
19 | |
---|
20 | CONTAINS |
---|
21 | |
---|
22 | INCLUDE "vector_axis_group_contains.inc" |
---|
23 | |
---|
24 | SUBROUTINE axis_group__init |
---|
25 | IMPLICIT NONE |
---|
26 | |
---|
27 | ALLOCATE(axis_group_Ids) |
---|
28 | ALLOCATE(Ids) |
---|
29 | |
---|
30 | CALL vector_axis_group__new(axis_group_Ids) |
---|
31 | CALL sorted_list__new(Ids) |
---|
32 | |
---|
33 | END SUBROUTINE axis_group__init |
---|
34 | |
---|
35 | SUBROUTINE axis_group__get(Id,Pt_ag) |
---|
36 | USE string_function |
---|
37 | IMPLICIT NONE |
---|
38 | CHARACTER(LEN=*),INTENT(IN) :: Id |
---|
39 | TYPE(axis_group),POINTER :: Pt_ag |
---|
40 | |
---|
41 | INTEGER :: Pos |
---|
42 | LOGICAL :: success |
---|
43 | |
---|
44 | CALL sorted_list__find(Ids,hash(Id),Pos,success) |
---|
45 | IF (success) THEN |
---|
46 | Pt_ag=>axis_group_ids%at(Pos)%Pt |
---|
47 | ELSE |
---|
48 | Pt_ag=>NULL() |
---|
49 | ENDIF |
---|
50 | |
---|
51 | END SUBROUTINE axis_group__get |
---|
52 | |
---|
53 | RECURSIVE SUBROUTINE axis_group__new(Pt_ag,Id) |
---|
54 | USE string_function |
---|
55 | IMPLICIT NONE |
---|
56 | TYPE(axis_group),POINTER :: Pt_ag |
---|
57 | CHARACTER(LEN=*),OPTIONAL,INTENT(IN) :: Id |
---|
58 | |
---|
59 | INTEGER :: Pos |
---|
60 | |
---|
61 | ALLOCATE(Pt_ag%groups) |
---|
62 | ALLOCATE(Pt_ag%axis) |
---|
63 | ALLOCATE(Pt_ag%default_attribut) |
---|
64 | |
---|
65 | CALL vector_axis_group__new(Pt_ag%groups) |
---|
66 | CALL vector_axis__new(Pt_ag%axis) |
---|
67 | CALL axis__new(Pt_ag%default_attribut) |
---|
68 | Pt_ag%has_id=.FALSE. |
---|
69 | |
---|
70 | IF (PRESENT(Id)) THEN |
---|
71 | Pt_ag%id=TRIM(Id) |
---|
72 | Pt_ag%has_id=.TRUE. |
---|
73 | CALL vector_axis_group__set_new(axis_group_Ids,Pt_ag,Pos) |
---|
74 | CALL sorted_list__Add(Ids,hash(id),Pos) |
---|
75 | ENDIF |
---|
76 | |
---|
77 | END SUBROUTINE axis_group__new |
---|
78 | |
---|
79 | |
---|
80 | SUBROUTINE axis_group__get_new_group(Pt_ag,Pt_ag_out,Id) |
---|
81 | IMPLICIT NONE |
---|
82 | TYPE(axis_group),POINTER :: Pt_ag |
---|
83 | TYPE(axis_group),POINTER :: Pt_ag_out |
---|
84 | CHARACTER(LEN=*),OPTIONAL :: Id |
---|
85 | |
---|
86 | CALL vector_axis_group__get_new(Pt_ag%groups,Pt_ag_out) |
---|
87 | CALL axis_group__new(Pt_ag_out) |
---|
88 | |
---|
89 | IF (PRESENT(id)) THEN |
---|
90 | CALL axis_group__new(Pt_ag_out,Id) |
---|
91 | ELSE |
---|
92 | CALL axis_group__new(Pt_ag_out) |
---|
93 | ENDIF |
---|
94 | |
---|
95 | END SUBROUTINE axis_group__get_new_group |
---|
96 | |
---|
97 | |
---|
98 | SUBROUTINE axis_group__get_new_axis(Pt_ag,Pt_a_out,Id) |
---|
99 | IMPLICIT NONE |
---|
100 | TYPE(axis_group),POINTER :: Pt_ag |
---|
101 | TYPE(axis),POINTER :: Pt_a_out |
---|
102 | CHARACTER(LEN=*),OPTIONAL :: Id |
---|
103 | |
---|
104 | CALL vector_axis__get_new(Pt_ag%axis,Pt_a_out) |
---|
105 | |
---|
106 | IF (PRESENT(id)) THEN |
---|
107 | CALL axis__new(Pt_a_out,Id) |
---|
108 | ELSE |
---|
109 | CALL axis__new(Pt_a_out) |
---|
110 | ENDIF |
---|
111 | |
---|
112 | END SUBROUTINE axis_group__get_new_axis |
---|
113 | |
---|
114 | |
---|
115 | SUBROUTINE axis_group__get_default_attrib(Pt_ag,Pt_a) |
---|
116 | IMPLICIT NONE |
---|
117 | TYPE(axis_group),POINTER :: Pt_ag |
---|
118 | TYPE(axis),POINTER :: Pt_a |
---|
119 | |
---|
120 | Pt_a=>Pt_ag%default_attribut |
---|
121 | END SUBROUTINE axis_group__get_default_attrib |
---|
122 | |
---|
123 | RECURSIVE SUBROUTINE axis_group__apply_default(Pt_ag,default) |
---|
124 | IMPLICIT NONE |
---|
125 | TYPE(axis_group),POINTER :: Pt_ag |
---|
126 | TYPE(axis),POINTER,OPTIONAL :: default |
---|
127 | INTEGER :: i |
---|
128 | |
---|
129 | IF (PRESENT(default)) THEN |
---|
130 | CALL axis__apply_default(default,Pt_ag%default_attribut,Pt_ag%default_attribut) |
---|
131 | ENDIF |
---|
132 | |
---|
133 | DO i=1,Pt_ag%groups%size |
---|
134 | CALL axis_group__apply_default(Pt_ag%groups%at(i)%pt,Pt_ag%default_attribut) |
---|
135 | ENDDO |
---|
136 | |
---|
137 | DO i=1,Pt_ag%axis%size |
---|
138 | CALL axis__apply_default(Pt_ag%default_attribut,Pt_ag%axis%at(i)%pt,Pt_ag%axis%at(i)%pt) |
---|
139 | ENDDO |
---|
140 | |
---|
141 | END SUBROUTINE axis_group__apply_default |
---|
142 | |
---|
143 | RECURSIVE SUBROUTINE axis_group__print(Pt_ag) |
---|
144 | IMPLICIT NONE |
---|
145 | TYPE(axis_group),POINTER :: Pt_ag |
---|
146 | |
---|
147 | INTEGER :: i |
---|
148 | |
---|
149 | PRINT *,"--- AXIS GROUP ---" |
---|
150 | IF (pt_ag%has_id) THEN |
---|
151 | PRINT *,"id = ",TRIM(pt_ag%id) |
---|
152 | ELSE |
---|
153 | PRINT *,"id undefined" |
---|
154 | ENDIF |
---|
155 | |
---|
156 | PRINT *,"axis default attribut :" |
---|
157 | CALL axis__print(Pt_ag%default_attribut) |
---|
158 | |
---|
159 | PRINT *,"owned axis groups :",Pt_ag%groups%size |
---|
160 | DO i=1,Pt_ag%groups%size |
---|
161 | CALL axis_group__print(Pt_ag%groups%at(i)%pt) |
---|
162 | ENDDO |
---|
163 | |
---|
164 | PRINT *,"owned axis :",Pt_ag%axis%size |
---|
165 | DO i=1,Pt_ag%axis%size |
---|
166 | CALL axis__print(Pt_ag%axis%at(i)%pt) |
---|
167 | ENDDO |
---|
168 | PRINT *,"------------" |
---|
169 | |
---|
170 | END SUBROUTINE axis_group__print |
---|
171 | |
---|
172 | RECURSIVE SUBROUTINE axis_group__Check(Pt_ag) |
---|
173 | IMPLICIT NONE |
---|
174 | |
---|
175 | TYPE(axis_group),POINTER :: Pt_ag |
---|
176 | INTEGER :: i |
---|
177 | |
---|
178 | DO i=1,Pt_ag%groups%size |
---|
179 | CALL axis_group__check(pt_ag%groups%at(i)%pt) |
---|
180 | ENDDO |
---|
181 | |
---|
182 | DO i=1,Pt_ag%axis%size |
---|
183 | CALL axis__check(pt_ag%axis%at(i)%pt) |
---|
184 | ENDDO |
---|
185 | |
---|
186 | END SUBROUTINE axis_group__check |
---|
187 | |
---|
188 | END MODULE mod_axis_group |
---|
189 | |
---|