Line data Source code
1 : ! ***********************************************************************
2 : !
3 : ! Copyright (C) 2013-2022 The MESA Team, Bill Paxton & Matthias Fabry
4 : !
5 : ! This program is free software: you can redistribute it and/or modify
6 : ! it under the terms of the GNU Lesser General Public License
7 : ! as published by the Free Software Foundation,
8 : ! either version 3 of the License, or (at your option) any later version.
9 : !
10 : ! This program is distributed in the hope that it will be useful,
11 : ! but WITHOUT ANY WARRANTY; without even the implied warranty of
12 : ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 : ! See the GNU Lesser General Public License for more details.
14 : !
15 : ! You should have received a copy of the GNU Lesser General Public License
16 : ! along with this program. If not, see <https://www.gnu.org/licenses/>.
17 : !
18 : ! ***********************************************************************
19 :
20 : module pgbinary_hist_track
21 :
22 : use binary_private_def
23 : use const_def, only: dp
24 : use pgbinary_support
25 :
26 : implicit none
27 :
28 :
29 : contains
30 :
31 :
32 0 : subroutine History_Track1_plot(id, device_id, ierr)
33 : integer, intent(in) :: id, device_id
34 : integer, intent(out) :: ierr
35 : type (binary_info), pointer :: b
36 : ierr = 0
37 0 : call get_binary_ptr(id, b, ierr)
38 0 : if (ierr /= 0) return
39 0 : call pgslct(device_id)
40 0 : call pgbbuf()
41 0 : call pgeras()
42 : call do_History_Track1_plot(b, id, device_id, &
43 : b% pg% History_Track1_xleft, b% pg% History_Track1_xright, &
44 : b% pg% History_Track1_ybot, b% pg% History_Track1_ytop, .false., &
45 0 : b% pg% History_Track1_title, b% pg% History_Track1_txt_scale, ierr)
46 0 : if (ierr /= 0) return
47 0 : call pgebuf()
48 : end subroutine History_Track1_plot
49 :
50 :
51 0 : subroutine do_History_Track1_plot(b, id, device_id, &
52 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
53 : type (binary_info), pointer :: b
54 : integer, intent(in) :: id, device_id
55 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
56 : logical, intent(in) :: subplot
57 : character (len = *), intent(in) :: title
58 : integer, intent(out) :: ierr
59 : call do_Hist_Track(b, id, device_id, &
60 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
61 : b% pg% History_Track1_xname, &
62 : b% pg% History_Track1_yname, &
63 : b% pg% History_Track1_xaxis_label, &
64 : b% pg% History_Track1_yaxis_label, &
65 : b% pg% History_Track1_xmin, &
66 : b% pg% History_Track1_xmax, &
67 : b% pg% History_Track1_xmargin, &
68 : b% pg% History_Track1_dxmin, &
69 : b% pg% History_Track1_ymin, &
70 : b% pg% History_Track1_ymax, &
71 : b% pg% History_Track1_ymargin, &
72 : b% pg% History_Track1_dymin, &
73 : b% pg% History_Track1_step_min, &
74 : b% pg% History_Track1_step_max, &
75 : b% pg% History_Track1_reverse_xaxis, &
76 : b% pg% History_Track1_reverse_yaxis, &
77 : b% pg% History_Track1_log_xaxis, &
78 : b% pg% History_Track1_log_yaxis, &
79 : b% pg% show_History_Track1_target_box, &
80 : b% pg% History_Track1_n_sigma, &
81 : b% pg% History_Track1_xtarget, &
82 : b% pg% History_Track1_ytarget, &
83 : b% pg% History_Track1_xsigma, &
84 : b% pg% History_Track1_ysigma, &
85 : b% pg% show_History_Track1_annotation1, &
86 : b% pg% show_History_Track1_annotation2, &
87 : b% pg% show_History_Track1_annotation3, &
88 : b% pg% History_Track1_fname, &
89 : b% pg% History_Track1_use_decorator, &
90 : b% pg% History_Track1_pgbinary_decorator, &
91 0 : null_decorate, ierr)
92 0 : end subroutine do_History_Track1_plot
93 :
94 :
95 0 : subroutine History_Track2_plot(id, device_id, ierr)
96 : integer, intent(in) :: id, device_id
97 : integer, intent(out) :: ierr
98 : type (binary_info), pointer :: b
99 : ierr = 0
100 0 : call get_binary_ptr(id, b, ierr)
101 0 : if (ierr /= 0) return
102 0 : call pgslct(device_id)
103 0 : call pgbbuf()
104 0 : call pgeras()
105 : call do_History_Track2_plot(b, id, device_id, &
106 : b% pg% History_Track2_xleft, b% pg% History_Track2_xright, &
107 : b% pg% History_Track2_ybot, b% pg% History_Track2_ytop, .false., &
108 0 : b% pg% History_Track2_title, b% pg% History_Track2_txt_scale, ierr)
109 0 : if (ierr /= 0) return
110 0 : call pgebuf()
111 : end subroutine History_Track2_plot
112 :
113 :
114 0 : subroutine do_History_Track2_plot(b, id, device_id, &
115 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
116 : type (binary_info), pointer :: b
117 : integer, intent(in) :: id, device_id
118 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
119 : logical, intent(in) :: subplot
120 : character (len = *), intent(in) :: title
121 : integer, intent(out) :: ierr
122 : call do_Hist_Track(b, id, device_id, &
123 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
124 : b% pg% History_Track2_xname, &
125 : b% pg% History_Track2_yname, &
126 : b% pg% History_Track2_xaxis_label, &
127 : b% pg% History_Track2_yaxis_label, &
128 : b% pg% History_Track2_xmin, &
129 : b% pg% History_Track2_xmax, &
130 : b% pg% History_Track2_xmargin, &
131 : b% pg% History_Track2_dxmin, &
132 : b% pg% History_Track2_ymin, &
133 : b% pg% History_Track2_ymax, &
134 : b% pg% History_Track2_ymargin, &
135 : b% pg% History_Track2_dymin, &
136 : b% pg% History_Track2_step_min, &
137 : b% pg% History_Track2_step_max, &
138 : b% pg% History_Track2_reverse_xaxis, &
139 : b% pg% History_Track2_reverse_yaxis, &
140 : b% pg% History_Track2_log_xaxis, &
141 : b% pg% History_Track2_log_yaxis, &
142 : b% pg% show_History_Track2_target_box, &
143 : b% pg% History_Track2_n_sigma, &
144 : b% pg% History_Track2_xtarget, &
145 : b% pg% History_Track2_ytarget, &
146 : b% pg% History_Track2_xsigma, &
147 : b% pg% History_Track2_ysigma, &
148 : b% pg% show_History_Track2_annotation1, &
149 : b% pg% show_History_Track2_annotation2, &
150 : b% pg% show_History_Track2_annotation3, &
151 : b% pg% History_Track2_fname, &
152 : b% pg% History_Track2_use_decorator, &
153 : b% pg% History_Track2_pgbinary_decorator, &
154 0 : null_decorate, ierr)
155 0 : end subroutine do_History_Track2_plot
156 :
157 :
158 0 : subroutine History_Track3_plot(id, device_id, ierr)
159 : integer, intent(in) :: id, device_id
160 : integer, intent(out) :: ierr
161 : type (binary_info), pointer :: b
162 : ierr = 0
163 0 : call get_binary_ptr(id, b, ierr)
164 0 : if (ierr /= 0) return
165 0 : call pgslct(device_id)
166 0 : call pgbbuf()
167 0 : call pgeras()
168 : call do_History_Track3_plot(b, id, device_id, &
169 : b% pg% History_Track3_xleft, b% pg% History_Track3_xright, &
170 : b% pg% History_Track3_ybot, b% pg% History_Track3_ytop, .false., &
171 0 : b% pg% History_Track3_title, b% pg% History_Track3_txt_scale, ierr)
172 0 : if (ierr /= 0) return
173 0 : call pgebuf()
174 : end subroutine History_Track3_plot
175 :
176 :
177 0 : subroutine do_History_Track3_plot(b, id, device_id, &
178 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
179 : type (binary_info), pointer :: b
180 : integer, intent(in) :: id, device_id
181 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
182 : logical, intent(in) :: subplot
183 : character (len = *), intent(in) :: title
184 : integer, intent(out) :: ierr
185 : call do_Hist_Track(b, id, device_id, &
186 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
187 : b% pg% History_Track3_xname, &
188 : b% pg% History_Track3_yname, &
189 : b% pg% History_Track3_xaxis_label, &
190 : b% pg% History_Track3_yaxis_label, &
191 : b% pg% History_Track3_xmin, &
192 : b% pg% History_Track3_xmax, &
193 : b% pg% History_Track3_xmargin, &
194 : b% pg% History_Track3_dxmin, &
195 : b% pg% History_Track3_ymin, &
196 : b% pg% History_Track3_ymax, &
197 : b% pg% History_Track3_ymargin, &
198 : b% pg% History_Track3_dymin, &
199 : b% pg% History_Track3_step_min, &
200 : b% pg% History_Track3_step_max, &
201 : b% pg% History_Track3_reverse_xaxis, &
202 : b% pg% History_Track3_reverse_yaxis, &
203 : b% pg% History_Track3_log_xaxis, &
204 : b% pg% History_Track3_log_yaxis, &
205 : b% pg% show_History_Track3_target_box, &
206 : b% pg% History_Track3_n_sigma, &
207 : b% pg% History_Track3_xtarget, &
208 : b% pg% History_Track3_ytarget, &
209 : b% pg% History_Track3_xsigma, &
210 : b% pg% History_Track3_ysigma, &
211 : b% pg% show_History_Track3_annotation1, &
212 : b% pg% show_History_Track3_annotation2, &
213 : b% pg% show_History_Track3_annotation3, &
214 : b% pg% History_Track3_fname, &
215 : b% pg% History_Track3_use_decorator, &
216 : b% pg% History_Track3_pgbinary_decorator, &
217 0 : null_decorate, ierr)
218 0 : end subroutine do_History_Track3_plot
219 :
220 :
221 0 : subroutine History_Track4_plot(id, device_id, ierr)
222 : integer, intent(in) :: id, device_id
223 : integer, intent(out) :: ierr
224 : type (binary_info), pointer :: b
225 : ierr = 0
226 0 : call get_binary_ptr(id, b, ierr)
227 0 : if (ierr /= 0) return
228 0 : call pgslct(device_id)
229 0 : call pgbbuf()
230 0 : call pgeras()
231 : call do_History_Track4_plot(b, id, device_id, &
232 : b% pg% History_Track4_xleft, b% pg% History_Track4_xright, &
233 : b% pg% History_Track4_ybot, b% pg% History_Track4_ytop, .false., &
234 0 : b% pg% History_Track4_title, b% pg% History_Track4_txt_scale, ierr)
235 0 : if (ierr /= 0) return
236 0 : call pgebuf()
237 : end subroutine History_Track4_plot
238 :
239 :
240 0 : subroutine do_History_Track4_plot(b, id, device_id, &
241 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
242 : type (binary_info), pointer :: b
243 : integer, intent(in) :: id, device_id
244 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
245 : logical, intent(in) :: subplot
246 : character (len = *), intent(in) :: title
247 : integer, intent(out) :: ierr
248 : call do_Hist_Track(b, id, device_id, &
249 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
250 : b% pg% History_Track4_xname, &
251 : b% pg% History_Track4_yname, &
252 : b% pg% History_Track4_xaxis_label, &
253 : b% pg% History_Track4_yaxis_label, &
254 : b% pg% History_Track4_xmin, &
255 : b% pg% History_Track4_xmax, &
256 : b% pg% History_Track4_xmargin, &
257 : b% pg% History_Track4_dxmin, &
258 : b% pg% History_Track4_ymin, &
259 : b% pg% History_Track4_ymax, &
260 : b% pg% History_Track4_ymargin, &
261 : b% pg% History_Track4_dymin, &
262 : b% pg% History_Track4_step_min, &
263 : b% pg% History_Track4_step_max, &
264 : b% pg% History_Track4_reverse_xaxis, &
265 : b% pg% History_Track4_reverse_yaxis, &
266 : b% pg% History_Track4_log_xaxis, &
267 : b% pg% History_Track4_log_yaxis, &
268 : b% pg% show_History_Track4_target_box, &
269 : b% pg% History_Track4_n_sigma, &
270 : b% pg% History_Track4_xtarget, &
271 : b% pg% History_Track4_ytarget, &
272 : b% pg% History_Track4_xsigma, &
273 : b% pg% History_Track4_ysigma, &
274 : b% pg% show_History_Track4_annotation1, &
275 : b% pg% show_History_Track4_annotation2, &
276 : b% pg% show_History_Track4_annotation3, &
277 : b% pg% History_Track4_fname, &
278 : b% pg% History_Track4_use_decorator, &
279 : b% pg% History_Track4_pgbinary_decorator, &
280 0 : null_decorate, ierr)
281 0 : end subroutine do_History_Track4_plot
282 :
283 :
284 0 : subroutine History_Track5_plot(id, device_id, ierr)
285 : integer, intent(in) :: id, device_id
286 : integer, intent(out) :: ierr
287 : type (binary_info), pointer :: b
288 : ierr = 0
289 0 : call get_binary_ptr(id, b, ierr)
290 0 : if (ierr /= 0) return
291 0 : call pgslct(device_id)
292 0 : call pgbbuf()
293 0 : call pgeras()
294 : call do_History_Track5_plot(b, id, device_id, &
295 : b% pg% History_Track5_xleft, b% pg% History_Track5_xright, &
296 : b% pg% History_Track5_ybot, b% pg% History_Track5_ytop, .false., &
297 0 : b% pg% History_Track5_title, b% pg% History_Track5_txt_scale, ierr)
298 0 : if (ierr /= 0) return
299 0 : call pgebuf()
300 : end subroutine History_Track5_plot
301 :
302 :
303 0 : subroutine do_History_Track5_plot(b, id, device_id, &
304 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
305 : type (binary_info), pointer :: b
306 : integer, intent(in) :: id, device_id
307 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
308 : logical, intent(in) :: subplot
309 : character (len = *), intent(in) :: title
310 : integer, intent(out) :: ierr
311 : call do_Hist_Track(b, id, device_id, &
312 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
313 : b% pg% History_Track5_xname, &
314 : b% pg% History_Track5_yname, &
315 : b% pg% History_Track5_xaxis_label, &
316 : b% pg% History_Track5_yaxis_label, &
317 : b% pg% History_Track5_xmin, &
318 : b% pg% History_Track5_xmax, &
319 : b% pg% History_Track5_xmargin, &
320 : b% pg% History_Track5_dxmin, &
321 : b% pg% History_Track5_ymin, &
322 : b% pg% History_Track5_ymax, &
323 : b% pg% History_Track5_ymargin, &
324 : b% pg% History_Track5_dymin, &
325 : b% pg% History_Track5_step_min, &
326 : b% pg% History_Track5_step_max, &
327 : b% pg% History_Track5_reverse_xaxis, &
328 : b% pg% History_Track5_reverse_yaxis, &
329 : b% pg% History_Track5_log_xaxis, &
330 : b% pg% History_Track5_log_yaxis, &
331 : b% pg% show_History_Track5_target_box, &
332 : b% pg% History_Track5_n_sigma, &
333 : b% pg% History_Track5_xtarget, &
334 : b% pg% History_Track5_ytarget, &
335 : b% pg% History_Track5_xsigma, &
336 : b% pg% History_Track5_ysigma, &
337 : b% pg% show_History_Track5_annotation1, &
338 : b% pg% show_History_Track5_annotation2, &
339 : b% pg% show_History_Track5_annotation3, &
340 : b% pg% History_Track5_fname, &
341 : b% pg% History_Track5_use_decorator, &
342 : b% pg% History_Track5_pgbinary_decorator, &
343 0 : null_decorate, ierr)
344 0 : end subroutine do_History_Track5_plot
345 :
346 :
347 0 : subroutine History_Track6_plot(id, device_id, ierr)
348 : integer, intent(in) :: id, device_id
349 : integer, intent(out) :: ierr
350 : type (binary_info), pointer :: b
351 : ierr = 0
352 0 : call get_binary_ptr(id, b, ierr)
353 0 : if (ierr /= 0) return
354 0 : call pgslct(device_id)
355 0 : call pgbbuf()
356 0 : call pgeras()
357 : call do_History_Track6_plot(b, id, device_id, &
358 : b% pg% History_Track6_xleft, b% pg% History_Track6_xright, &
359 : b% pg% History_Track6_ybot, b% pg% History_Track6_ytop, .false., &
360 0 : b% pg% History_Track6_title, b% pg% History_Track6_txt_scale, ierr)
361 0 : if (ierr /= 0) return
362 0 : call pgebuf()
363 : end subroutine History_Track6_plot
364 :
365 :
366 0 : subroutine do_History_Track6_plot(b, id, device_id, &
367 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
368 : type (binary_info), pointer :: b
369 : integer, intent(in) :: id, device_id
370 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
371 : logical, intent(in) :: subplot
372 : character (len = *), intent(in) :: title
373 : integer, intent(out) :: ierr
374 : call do_Hist_Track(b, id, device_id, &
375 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
376 : b% pg% History_Track6_xname, &
377 : b% pg% History_Track6_yname, &
378 : b% pg% History_Track6_xaxis_label, &
379 : b% pg% History_Track6_yaxis_label, &
380 : b% pg% History_Track6_xmin, &
381 : b% pg% History_Track6_xmax, &
382 : b% pg% History_Track6_xmargin, &
383 : b% pg% History_Track6_dxmin, &
384 : b% pg% History_Track6_ymin, &
385 : b% pg% History_Track6_ymax, &
386 : b% pg% History_Track6_ymargin, &
387 : b% pg% History_Track6_dymin, &
388 : b% pg% History_Track6_step_min, &
389 : b% pg% History_Track6_step_max, &
390 : b% pg% History_Track6_reverse_xaxis, &
391 : b% pg% History_Track6_reverse_yaxis, &
392 : b% pg% History_Track6_log_xaxis, &
393 : b% pg% History_Track6_log_yaxis, &
394 : b% pg% show_History_Track6_target_box, &
395 : b% pg% History_Track6_n_sigma, &
396 : b% pg% History_Track6_xtarget, &
397 : b% pg% History_Track6_ytarget, &
398 : b% pg% History_Track6_xsigma, &
399 : b% pg% History_Track6_ysigma, &
400 : b% pg% show_History_Track6_annotation1, &
401 : b% pg% show_History_Track6_annotation2, &
402 : b% pg% show_History_Track6_annotation3, &
403 : b% pg% History_Track6_fname, &
404 : b% pg% History_Track6_use_decorator, &
405 : b% pg% History_Track6_pgbinary_decorator, &
406 0 : null_decorate, ierr)
407 0 : end subroutine do_History_Track6_plot
408 :
409 :
410 0 : subroutine History_Track7_plot(id, device_id, ierr)
411 : integer, intent(in) :: id, device_id
412 : integer, intent(out) :: ierr
413 : type (binary_info), pointer :: b
414 : ierr = 0
415 0 : call get_binary_ptr(id, b, ierr)
416 0 : if (ierr /= 0) return
417 0 : call pgslct(device_id)
418 0 : call pgbbuf()
419 0 : call pgeras()
420 : call do_History_Track7_plot(b, id, device_id, &
421 : b% pg% History_Track7_xleft, b% pg% History_Track7_xright, &
422 : b% pg% History_Track7_ybot, b% pg% History_Track7_ytop, .false., &
423 0 : b% pg% History_Track7_title, b% pg% History_Track7_txt_scale, ierr)
424 0 : if (ierr /= 0) return
425 0 : call pgebuf()
426 : end subroutine History_Track7_plot
427 :
428 :
429 0 : subroutine do_History_Track7_plot(b, id, device_id, &
430 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
431 : type (binary_info), pointer :: b
432 : integer, intent(in) :: id, device_id
433 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
434 : logical, intent(in) :: subplot
435 : character (len = *), intent(in) :: title
436 : integer, intent(out) :: ierr
437 : call do_Hist_Track(b, id, device_id, &
438 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
439 : b% pg% History_Track7_xname, &
440 : b% pg% History_Track7_yname, &
441 : b% pg% History_Track7_xaxis_label, &
442 : b% pg% History_Track7_yaxis_label, &
443 : b% pg% History_Track7_xmin, &
444 : b% pg% History_Track7_xmax, &
445 : b% pg% History_Track7_xmargin, &
446 : b% pg% History_Track7_dxmin, &
447 : b% pg% History_Track7_ymin, &
448 : b% pg% History_Track7_ymax, &
449 : b% pg% History_Track7_ymargin, &
450 : b% pg% History_Track7_dymin, &
451 : b% pg% History_Track7_step_min, &
452 : b% pg% History_Track7_step_max, &
453 : b% pg% History_Track7_reverse_xaxis, &
454 : b% pg% History_Track7_reverse_yaxis, &
455 : b% pg% History_Track7_log_xaxis, &
456 : b% pg% History_Track7_log_yaxis, &
457 : b% pg% show_History_Track7_target_box, &
458 : b% pg% History_Track7_n_sigma, &
459 : b% pg% History_Track7_xtarget, &
460 : b% pg% History_Track7_ytarget, &
461 : b% pg% History_Track7_xsigma, &
462 : b% pg% History_Track7_ysigma, &
463 : b% pg% show_History_Track7_annotation1, &
464 : b% pg% show_History_Track7_annotation2, &
465 : b% pg% show_History_Track7_annotation3, &
466 : b% pg% History_Track7_fname, &
467 : b% pg% History_Track7_use_decorator, &
468 : b% pg% History_Track7_pgbinary_decorator, &
469 0 : null_decorate, ierr)
470 0 : end subroutine do_History_Track7_plot
471 :
472 :
473 0 : subroutine History_Track8_plot(id, device_id, ierr)
474 : integer, intent(in) :: id, device_id
475 : integer, intent(out) :: ierr
476 : type (binary_info), pointer :: b
477 : ierr = 0
478 0 : call get_binary_ptr(id, b, ierr)
479 0 : if (ierr /= 0) return
480 0 : call pgslct(device_id)
481 0 : call pgbbuf()
482 0 : call pgeras()
483 : call do_History_Track8_plot(b, id, device_id, &
484 : b% pg% History_Track8_xleft, b% pg% History_Track8_xright, &
485 : b% pg% History_Track8_ybot, b% pg% History_Track8_ytop, .false., &
486 0 : b% pg% History_Track8_title, b% pg% History_Track8_txt_scale, ierr)
487 0 : if (ierr /= 0) return
488 0 : call pgebuf()
489 : end subroutine History_Track8_plot
490 :
491 :
492 0 : subroutine do_History_Track8_plot(b, id, device_id, &
493 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
494 : type (binary_info), pointer :: b
495 : integer, intent(in) :: id, device_id
496 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
497 : logical, intent(in) :: subplot
498 : character (len = *), intent(in) :: title
499 : integer, intent(out) :: ierr
500 : call do_Hist_Track(b, id, device_id, &
501 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
502 : b% pg% History_Track8_xname, &
503 : b% pg% History_Track8_yname, &
504 : b% pg% History_Track8_xaxis_label, &
505 : b% pg% History_Track8_yaxis_label, &
506 : b% pg% History_Track8_xmin, &
507 : b% pg% History_Track8_xmax, &
508 : b% pg% History_Track8_xmargin, &
509 : b% pg% History_Track8_dxmin, &
510 : b% pg% History_Track8_ymin, &
511 : b% pg% History_Track8_ymax, &
512 : b% pg% History_Track8_ymargin, &
513 : b% pg% History_Track8_dymin, &
514 : b% pg% History_Track8_step_min, &
515 : b% pg% History_Track8_step_max, &
516 : b% pg% History_Track8_reverse_xaxis, &
517 : b% pg% History_Track8_reverse_yaxis, &
518 : b% pg% History_Track8_log_xaxis, &
519 : b% pg% History_Track8_log_yaxis, &
520 : b% pg% show_History_Track8_target_box, &
521 : b% pg% History_Track8_n_sigma, &
522 : b% pg% History_Track8_xtarget, &
523 : b% pg% History_Track8_ytarget, &
524 : b% pg% History_Track8_xsigma, &
525 : b% pg% History_Track8_ysigma, &
526 : b% pg% show_History_Track8_annotation1, &
527 : b% pg% show_History_Track8_annotation2, &
528 : b% pg% show_History_Track8_annotation3, &
529 : b% pg% History_Track8_fname, &
530 : b% pg% History_Track8_use_decorator, &
531 : b% pg% History_Track8_pgbinary_decorator, &
532 0 : null_decorate, ierr)
533 0 : end subroutine do_History_Track8_plot
534 :
535 :
536 0 : subroutine History_Track9_plot(id, device_id, ierr)
537 : integer, intent(in) :: id, device_id
538 : integer, intent(out) :: ierr
539 : type (binary_info), pointer :: b
540 : ierr = 0
541 0 : call get_binary_ptr(id, b, ierr)
542 0 : if (ierr /= 0) return
543 0 : call pgslct(device_id)
544 0 : call pgbbuf()
545 0 : call pgeras()
546 : call do_History_Track9_plot(b, id, device_id, &
547 : b% pg% History_Track9_xleft, b% pg% History_Track9_xright, &
548 : b% pg% History_Track9_ybot, b% pg% History_Track9_ytop, .false., &
549 0 : b% pg% History_Track9_title, b% pg% History_Track9_txt_scale, ierr)
550 0 : if (ierr /= 0) return
551 0 : call pgebuf()
552 : end subroutine History_Track9_plot
553 :
554 :
555 0 : subroutine do_History_Track9_plot(b, id, device_id, &
556 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
557 : type (binary_info), pointer :: b
558 : integer, intent(in) :: id, device_id
559 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
560 : logical, intent(in) :: subplot
561 : character (len = *), intent(in) :: title
562 : integer, intent(out) :: ierr
563 : call do_Hist_Track(b, id, device_id, &
564 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
565 : b% pg% History_Track9_xname, &
566 : b% pg% History_Track9_yname, &
567 : b% pg% History_Track9_xaxis_label, &
568 : b% pg% History_Track9_yaxis_label, &
569 : b% pg% History_Track9_xmin, &
570 : b% pg% History_Track9_xmax, &
571 : b% pg% History_Track9_xmargin, &
572 : b% pg% History_Track9_dxmin, &
573 : b% pg% History_Track9_ymin, &
574 : b% pg% History_Track9_ymax, &
575 : b% pg% History_Track9_ymargin, &
576 : b% pg% History_Track9_dymin, &
577 : b% pg% History_Track9_step_min, &
578 : b% pg% History_Track9_step_max, &
579 : b% pg% History_Track9_reverse_xaxis, &
580 : b% pg% History_Track9_reverse_yaxis, &
581 : b% pg% History_Track9_log_xaxis, &
582 : b% pg% History_Track9_log_yaxis, &
583 : b% pg% show_History_Track9_target_box, &
584 : b% pg% History_Track9_n_sigma, &
585 : b% pg% History_Track9_xtarget, &
586 : b% pg% History_Track9_ytarget, &
587 : b% pg% History_Track9_xsigma, &
588 : b% pg% History_Track9_ysigma, &
589 : b% pg% show_History_Track9_annotation1, &
590 : b% pg% show_History_Track9_annotation2, &
591 : b% pg% show_History_Track9_annotation3, &
592 : b% pg% History_Track9_fname, &
593 : b% pg% History_Track9_use_decorator, &
594 : b% pg% History_Track9_pgbinary_decorator, &
595 0 : null_decorate, ierr)
596 0 : end subroutine do_History_Track9_plot
597 :
598 :
599 0 : subroutine null_decorate(id, ierr)
600 : integer, intent(in) :: id
601 : integer, intent(out) :: ierr
602 0 : ierr = 0
603 0 : end subroutine null_decorate
604 :
605 :
606 0 : subroutine do_Hist_Track(b, id, device_id, &
607 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
608 : xname, yname, xaxis_label, yaxis_label, &
609 : given_xmin, given_xmax, xmargin, dxmin, &
610 : given_ymin, given_ymax, ymargin, dymin, &
611 : step_min, step_max, &
612 : reverse_xaxis, reverse_yaxis, &
613 : log_xaxis, log_yaxis, &
614 : show_target_box, n_sigma, &
615 : xtarget, ytarget, xsigma, ysigma, &
616 : show_annotation1, show_annotation2, show_annotation3, &
617 : fname, &
618 : use_decorator, pgbinary_decorator, &
619 : decorate, ierr)
620 :
621 : use utils_lib
622 : use pgstar_support, only : set_xleft_xright, set_ytop_ybot
623 : use pgstar_colors
624 :
625 : type (binary_info), pointer :: b
626 : integer, intent(in) :: &
627 : id, device_id, step_min, step_max, n_sigma
628 : real, intent(in) :: &
629 : vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale, &
630 : xtarget, ytarget, xsigma, ysigma, &
631 : given_xmin, given_xmax, xmargin, dxmin, &
632 : given_ymin, given_ymax, ymargin, dymin
633 : character (len = *), intent(in) :: &
634 : title, xname, yname, xaxis_label, yaxis_label, fname
635 : logical, intent(in) :: subplot, &
636 : reverse_xaxis, reverse_yaxis, log_xaxis, log_yaxis, show_target_box, &
637 : show_annotation1, show_annotation2, show_annotation3, use_decorator
638 : interface
639 : subroutine decorate(id, ierr)
640 : implicit none
641 : integer, intent(in) :: id
642 : integer, intent(out) :: ierr
643 : end subroutine decorate
644 : end interface
645 : integer, intent(out) :: ierr
646 : procedure(pgbinary_decorator_interface), pointer :: pgbinary_decorator
647 :
648 0 : real :: xleft, xright, ybot, ytop
649 : integer :: j, j_min, j_max
650 0 : real :: dx, dy, xplus, xminus, yplus, yminus
651 0 : real, dimension(:), pointer :: xvec, yvec
652 : integer :: k, n
653 : integer :: ix, iy
654 : integer :: file_data_len
655 0 : real, pointer, dimension(:) :: file_data_xvec, file_data_yvec
656 :
657 : logical, parameter :: dbg = .false.
658 :
659 : include 'formats'
660 :
661 : ierr = 0
662 :
663 0 : call integer_dict_lookup(b% binary_history_names_dict, xname, ix, ierr)
664 0 : if (ierr /= 0) ix = -1
665 0 : if (ix <= 0) then
666 0 : write(*, *)
667 : write(*, *) 'ERROR: failed to find ' // &
668 0 : trim(xname) // ' in history data'
669 0 : write(*, *)
670 : ierr = -1
671 : end if
672 :
673 0 : call integer_dict_lookup(b% binary_history_names_dict, yname, iy, ierr)
674 0 : if (ierr /= 0) iy = -1
675 0 : if (iy <= 0) then
676 0 : write(*, *)
677 : write(*, *) 'ERROR: failed to find ' // &
678 0 : trim(yname) // ' in history data'
679 0 : write(*, *)
680 0 : ierr = -1
681 : end if
682 0 : if (ierr /= 0) return
683 :
684 0 : n = count_hist_points(b, step_min, step_max)
685 0 : allocate(xvec(n), yvec(n), stat = ierr)
686 0 : if (ierr /= 0) then
687 0 : write(*, *) 'allocate failed for PGSTAR'
688 0 : return
689 : end if
690 :
691 0 : call get_hist_points(b, step_min, step_max, n, ix, xvec)
692 0 : call get_hist_points(b, step_min, step_max, n, iy, yvec)
693 :
694 0 : if (log_xaxis) then
695 0 : do k = 1, n
696 0 : xvec(k) = log10(max(tiny(xvec(k)), abs(xvec(k))))
697 : end do
698 : end if
699 :
700 0 : if (log_yaxis) then
701 0 : do k = 1, n
702 0 : yvec(k) = log10(max(tiny(yvec(k)), abs(yvec(k))))
703 : end do
704 : end if
705 :
706 : call set_xleft_xright(&
707 : n, xvec, given_xmin, given_xmax, xmargin, &
708 0 : reverse_xaxis, dxmin, xleft, xright)
709 :
710 : call set_ytop_ybot(&
711 : n, yvec, given_ymin, given_ymax, -101.0, ymargin, &
712 0 : reverse_yaxis, dymin, ybot, ytop)
713 :
714 0 : call pgsave
715 0 : call pgsch(txt_scale)
716 0 : call pgsvp(vp_xleft, vp_xright, vp_ybot, vp_ytop)
717 0 : call pgswin(xleft, xright, ybot, ytop)
718 0 : call pgscf(1)
719 0 : call pgsci(clr_Foreground)
720 0 : call show_box_pgbinary(b, 'BCNST1', 'BCNSTV1')
721 :
722 0 : if (log_xaxis) then
723 0 : call show_xaxis_label_pgbinary(b, 'log ' // xaxis_label)
724 : else
725 0 : call show_xaxis_label_pgbinary(b, xaxis_label)
726 : end if
727 :
728 0 : if (log_yaxis) then
729 0 : call show_left_yaxis_label_pgbinary(b, 'log ' // yaxis_label)
730 : else
731 0 : call show_left_yaxis_label_pgbinary(b, yaxis_label)
732 : end if
733 :
734 0 : if (.not. subplot) then
735 0 : call show_model_number_pgbinary(b)
736 0 : call show_age_pgbinary(b)
737 : end if
738 0 : call show_title_pgbinary(b, title)
739 :
740 0 : call pgslw(b% pg% pgbinary_lw)
741 :
742 0 : call show_file_track
743 :
744 0 : if (show_target_box) then
745 0 : call pgsci(clr_Silver)
746 0 : if (n_sigma >= 0) then
747 : j_min = n_sigma
748 : j_max = n_sigma
749 : else
750 0 : j_min = 1
751 0 : j_max = -n_sigma
752 : end if
753 0 : do j = j_min, j_max
754 0 : dx = xsigma * j
755 0 : xplus = xtarget + dx
756 0 : xminus = xtarget - dx
757 0 : if (log_xaxis) then
758 0 : xplus = log10(max(tiny(xplus), xplus))
759 0 : xminus = log10(max(tiny(xminus), xminus))
760 : end if
761 0 : dy = ysigma * j
762 0 : yplus = ytarget + dy
763 0 : yminus = ytarget - dy
764 0 : if (log_yaxis) then
765 0 : yplus = log10(max(tiny(yplus), yplus))
766 0 : yminus = log10(max(tiny(yminus), yminus))
767 : end if
768 0 : call pgmove(xminus, yminus)
769 0 : call pgdraw(xplus, yminus)
770 0 : call pgdraw(xplus, yplus)
771 0 : call pgdraw(xminus, yplus)
772 0 : call pgdraw(xminus, yminus)
773 : end do
774 : end if
775 :
776 0 : call pgsci(clr_Teal)
777 0 : call pgline(n, xvec, yvec)
778 0 : call pgsci(clr_Crimson)
779 0 : call pgsch(2.8 * txt_scale)
780 0 : call pgpt1(xvec(n), yvec(n), 0902)
781 :
782 : call show_annotations(b, &
783 : show_annotation1, &
784 : show_annotation2, &
785 0 : show_annotation3)
786 :
787 0 : call decorate(b% binary_id, ierr)
788 :
789 0 : call pgunsa
790 :
791 0 : call show_pgbinary_decorator(b% binary_id, use_decorator, pgbinary_decorator, 0, ierr)
792 :
793 0 : deallocate(xvec, yvec)
794 :
795 : contains
796 :
797 :
798 0 : subroutine show_file_track
799 : integer :: k
800 0 : if (len_trim(fname) == 0) return
801 0 : if (.not. read_values_from_file(fname, &
802 : file_data_xvec, file_data_yvec, file_data_len)) then
803 : write(*, *) &
804 0 : 'bad filename for History tracks plot ' // trim(fname)
805 0 : return
806 : end if
807 0 : if (log_xaxis) then
808 0 : do k = 1, file_data_len
809 0 : file_data_xvec(k) = log10(max(tiny(file_data_xvec(k)), abs(file_data_xvec(k))))
810 : end do
811 : end if
812 0 : if (log_yaxis) then
813 0 : do k = 1, file_data_len
814 0 : file_data_yvec(k) = log10(max(tiny(file_data_yvec(k)), abs(file_data_yvec(k))))
815 : end do
816 : end if
817 0 : call pgsci(clr_Goldenrod)
818 0 : call pgline(file_data_len, file_data_xvec, file_data_yvec)
819 0 : deallocate(file_data_xvec, file_data_yvec)
820 0 : end subroutine show_file_track
821 :
822 :
823 : end subroutine do_Hist_Track
824 :
825 :
826 : end module pgbinary_hist_track
827 :
|