19#include "../base/base_uses.f90"
25 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'xmgrace'
37 INTEGER,
INTENT(IN) :: iw
39 CHARACTER(len=timestamp_length) :: timestamp
42 WRITE (iw,
'(A)')
'# CP2K Grace file',
'#',
'@version 50125',
'@page size 792, 612', &
43 '@page scroll 5%',
'@page inout 5%',
'@link page off'
44 WRITE (iw,
'(A)')
'@map font 0 to "Times-Roman", "Times-Roman"', &
45 '@map font 1 to "Times-Italic", "Times-Italic"', &
46 '@map font 2 to "Times-Bold", "Times-Bold"', &
47 '@map font 3 to "Times-BoldItalic", "Times-BoldItalic"', &
48 '@map font 4 to "Helvetica", "Helvetica"', &
49 '@map font 5 to "Helvetica-Oblique", "Helvetica-Oblique"', &
50 '@map font 6 to "Helvetica-Bold", "Helvetica-Bold"', &
51 '@map font 7 to "Helvetica-BoldOblique", "Helvetica-BoldOblique"', &
52 '@map font 8 to "Courier", "Courier"', &
53 '@map font 9 to "Courier-Oblique", "Courier-Oblique"', &
54 '@map font 10 to "Courier-Bold", "Courier-Bold"', &
55 '@map font 11 to "Courier-BoldOblique", "Courier-BoldOblique"', &
56 '@map font 12 to "Symbol", "Symbol"', &
57 '@map font 13 to "ZapfDingbats", "ZapfDingbats"'
58 WRITE (iw,
'(A)')
'@map color 0 to (255, 255, 255), "white"', &
59 '@map color 1 to (0, 0, 0), "black"', &
60 '@map color 2 to (255, 0, 0), "red"', &
61 '@map color 3 to (0, 255, 0), "green"', &
62 '@map color 4 to (0, 0, 255), "blue"', &
63 '@map color 5 to (255, 255, 0), "yellow"', &
64 '@map color 6 to (188, 143, 143), "brown"', &
65 '@map color 7 to (220, 220, 220), "grey"', &
66 '@map color 8 to (148, 0, 211), "violet"', &
67 '@map color 9 to (0, 255, 255), "cyan"', &
68 '@map color 10 to (255, 0, 255), "magenta"', &
69 '@map color 11 to (255, 165, 0), "orange"', &
70 '@map color 12 to (114, 33, 188), "indigo"', &
71 '@map color 13 to (103, 7, 72), "maroon"', &
72 '@map color 14 to (64, 224, 208), "turquoise"', &
73 '@map color 15 to (0, 139, 0), "green4"'
74 WRITE (iw,
'(A)')
'@reference date 0',
'@date wrap off',
'@date wrap year 1950'
75 WRITE (iw,
'(A)')
'@default linewidth 1.0',
'@default linestyle 1', &
76 '@default color 1',
'@default pattern 1',
'@default font 0', &
77 '@default char size 1.000000',
'@default symbol size 1.000000', &
78 '@default sformat "%.8g"',
'@background color 0',
'@page background fill on'
79 WRITE (iw,
'(A)')
'@timestamp off',
'@timestamp 0.03, 0.03',
'@timestamp color 1', &
80 '@timestamp rot 0',
'@timestamp font 0',
'@timestamp char size 1.000000'
83 WRITE (iw,
'(A)')
'@timestamp def '//timestamp(:19)
94 INTEGER,
INTENT(IN) :: iw
97 WRITE (iw,
'(A)')
'@r0 off',
'@link r0 to g0',
'@r0 type above',
'@r0 linestyle 1', &
98 '@r0 linewidth 1.0',
'@r0 color 1',
'@r0 line 0, 0, 0, 0'
99 WRITE (iw,
'(A)')
'@r1 off',
'@link r1 to g0',
'@r1 type above',
'@r1 linestyle 1', &
100 '@r1 linewidth 1.0',
'@r1 color 1',
'@r1 line 0, 0, 0, 0'
101 WRITE (iw,
'(A)')
'@r2 off',
'@link r2 to g0',
'@r2 type above',
'@r2 linestyle 1', &
102 '@r2 linewidth 1.0',
'@r2 color 1',
'@r2 line 0, 0, 0, 0'
103 WRITE (iw,
'(A)')
'@r3 off',
'@link r3 to g0',
'@r3 type above',
'@r3 linestyle 1', &
104 '@r3 linewidth 1.0',
'@r3 color 1',
'@r3 line 0, 0, 0, 0'
106 WRITE (iw,
'(A)')
'@g0 on',
'@g0 hidden false',
'@g0 type XY',
'@g0 stacked false', &
107 '@g0 bar hgap 0.000000',
'@g0 fixedpoint off',
'@g0 fixedpoint type 0', &
108 '@g0 fixedpoint xy 0.000000, 0.000000',
'@g0 fixedpoint format general general', &
109 '@g0 fixedpoint prec 6, 6'
123 INTEGER,
INTENT(IN) :: iw
124 REAL(kind=
dp),
DIMENSION(:) :: wcoord
125 CHARACTER(len=*) :: title, subtitle, xlabel, ylabel
127 REAL(kind=
dp) :: x1, x2, y1, y2
134 WRITE (iw,
'(A)')
'@with g0'
135 WRITE (iw, fmt=
'(A)', advance=
'NO')
'@ world '
136 WRITE (iw, fmt=
'(4(F8.1,A))') x1,
',', y1,
',', x2,
',', y2
137 WRITE (iw,
'(A)')
'@ stack world 0, 0, 0, 0'
138 WRITE (iw,
'(A)')
'@ znorm 1', &
139 '@ view 0.150000, 0.150000, 1.150000, 0.850000'
140 WRITE (iw,
'(A)')
'@ title "'//title//
'"'
141 WRITE (iw,
'(A)')
'@ title font 0', &
142 '@ title size 1.500000', &
144 WRITE (iw,
'(A)')
'@ subtitle "'//subtitle//
'"'
145 WRITE (iw,
'(A)')
'@ title font 0', &
146 '@ title size 1.000000', &
149 WRITE (iw,
'(A)')
'@ xaxes scale Normal'
150 WRITE (iw,
'(A)')
'@ yaxes scale Normal'
151 WRITE (iw,
'(A)')
'@ xaxes invert off'
152 WRITE (iw,
'(A)')
'@ yaxes invert off'
154 WRITE (iw,
'(A)')
'@ xaxis on', &
155 '@ xaxis type zero false', &
156 '@ xaxis offset 0.000000 , 0.000000', &
158 '@ xaxis bar color 1', &
159 '@ xaxis bar linestyle 1', &
160 '@ xaxis bar linewidth 1.0'
161 WRITE (iw,
'(A)')
'@ xaxis label "'//xlabel//
'"'
162 WRITE (iw,
'(A)')
'@ xaxis label layout para', &
163 '@ xaxis label place auto', &
164 '@ xaxis label char size 1.480000', &
165 '@ xaxis label font 0', &
166 '@ xaxis label color 1', &
167 '@ xaxis label place normal'
168 WRITE (iw,
'(A)')
'@ xaxis tick on',
'@ xaxis tick major 2',
'@ xaxis tick minor ticks 1', &
169 '@ xaxis tick default 6',
'@ xaxis tick place rounded true',
'@ xaxis tick in', &
170 '@ xaxis tick major size 1.000000',
'@ xaxis tick major color 1', &
171 '@ xaxis tick major linewidth 3.0',
'@ xaxis tick major linestyle 1', &
172 '@ xaxis tick major grid off',
'@ xaxis tick minor color 1', &
173 '@ xaxis tick minor linewidth 3.0',
'@ xaxis tick minor linestyle 1', &
174 '@ xaxis tick minor grid off',
'@ xaxis tick minor size 0.500000'
175 WRITE (iw,
'(A)')
'@ xaxis ticklabel on',
'@ xaxis ticklabel format general', &
176 '@ xaxis ticklabel prec 5',
'@ xaxis ticklabel formula ""',
'@ xaxis ticklabel append ""', &
177 '@ xaxis ticklabel prepend ""',
'@ xaxis ticklabel angle 0',
'@ xaxis ticklabel skip 0', &
178 '@ xaxis ticklabel stagger 0',
'@ xaxis ticklabel place normal', &
179 '@ xaxis ticklabel offset auto', &
180 '@ xaxis ticklabel offset 0.000000 , 0.010000',
'@ xaxis ticklabel start type auto', &
181 '@ xaxis ticklabel start 0.000000',
'@ xaxis ticklabel stop type auto', &
182 '@ xaxis ticklabel stop 0.000000',
'@ xaxis ticklabel char size 1.480000', &
183 '@ xaxis ticklabel font 0',
'@ xaxis ticklabel color 1', &
184 '@ xaxis tick place both',
'@ xaxis tick spec type none'
186 WRITE (iw,
'(A)')
'@ yaxis on', &
187 '@ yaxis type zero false', &
188 '@ yaxis offset 0.000000 , 0.000000', &
190 '@ yaxis bar color 1', &
191 '@ yaxis bar linestyle 1', &
192 '@ yaxis bar linewidth 1.0'
193 WRITE (iw,
'(A)')
'@ yaxis label "'//ylabel//
'"'
194 WRITE (iw,
'(A)')
'@ yaxis label layout para', &
195 '@ yaxis label place auto', &
196 '@ yaxis label char size 1.000000', &
197 '@ yaxis label font 0', &
198 '@ yaxis label color 1', &
199 '@ yaxis label place normal'
200 WRITE (iw,
'(A)')
'@ yaxis tick on',
'@ yaxis tick major 0.5',
'@ yaxis tick minor ticks 1', &
201 '@ yaxis tick default 6',
'@ yaxis tick place rounded true',
'@ yaxis tick in', &
202 '@ yaxis tick major size 1.480000',
'@ yaxis tick major color 1', &
203 '@ yaxis tick major linewidth 3.0',
'@ yaxis tick major linestyle 1', &
204 '@ yaxis tick major grid off',
'@ yaxis tick minor color 1', &
205 '@ yaxis tick minor linewidth 3.0',
'@ yaxis tick minor linestyle 1', &
206 '@ yaxis tick minor grid off',
'@ yaxis tick minor size 0.500000'
207 WRITE (iw,
'(A)')
'@ yaxis ticklabel on',
'@ yaxis ticklabel format general', &
208 '@ yaxis ticklabel prec 5',
'@ yaxis ticklabel formula ""',
'@ yaxis ticklabel append ""', &
209 '@ yaxis ticklabel prepend ""',
'@ yaxis ticklabel angle 0',
'@ yaxis ticklabel skip 0', &
210 '@ yaxis ticklabel stagger 0',
'@ yaxis ticklabel place normal', &
211 '@ yaxis ticklabel offset auto', &
212 '@ yaxis ticklabel offset 0.000000 , 0.010000',
'@ yaxis ticklabel start type auto', &
213 '@ yaxis ticklabel start 0.000000',
'@ yaxis ticklabel stop type auto', &
214 '@ yaxis ticklabel stop 0.000000',
'@ yaxis ticklabel char size 1.480000', &
215 '@ yaxis ticklabel font 0',
'@ yaxis ticklabel color 1', &
216 '@ yaxis tick place both',
'@ yaxis tick spec type none'
217 WRITE (iw,
'(A)')
'@ altxaxis off',
'@ altyaxis off'
219 WRITE (iw,
'(A)')
'@ legend on', &
220 '@ legend loctype view', &
221 '@ legend 0.8, 0.4', &
222 '@ legend box color 1', &
223 '@ legend box pattern 1', &
224 '@ legend box linewidth 2.0', &
225 '@ legend box linestyle 1', &
226 '@ legend box fill color 0', &
227 '@ legend box fill pattern 1', &
229 '@ legend char size 1.000000', &
230 '@ legend color 1', &
231 '@ legend length 4', &
234 '@ legend invert false'
236 WRITE (iw,
'(A)')
'@ frame type 0', &
237 '@ frame linestyle 1', &
238 '@ frame linewidth 3.0', &
240 '@ frame pattern 1', &
241 '@ frame background color 0', &
242 '@ frame background pattern 0'
254 INTEGER,
INTENT(IN) :: iw, gnum
255 REAL(kind=
dp),
INTENT(IN) :: linewidth
256 CHARACTER(LEN=*) :: legend
258 CHARACTER(LEN=8) :: cin, cnum, cval
261 WRITE (cnum,
'(I2)') gnum
262 WRITE (cval,
'(F3.1)') linewidth
263 cin =
"@ s"//trim(adjustl(cnum))
264 WRITE (cnum,
'(I2)') gnum + 1
265 WRITE (iw,
'(A)') trim(cin)//
' hidden false'
266 WRITE (iw,
'(A)') trim(cin)//
' type xy'
267 WRITE (iw,
'(A)') trim(cin)//
' symbol 0 '
268 WRITE (iw,
'(A)') trim(cin)//
' symbol size 1.000000'
269 WRITE (iw,
'(A)') trim(cin)//
' symbol color '//trim(adjustl(cnum))
270 WRITE (iw,
'(A)') trim(cin)//
' symbol pattern 1'
271 WRITE (iw,
'(A)') trim(cin)//
' symbol fill color 1'
272 WRITE (iw,
'(A)') trim(cin)//
' symbol fill pattern 0'
273 WRITE (iw,
'(A)') trim(cin)//
' symbol linewidth 1.0'
274 WRITE (iw,
'(A)') trim(cin)//
' symbol linestyle 1'
275 WRITE (iw,
'(A)') trim(cin)//
' symbol char 65 '
276 WRITE (iw,
'(A)') trim(cin)//
' symbol char font 0'
277 WRITE (iw,
'(A)') trim(cin)//
' symbol skip 0'
278 WRITE (iw,
'(A)') trim(cin)//
' line type 1'
279 WRITE (iw,
'(A)') trim(cin)//
' line linestyle 1'
280 WRITE (iw,
'(A)') trim(cin)//
' line linewidth '//trim(cval)
281 WRITE (iw,
'(A)') trim(cin)//
' line color '//trim(adjustl(cnum))
282 WRITE (iw,
'(A)') trim(cin)//
' line pattern 1'
283 WRITE (iw,
'(A)') trim(cin)//
' baseline type 0'
284 WRITE (iw,
'(A)') trim(cin)//
' baseline off'
285 WRITE (iw,
'(A)') trim(cin)//
' dropline off'
286 WRITE (iw,
'(A)') trim(cin)//
' fill type 0'
287 WRITE (iw,
'(A)') trim(cin)//
' fill rule 0'
288 WRITE (iw,
'(A)') trim(cin)//
' fill color '//trim(adjustl(cnum))
289 WRITE (iw,
'(A)') trim(cin)//
' fill pattern 1'
290 WRITE (iw,
'(A)') trim(cin)//
' avalue off'
291 WRITE (iw,
'(A)') trim(cin)//
' avalue type 2'
292 WRITE (iw,
'(A)') trim(cin)//
' avalue char size 1.000000'
293 WRITE (iw,
'(A)') trim(cin)//
' avalue font 0'
294 WRITE (iw,
'(A)') trim(cin)//
' avalue color '//trim(adjustl(cnum))
295 WRITE (iw,
'(A)') trim(cin)//
' avalue rot 0'
296 WRITE (iw,
'(A)') trim(cin)//
' avalue format general'
297 WRITE (iw,
'(A)') trim(cin)//
' avalue prec 3'
298 WRITE (iw,
'(A)') trim(cin)//
' avalue prepend ""'
299 WRITE (iw,
'(A)') trim(cin)//
' avalue append ""'
300 WRITE (iw,
'(A)') trim(cin)//
' avalue offset 0.000000 , 0.000000'
301 WRITE (iw,
'(A)') trim(cin)//
' errorbar on'
302 WRITE (iw,
'(A)') trim(cin)//
' errorbar place both'
303 WRITE (iw,
'(A)') trim(cin)//
' errorbar color '//trim(adjustl(cnum))
304 WRITE (iw,
'(A)') trim(cin)//
' errorbar pattern 1'
305 WRITE (iw,
'(A)') trim(cin)//
' errorbar size 1.000000'
306 WRITE (iw,
'(A)') trim(cin)//
' errorbar linewidth 1.0'
307 WRITE (iw,
'(A)') trim(cin)//
' errorbar linestyle 1'
308 WRITE (iw,
'(A)') trim(cin)//
' errorbar riser linewidth 1.0'
309 WRITE (iw,
'(A)') trim(cin)//
' errorbar riser linestyle 1'
310 WRITE (iw,
'(A)') trim(cin)//
' errorbar riser clip off'
311 WRITE (iw,
'(A)') trim(cin)//
' errorbar riser clip length 0.100000'
312 WRITE (iw,
'(A)') trim(cin)//
' comment "Cols 1:2"'
313 WRITE (iw,
'(A)') trim(cin)//
' legend "'//trim(legend)//
'"'
324 INTEGER,
INTENT(IN) :: iw, gnum
325 REAL(kind=
dp),
DIMENSION(:, :) :: gdata
327 CHARACTER(LEN=8) :: cin, cnum
331 WRITE (cnum,
'(I2)') gnum
332 cin =
"@@target G0.S"//trim(adjustl(cnum))
333 WRITE (iw,
'(A)') trim(cin)
334 WRITE (iw,
'(A)')
'@type xy'
337 WRITE (iw,
'(2G18.7)') gdata(i, 1), gdata(i, 2)
339 WRITE (iw,
'(A)')
'&'
Defines the basic variable types.
integer, parameter, public dp
Machine interface based on Fortran 2003 and POSIX.
integer, parameter, public timestamp_length
subroutine, public m_timestamp(timestamp)
Returns a human readable timestamp.
Routines to facilitate writing XMGRACE files.
subroutine, public xm_graph_data(iw, gnum, gdata)
...
subroutine, public xm_write_frameport(iw)
...
subroutine, public xm_write_frame(iw, wcoord, title, subtitle, xlabel, ylabel)
...
subroutine, public xm_write_defaults(iw)
...
subroutine, public xm_graph_info(iw, gnum, linewidth, legend)
...