1 | MODULE IXML_TREE |
---|
2 | USE, INTRINSIC :: ISO_C_BINDING |
---|
3 | USE IAXIS |
---|
4 | USE IFILE |
---|
5 | USE IFIELD |
---|
6 | USE IGRID |
---|
7 | USE IDOMAIN |
---|
8 | |
---|
9 | INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 |
---|
10 | |
---|
11 | SUBROUTINE xios_xml_tree_add_field(parent_, child_, child_id, child_id_size) BIND(C) |
---|
12 | USE ISO_C_BINDING |
---|
13 | INTEGER (kind = C_INTPTR_T), VALUE :: parent_ |
---|
14 | INTEGER (kind = C_INTPTR_T) :: child_ |
---|
15 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id |
---|
16 | INTEGER (kind = C_INT) , VALUE :: child_id_size |
---|
17 | END SUBROUTINE xios_xml_tree_add_field |
---|
18 | |
---|
19 | SUBROUTINE xios_xml_tree_add_grid(parent_, child_, child_id, child_id_size) BIND(C) |
---|
20 | USE ISO_C_BINDING |
---|
21 | INTEGER (kind = C_INTPTR_T), VALUE :: parent_ |
---|
22 | INTEGER (kind = C_INTPTR_T) :: child_ |
---|
23 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id |
---|
24 | INTEGER (kind = C_INT) , VALUE :: child_id_size |
---|
25 | END SUBROUTINE xios_xml_tree_add_grid |
---|
26 | |
---|
27 | SUBROUTINE xios_xml_tree_add_file(parent_, child_, child_id, child_id_size) BIND(C) |
---|
28 | USE ISO_C_BINDING |
---|
29 | INTEGER (kind = C_INTPTR_T), VALUE :: parent_ |
---|
30 | INTEGER (kind = C_INTPTR_T) :: child_ |
---|
31 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id |
---|
32 | INTEGER (kind = C_INT) , VALUE :: child_id_size |
---|
33 | END SUBROUTINE xios_xml_tree_add_file |
---|
34 | |
---|
35 | SUBROUTINE xios_xml_tree_add_axis(parent_, child_, child_id, child_id_size) BIND(C) |
---|
36 | USE ISO_C_BINDING |
---|
37 | INTEGER (kind = C_INTPTR_T), VALUE :: parent_ |
---|
38 | INTEGER (kind = C_INTPTR_T) :: child_ |
---|
39 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id |
---|
40 | INTEGER (kind = C_INT) , VALUE :: child_id_size |
---|
41 | END SUBROUTINE xios_xml_tree_add_axis |
---|
42 | |
---|
43 | SUBROUTINE xios_xml_tree_add_domain(parent_, child_, child_id, child_id_size) BIND(C) |
---|
44 | USE ISO_C_BINDING |
---|
45 | INTEGER (kind = C_INTPTR_T), VALUE :: parent_ |
---|
46 | INTEGER (kind = C_INTPTR_T) :: child_ |
---|
47 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id |
---|
48 | INTEGER (kind = C_INT) , VALUE :: child_id_size |
---|
49 | END SUBROUTINE xios_xml_tree_add_domain |
---|
50 | |
---|
51 | SUBROUTINE xios_xml_tree_add_fieldtofile(parent_, child_, child_id, child_id_size) BIND(C) |
---|
52 | USE ISO_C_BINDING |
---|
53 | INTEGER (kind = C_INTPTR_T), VALUE :: parent_ |
---|
54 | INTEGER (kind = C_INTPTR_T) :: child_ |
---|
55 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id |
---|
56 | INTEGER (kind = C_INT) , VALUE :: child_id_size |
---|
57 | END SUBROUTINE xios_xml_tree_add_fieldtofile |
---|
58 | |
---|
59 | SUBROUTINE xios_xml_tree_add_fieldgrouptofile(parent_, child_, child_id, child_id_size) BIND(C) |
---|
60 | USE ISO_C_BINDING |
---|
61 | INTEGER (kind = C_INTPTR_T), VALUE :: parent_ |
---|
62 | INTEGER (kind = C_INTPTR_T) :: child_ |
---|
63 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id |
---|
64 | INTEGER (kind = C_INT) , VALUE :: child_id_size |
---|
65 | END SUBROUTINE xios_xml_tree_add_fieldgrouptofile |
---|
66 | |
---|
67 | SUBROUTINE xios_xml_tree_show(filename, filename_size) BIND(C) |
---|
68 | USE ISO_C_BINDING |
---|
69 | CHARACTER(kind = C_CHAR), DIMENSION(*) :: filename |
---|
70 | INTEGER (kind = C_INT) , VALUE :: filename_size |
---|
71 | END SUBROUTINE xios_xml_tree_show |
---|
72 | |
---|
73 | SUBROUTINE xios_xml_parse_file(filename, filename_size) BIND(C) |
---|
74 | USE ISO_C_BINDING |
---|
75 | CHARACTER(kind = C_CHAR), DIMENSION(*) :: filename |
---|
76 | INTEGER (kind = C_INT) , VALUE :: filename_size |
---|
77 | END SUBROUTINE xios_xml_parse_file |
---|
78 | |
---|
79 | SUBROUTINE xios_xml_parse_string(xmlcontent, xmlcontent_size) BIND(C) |
---|
80 | USE ISO_C_BINDING |
---|
81 | CHARACTER(kind = C_CHAR), DIMENSION(*) :: xmlcontent |
---|
82 | INTEGER (kind = C_INT) , VALUE :: xmlcontent_size |
---|
83 | END SUBROUTINE xios_xml_parse_string |
---|
84 | |
---|
85 | END INTERFACE |
---|
86 | |
---|
87 | !---------------------------------------------------------------------------- |
---|
88 | INTERFACE xml_tree_add |
---|
89 | MODULE PROCEDURE xml_tree_add_axis, xml_tree_add_file, xml_tree_add_grid, & |
---|
90 | xml_tree_add_field, xml_tree_add_domain, & |
---|
91 | xml_tree_add_fieldgrouptofile, xml_tree_add_fieldtofile |
---|
92 | END INTERFACE |
---|
93 | !---------------------------------------------------------------------------- |
---|
94 | |
---|
95 | CONTAINS ! Fonctions disponibles pour les utilisateurs. |
---|
96 | |
---|
97 | SUBROUTINE xml_tree_add_axis(parent_hdl, child_hdl, child_id) |
---|
98 | TYPE(XAxisGroupHandle) , INTENT(IN) :: parent_hdl |
---|
99 | TYPE(XAxisHandle) , INTENT(OUT):: child_hdl |
---|
100 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id |
---|
101 | IF (PRESENT(child_id)) THEN |
---|
102 | CALL xios_xml_tree_add_axis(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) |
---|
103 | ELSE |
---|
104 | CALL xios_xml_tree_add_axis(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) |
---|
105 | END IF |
---|
106 | END SUBROUTINE xml_tree_add_axis |
---|
107 | |
---|
108 | SUBROUTINE xml_tree_add_file(parent_hdl, child_hdl, child_id) |
---|
109 | TYPE(XFileGroupHandle) , INTENT(IN) :: parent_hdl |
---|
110 | TYPE(XFileHandle) , INTENT(OUT):: child_hdl |
---|
111 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id |
---|
112 | IF (PRESENT(child_id)) THEN |
---|
113 | CALL xios_xml_tree_add_file(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) |
---|
114 | ELSE |
---|
115 | CALL xios_xml_tree_add_file(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) |
---|
116 | END IF |
---|
117 | END SUBROUTINE xml_tree_add_file |
---|
118 | |
---|
119 | SUBROUTINE xml_tree_add_grid(parent_hdl, child_hdl, child_id) |
---|
120 | TYPE(XGridGroupHandle) , INTENT(IN) :: parent_hdl |
---|
121 | TYPE(XGridHandle) , INTENT(OUT):: child_hdl |
---|
122 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id |
---|
123 | IF (PRESENT(child_id)) THEN |
---|
124 | CALL xios_xml_tree_add_grid(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) |
---|
125 | ELSE |
---|
126 | CALL xios_xml_tree_add_grid(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) |
---|
127 | END IF |
---|
128 | END SUBROUTINE xml_tree_add_grid |
---|
129 | |
---|
130 | SUBROUTINE xml_tree_add_field(parent_hdl, child_hdl, child_id) |
---|
131 | TYPE(XFieldGroupHandle) , INTENT(IN) :: parent_hdl |
---|
132 | TYPE(XFieldHandle) , INTENT(OUT):: child_hdl |
---|
133 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id |
---|
134 | IF (PRESENT(child_id)) THEN |
---|
135 | CALL xios_xml_tree_add_field(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) |
---|
136 | ELSE |
---|
137 | CALL xios_xml_tree_add_field(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) |
---|
138 | END IF |
---|
139 | END SUBROUTINE xml_tree_add_field |
---|
140 | |
---|
141 | SUBROUTINE xml_tree_add_domain(parent_hdl, child_hdl, child_id) |
---|
142 | TYPE(XDomainGroupHandle) , INTENT(IN) :: parent_hdl |
---|
143 | TYPE(XDomainHandle) , INTENT(OUT):: child_hdl |
---|
144 | CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id |
---|
145 | IF (PRESENT(child_id)) THEN |
---|
146 | CALL xios_xml_tree_add_domain(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) |
---|
147 | ELSE |
---|
148 | CALL xios_xml_tree_add_domain(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) |
---|
149 | END IF |
---|
150 | END SUBROUTINE xml_tree_add_domain |
---|
151 | |
---|
152 | SUBROUTINE xml_tree_add_fieldtofile(parent_hdl, child_hdl, child_id) |
---|
153 | TYPE(XFileHandle) , INTENT(IN) :: parent_hdl |
---|
154 | TYPE(XFieldHandle) , INTENT(OUT):: child_hdl |
---|
155 | CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id |
---|
156 | IF (PRESENT(child_id)) THEN |
---|
157 | CALL xios_xml_tree_add_fieldtofile(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) |
---|
158 | ELSE |
---|
159 | CALL xios_xml_tree_add_fieldtofile(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) |
---|
160 | END IF |
---|
161 | END SUBROUTINE xml_tree_add_fieldtofile |
---|
162 | |
---|
163 | SUBROUTINE xml_tree_add_fieldgrouptofile(parent_hdl, child_hdl, child_id) |
---|
164 | TYPE(XFileHandle) , INTENT(IN) :: parent_hdl |
---|
165 | TYPE(XFieldGroupHandle) , INTENT(OUT):: child_hdl |
---|
166 | CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id |
---|
167 | IF (PRESENT(child_id)) THEN |
---|
168 | CALL xios_xml_tree_add_fieldgrouptofile(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) |
---|
169 | ELSE |
---|
170 | CALL xios_xml_tree_add_fieldgrouptofile(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) |
---|
171 | END IF |
---|
172 | END SUBROUTINE xml_tree_add_fieldgrouptofile |
---|
173 | |
---|
174 | SUBROUTINE xml_tree_show(filename) |
---|
175 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: filename |
---|
176 | IF (PRESENT(filename)) THEN |
---|
177 | CALL xios_xml_tree_show(filename, len(filename)) |
---|
178 | ELSE |
---|
179 | CALL xios_xml_tree_show("NONE", -1) |
---|
180 | END IF |
---|
181 | END SUBROUTINE xml_tree_show |
---|
182 | |
---|
183 | SUBROUTINE xml_parse_file(filename) |
---|
184 | CHARACTER(len = *), INTENT(IN) :: filename |
---|
185 | CALL xios_xml_parse_file(filename, len(filename)) |
---|
186 | END SUBROUTINE xml_Parse_File |
---|
187 | |
---|
188 | SUBROUTINE xml_parse_string(xmlcontent) |
---|
189 | CHARACTER(len = *), INTENT(IN) :: xmlcontent |
---|
190 | CALL xios_xml_parse_string(xmlcontent, len(xmlcontent)) |
---|
191 | END SUBROUTINE xml_Parse_String |
---|
192 | |
---|
193 | END MODULE IXML_TREE |
---|