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_history_panels
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_Panels1_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_Panels1_plot(b, id, device_id, &
43 : b% pg% History_Panels1_xleft, b% pg% History_Panels1_xright, &
44 : b% pg% History_Panels1_ybot, b% pg% History_Panels1_ytop, .false., &
45 0 : b% pg% History_Panels1_title, b% pg% History_Panels1_txt_scale, ierr)
46 0 : if (ierr /= 0) return
47 0 : call pgebuf()
48 : end subroutine History_Panels1_plot
49 :
50 :
51 0 : subroutine do_History_Panels1_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_history_panels_plot(&
60 : id, b, device_id, &
61 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
62 : b% pg% History_Panels1_xaxis_name, &
63 : b% pg% History_Panels1_xmin, &
64 : b% pg% History_Panels1_xmax, &
65 : b% pg% History_Panels1_dxmin, &
66 : b% pg% History_Panels1_xmargin, &
67 : b% pg% History_Panels1_max_width, &
68 : b% pg% History_Panels1_num_panels, &
69 : b% pg% History_Panels1_other_ymin, &
70 : b% pg% History_Panels1_other_ymax, &
71 : b% pg% History_Panels1_yaxis_reversed, &
72 : b% pg% History_Panels1_other_yaxis_log, &
73 : b% pg% History_Panels1_other_dymin, &
74 : b% pg% History_Panels1_points_name, &
75 : b% pg% History_Panels1_other_ymargin, &
76 : b% pg% History_Panels1_other_yaxis_name, &
77 : b% pg% History_Panels1_ymin, &
78 : b% pg% History_Panels1_ymax, &
79 : b% pg% History_Panels1_xaxis_reversed, &
80 : b% pg% History_Panels1_yaxis_reversed, &
81 : b% pg% History_Panels1_xaxis_log, &
82 : b% pg% History_Panels1_yaxis_log, &
83 : b% pg% History_Panels1_dymin, &
84 : b% pg% History_Panels1_ymargin, &
85 : b% pg% History_Panels1_yaxis_name, &
86 : b% pg% History_Panels1_use_decorator, &
87 : b% pg% History_Panels1_pgbinary_decorator, &
88 0 : ierr)
89 0 : end subroutine do_History_Panels1_plot
90 :
91 :
92 0 : subroutine History_Panels2_plot(id, device_id, ierr)
93 : integer, intent(in) :: id, device_id
94 : integer, intent(out) :: ierr
95 : type (binary_info), pointer :: b
96 : ierr = 0
97 0 : call get_binary_ptr(id, b, ierr)
98 0 : if (ierr /= 0) return
99 0 : call pgslct(device_id)
100 0 : call pgbbuf()
101 0 : call pgeras()
102 : call do_History_Panels2_plot(b, id, device_id, &
103 : b% pg% History_Panels2_xleft, b% pg% History_Panels2_xright, &
104 : b% pg% History_Panels2_ybot, b% pg% History_Panels2_ytop, .false., &
105 0 : b% pg% History_Panels2_title, b% pg% History_Panels2_txt_scale, ierr)
106 0 : if (ierr /= 0) return
107 0 : call pgebuf()
108 : end subroutine History_Panels2_plot
109 :
110 :
111 0 : subroutine do_History_Panels2_plot(b, id, device_id, &
112 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
113 : type (binary_info), pointer :: b
114 : integer, intent(in) :: id, device_id
115 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
116 : logical, intent(in) :: subplot
117 : character (len = *), intent(in) :: title
118 : integer, intent(out) :: ierr
119 : call do_history_panels_plot(&
120 : id, b, device_id, &
121 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
122 : b% pg% History_Panels2_xaxis_name, &
123 : b% pg% History_Panels2_xmin, &
124 : b% pg% History_Panels2_xmax, &
125 : b% pg% History_Panels2_dxmin, &
126 : b% pg% History_Panels2_xmargin, &
127 : b% pg% History_Panels2_max_width, &
128 : b% pg% History_Panels2_num_panels, &
129 : b% pg% History_Panels2_other_ymin, &
130 : b% pg% History_Panels2_other_ymax, &
131 : b% pg% History_Panels2_yaxis_reversed, &
132 : b% pg% History_Panels2_other_yaxis_log, &
133 : b% pg% History_Panels2_other_dymin, &
134 : b% pg% History_Panels2_points_name, &
135 : b% pg% History_Panels2_other_ymargin, &
136 : b% pg% History_Panels2_other_yaxis_name, &
137 : b% pg% History_Panels2_ymin, &
138 : b% pg% History_Panels2_ymax, &
139 : b% pg% History_Panels2_xaxis_reversed, &
140 : b% pg% History_Panels2_yaxis_reversed, &
141 : b% pg% History_Panels2_xaxis_log, &
142 : b% pg% History_Panels2_yaxis_log, &
143 : b% pg% History_Panels2_dymin, &
144 : b% pg% History_Panels2_ymargin, &
145 : b% pg% History_Panels2_yaxis_name, &
146 : b% pg% History_Panels2_use_decorator, &
147 : b% pg% History_Panels2_pgbinary_decorator, &
148 0 : ierr)
149 0 : end subroutine do_History_Panels2_plot
150 :
151 :
152 0 : subroutine History_Panels3_plot(id, device_id, ierr)
153 : integer, intent(in) :: id, device_id
154 : integer, intent(out) :: ierr
155 : type (binary_info), pointer :: b
156 : ierr = 0
157 0 : call get_binary_ptr(id, b, ierr)
158 0 : if (ierr /= 0) return
159 0 : call pgslct(device_id)
160 0 : call pgbbuf()
161 0 : call pgeras()
162 : call do_History_Panels3_plot(b, id, device_id, &
163 : b% pg% History_Panels3_xleft, b% pg% History_Panels3_xright, &
164 : b% pg% History_Panels3_ybot, b% pg% History_Panels3_ytop, .false., &
165 0 : b% pg% History_Panels3_title, b% pg% History_Panels3_txt_scale, ierr)
166 0 : if (ierr /= 0) return
167 0 : call pgebuf()
168 : end subroutine History_Panels3_plot
169 :
170 :
171 0 : subroutine do_History_Panels3_plot(b, id, device_id, &
172 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
173 : type (binary_info), pointer :: b
174 : integer, intent(in) :: id, device_id
175 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
176 : logical, intent(in) :: subplot
177 : character (len = *), intent(in) :: title
178 : integer, intent(out) :: ierr
179 : call do_history_panels_plot(&
180 : id, b, device_id, &
181 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
182 : b% pg% History_Panels3_xaxis_name, &
183 : b% pg% History_Panels3_xmin, &
184 : b% pg% History_Panels3_xmax, &
185 : b% pg% History_Panels3_dxmin, &
186 : b% pg% History_Panels3_xmargin, &
187 : b% pg% History_Panels3_max_width, &
188 : b% pg% History_Panels3_num_panels, &
189 : b% pg% History_Panels3_other_ymin, &
190 : b% pg% History_Panels3_other_ymax, &
191 : b% pg% History_Panels3_yaxis_reversed, &
192 : b% pg% History_Panels3_other_yaxis_log, &
193 : b% pg% History_Panels3_other_dymin, &
194 : b% pg% History_Panels3_points_name, &
195 : b% pg% History_Panels3_other_ymargin, &
196 : b% pg% History_Panels3_other_yaxis_name, &
197 : b% pg% History_Panels3_ymin, &
198 : b% pg% History_Panels3_ymax, &
199 : b% pg% History_Panels3_xaxis_reversed, &
200 : b% pg% History_Panels3_yaxis_reversed, &
201 : b% pg% History_Panels3_xaxis_log, &
202 : b% pg% History_Panels3_yaxis_log, &
203 : b% pg% History_Panels3_dymin, &
204 : b% pg% History_Panels3_ymargin, &
205 : b% pg% History_Panels3_yaxis_name, &
206 : b% pg% History_Panels3_use_decorator, &
207 : b% pg% History_Panels3_pgbinary_decorator, &
208 0 : ierr)
209 0 : end subroutine do_History_Panels3_plot
210 :
211 :
212 0 : subroutine History_Panels4_plot(id, device_id, ierr)
213 : integer, intent(in) :: id, device_id
214 : integer, intent(out) :: ierr
215 : type (binary_info), pointer :: b
216 : ierr = 0
217 0 : call get_binary_ptr(id, b, ierr)
218 0 : if (ierr /= 0) return
219 0 : call pgslct(device_id)
220 0 : call pgbbuf()
221 0 : call pgeras()
222 : call do_History_Panels4_plot(b, id, device_id, &
223 : b% pg% History_Panels4_xleft, b% pg% History_Panels4_xright, &
224 : b% pg% History_Panels4_ybot, b% pg% History_Panels4_ytop, .false., &
225 0 : b% pg% History_Panels4_title, b% pg% History_Panels4_txt_scale, ierr)
226 0 : if (ierr /= 0) return
227 0 : call pgebuf()
228 : end subroutine History_Panels4_plot
229 :
230 :
231 0 : subroutine do_History_Panels4_plot(b, id, device_id, &
232 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
233 : type (binary_info), pointer :: b
234 : integer, intent(in) :: id, device_id
235 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
236 : logical, intent(in) :: subplot
237 : character (len = *), intent(in) :: title
238 : integer, intent(out) :: ierr
239 : call do_history_panels_plot(&
240 : id, b, device_id, &
241 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
242 : b% pg% History_Panels4_xaxis_name, &
243 : b% pg% History_Panels4_xmin, &
244 : b% pg% History_Panels4_xmax, &
245 : b% pg% History_Panels4_dxmin, &
246 : b% pg% History_Panels4_xmargin, &
247 : b% pg% History_Panels4_max_width, &
248 : b% pg% History_Panels4_num_panels, &
249 : b% pg% History_Panels4_other_ymin, &
250 : b% pg% History_Panels4_other_ymax, &
251 : b% pg% History_Panels4_yaxis_reversed, &
252 : b% pg% History_Panels4_other_yaxis_log, &
253 : b% pg% History_Panels4_other_dymin, &
254 : b% pg% History_Panels4_points_name, &
255 : b% pg% History_Panels4_other_ymargin, &
256 : b% pg% History_Panels4_other_yaxis_name, &
257 : b% pg% History_Panels4_ymin, &
258 : b% pg% History_Panels4_ymax, &
259 : b% pg% History_Panels4_xaxis_reversed, &
260 : b% pg% History_Panels4_yaxis_reversed, &
261 : b% pg% History_Panels4_xaxis_log, &
262 : b% pg% History_Panels4_yaxis_log, &
263 : b% pg% History_Panels4_dymin, &
264 : b% pg% History_Panels4_ymargin, &
265 : b% pg% History_Panels4_yaxis_name, &
266 : b% pg% History_Panels4_use_decorator, &
267 : b% pg% History_Panels4_pgbinary_decorator, &
268 0 : ierr)
269 0 : end subroutine do_History_Panels4_plot
270 :
271 :
272 0 : subroutine History_Panels5_plot(id, device_id, ierr)
273 : integer, intent(in) :: id, device_id
274 : integer, intent(out) :: ierr
275 : type (binary_info), pointer :: b
276 : ierr = 0
277 0 : call get_binary_ptr(id, b, ierr)
278 0 : if (ierr /= 0) return
279 0 : call pgslct(device_id)
280 0 : call pgbbuf()
281 0 : call pgeras()
282 : call do_History_Panels5_plot(b, id, device_id, &
283 : b% pg% History_Panels5_xleft, b% pg% History_Panels5_xright, &
284 : b% pg% History_Panels5_ybot, b% pg% History_Panels5_ytop, .false., &
285 0 : b% pg% History_Panels5_title, b% pg% History_Panels5_txt_scale, ierr)
286 0 : if (ierr /= 0) return
287 0 : call pgebuf()
288 : end subroutine History_Panels5_plot
289 :
290 :
291 0 : subroutine do_History_Panels5_plot(b, id, device_id, &
292 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
293 : type (binary_info), pointer :: b
294 : integer, intent(in) :: id, device_id
295 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
296 : logical, intent(in) :: subplot
297 : character (len = *), intent(in) :: title
298 : integer, intent(out) :: ierr
299 : call do_history_panels_plot(&
300 : id, b, device_id, &
301 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
302 : b% pg% History_Panels5_xaxis_name, &
303 : b% pg% History_Panels5_xmin, &
304 : b% pg% History_Panels5_xmax, &
305 : b% pg% History_Panels5_dxmin, &
306 : b% pg% History_Panels5_xmargin, &
307 : b% pg% History_Panels5_max_width, &
308 : b% pg% History_Panels5_num_panels, &
309 : b% pg% History_Panels5_other_ymin, &
310 : b% pg% History_Panels5_other_ymax, &
311 : b% pg% History_Panels5_yaxis_reversed, &
312 : b% pg% History_Panels5_other_yaxis_log, &
313 : b% pg% History_Panels5_other_dymin, &
314 : b% pg% History_Panels5_points_name, &
315 : b% pg% History_Panels5_other_ymargin, &
316 : b% pg% History_Panels5_other_yaxis_name, &
317 : b% pg% History_Panels5_ymin, &
318 : b% pg% History_Panels5_ymax, &
319 : b% pg% History_Panels5_xaxis_reversed, &
320 : b% pg% History_Panels5_yaxis_reversed, &
321 : b% pg% History_Panels5_xaxis_log, &
322 : b% pg% History_Panels5_yaxis_log, &
323 : b% pg% History_Panels5_dymin, &
324 : b% pg% History_Panels5_ymargin, &
325 : b% pg% History_Panels5_yaxis_name, &
326 : b% pg% History_Panels5_use_decorator, &
327 : b% pg% History_Panels5_pgbinary_decorator, &
328 0 : ierr)
329 0 : end subroutine do_History_Panels5_plot
330 :
331 :
332 0 : subroutine History_Panels6_plot(id, device_id, ierr)
333 : integer, intent(in) :: id, device_id
334 : integer, intent(out) :: ierr
335 : type (binary_info), pointer :: b
336 : ierr = 0
337 0 : call get_binary_ptr(id, b, ierr)
338 0 : if (ierr /= 0) return
339 0 : call pgslct(device_id)
340 0 : call pgbbuf()
341 0 : call pgeras()
342 : call do_History_Panels6_plot(b, id, device_id, &
343 : b% pg% History_Panels6_xleft, b% pg% History_Panels6_xright, &
344 : b% pg% History_Panels6_ybot, b% pg% History_Panels6_ytop, .false., &
345 0 : b% pg% History_Panels6_title, b% pg% History_Panels6_txt_scale, ierr)
346 0 : if (ierr /= 0) return
347 0 : call pgebuf()
348 : end subroutine History_Panels6_plot
349 :
350 :
351 0 : subroutine do_History_Panels6_plot(b, id, device_id, &
352 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
353 : type (binary_info), pointer :: b
354 : integer, intent(in) :: id, device_id
355 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
356 : logical, intent(in) :: subplot
357 : character (len = *), intent(in) :: title
358 : integer, intent(out) :: ierr
359 : call do_history_panels_plot(&
360 : id, b, device_id, &
361 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
362 : b% pg% History_Panels6_xaxis_name, &
363 : b% pg% History_Panels6_xmin, &
364 : b% pg% History_Panels6_xmax, &
365 : b% pg% History_Panels6_dxmin, &
366 : b% pg% History_Panels6_xmargin, &
367 : b% pg% History_Panels6_max_width, &
368 : b% pg% History_Panels6_num_panels, &
369 : b% pg% History_Panels6_other_ymin, &
370 : b% pg% History_Panels6_other_ymax, &
371 : b% pg% History_Panels6_yaxis_reversed, &
372 : b% pg% History_Panels6_other_yaxis_log, &
373 : b% pg% History_Panels6_other_dymin, &
374 : b% pg% History_Panels6_points_name, &
375 : b% pg% History_Panels6_other_ymargin, &
376 : b% pg% History_Panels6_other_yaxis_name, &
377 : b% pg% History_Panels6_ymin, &
378 : b% pg% History_Panels6_ymax, &
379 : b% pg% History_Panels6_xaxis_reversed, &
380 : b% pg% History_Panels6_yaxis_reversed, &
381 : b% pg% History_Panels6_xaxis_log, &
382 : b% pg% History_Panels6_yaxis_log, &
383 : b% pg% History_Panels6_dymin, &
384 : b% pg% History_Panels6_ymargin, &
385 : b% pg% History_Panels6_yaxis_name, &
386 : b% pg% History_Panels6_use_decorator, &
387 : b% pg% History_Panels6_pgbinary_decorator, &
388 0 : ierr)
389 0 : end subroutine do_History_Panels6_plot
390 :
391 :
392 0 : subroutine History_Panels7_plot(id, device_id, ierr)
393 : integer, intent(in) :: id, device_id
394 : integer, intent(out) :: ierr
395 : type (binary_info), pointer :: b
396 : ierr = 0
397 0 : call get_binary_ptr(id, b, ierr)
398 0 : if (ierr /= 0) return
399 0 : call pgslct(device_id)
400 0 : call pgbbuf()
401 0 : call pgeras()
402 : call do_History_Panels7_plot(b, id, device_id, &
403 : b% pg% History_Panels7_xleft, b% pg% History_Panels7_xright, &
404 : b% pg% History_Panels7_ybot, b% pg% History_Panels7_ytop, .false., &
405 0 : b% pg% History_Panels7_title, b% pg% History_Panels7_txt_scale, ierr)
406 0 : if (ierr /= 0) return
407 0 : call pgebuf()
408 : end subroutine History_Panels7_plot
409 :
410 :
411 0 : subroutine do_History_Panels7_plot(b, id, device_id, &
412 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
413 : type (binary_info), pointer :: b
414 : integer, intent(in) :: id, device_id
415 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
416 : logical, intent(in) :: subplot
417 : character (len = *), intent(in) :: title
418 : integer, intent(out) :: ierr
419 : call do_history_panels_plot(&
420 : id, b, device_id, &
421 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
422 : b% pg% History_Panels7_xaxis_name, &
423 : b% pg% History_Panels7_xmin, &
424 : b% pg% History_Panels7_xmax, &
425 : b% pg% History_Panels7_dxmin, &
426 : b% pg% History_Panels7_xmargin, &
427 : b% pg% History_Panels7_max_width, &
428 : b% pg% History_Panels7_num_panels, &
429 : b% pg% History_Panels7_other_ymin, &
430 : b% pg% History_Panels7_other_ymax, &
431 : b% pg% History_Panels7_yaxis_reversed, &
432 : b% pg% History_Panels7_other_yaxis_log, &
433 : b% pg% History_Panels7_other_dymin, &
434 : b% pg% History_Panels7_points_name, &
435 : b% pg% History_Panels7_other_ymargin, &
436 : b% pg% History_Panels7_other_yaxis_name, &
437 : b% pg% History_Panels7_ymin, &
438 : b% pg% History_Panels7_ymax, &
439 : b% pg% History_Panels7_xaxis_reversed, &
440 : b% pg% History_Panels7_yaxis_reversed, &
441 : b% pg% History_Panels7_xaxis_log, &
442 : b% pg% History_Panels7_yaxis_log, &
443 : b% pg% History_Panels7_dymin, &
444 : b% pg% History_Panels7_ymargin, &
445 : b% pg% History_Panels7_yaxis_name, &
446 : b% pg% History_Panels7_use_decorator, &
447 : b% pg% History_Panels7_pgbinary_decorator, &
448 0 : ierr)
449 0 : end subroutine do_History_Panels7_plot
450 :
451 :
452 0 : subroutine History_Panels8_plot(id, device_id, ierr)
453 : integer, intent(in) :: id, device_id
454 : integer, intent(out) :: ierr
455 : type (binary_info), pointer :: b
456 : ierr = 0
457 0 : call get_binary_ptr(id, b, ierr)
458 0 : if (ierr /= 0) return
459 0 : call pgslct(device_id)
460 0 : call pgbbuf()
461 0 : call pgeras()
462 : call do_History_Panels8_plot(b, id, device_id, &
463 : b% pg% History_Panels8_xleft, b% pg% History_Panels8_xright, &
464 : b% pg% History_Panels8_ybot, b% pg% History_Panels8_ytop, .false., &
465 0 : b% pg% History_Panels8_title, b% pg% History_Panels8_txt_scale, ierr)
466 0 : if (ierr /= 0) return
467 0 : call pgebuf()
468 : end subroutine History_Panels8_plot
469 :
470 :
471 0 : subroutine do_History_Panels8_plot(b, id, device_id, &
472 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
473 : type (binary_info), pointer :: b
474 : integer, intent(in) :: id, device_id
475 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
476 : logical, intent(in) :: subplot
477 : character (len = *), intent(in) :: title
478 : integer, intent(out) :: ierr
479 : call do_history_panels_plot(&
480 : id, b, device_id, &
481 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
482 : b% pg% History_Panels8_xaxis_name, &
483 : b% pg% History_Panels8_xmin, &
484 : b% pg% History_Panels8_xmax, &
485 : b% pg% History_Panels8_dxmin, &
486 : b% pg% History_Panels8_xmargin, &
487 : b% pg% History_Panels8_max_width, &
488 : b% pg% History_Panels8_num_panels, &
489 : b% pg% History_Panels8_other_ymin, &
490 : b% pg% History_Panels8_other_ymax, &
491 : b% pg% History_Panels8_yaxis_reversed, &
492 : b% pg% History_Panels8_other_yaxis_log, &
493 : b% pg% History_Panels8_other_dymin, &
494 : b% pg% History_Panels8_points_name, &
495 : b% pg% History_Panels8_other_ymargin, &
496 : b% pg% History_Panels8_other_yaxis_name, &
497 : b% pg% History_Panels8_ymin, &
498 : b% pg% History_Panels8_ymax, &
499 : b% pg% History_Panels8_xaxis_reversed, &
500 : b% pg% History_Panels8_yaxis_reversed, &
501 : b% pg% History_Panels8_xaxis_log, &
502 : b% pg% History_Panels8_yaxis_log, &
503 : b% pg% History_Panels8_dymin, &
504 : b% pg% History_Panels8_ymargin, &
505 : b% pg% History_Panels8_yaxis_name, &
506 : b% pg% History_Panels8_use_decorator, &
507 : b% pg% History_Panels8_pgbinary_decorator, &
508 0 : ierr)
509 0 : end subroutine do_History_Panels8_plot
510 :
511 :
512 0 : subroutine History_Panels9_plot(id, device_id, ierr)
513 : integer, intent(in) :: id, device_id
514 : integer, intent(out) :: ierr
515 : type (binary_info), pointer :: b
516 : ierr = 0
517 0 : call get_binary_ptr(id, b, ierr)
518 0 : if (ierr /= 0) return
519 0 : call pgslct(device_id)
520 0 : call pgbbuf()
521 0 : call pgeras()
522 : call do_History_Panels9_plot(b, id, device_id, &
523 : b% pg% History_Panels9_xleft, b% pg% History_Panels9_xright, &
524 : b% pg% History_Panels9_ybot, b% pg% History_Panels9_ytop, .false., &
525 0 : b% pg% History_Panels9_title, b% pg% History_Panels9_txt_scale, ierr)
526 0 : if (ierr /= 0) return
527 0 : call pgebuf()
528 : end subroutine History_Panels9_plot
529 :
530 :
531 0 : subroutine do_History_Panels9_plot(b, id, device_id, &
532 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
533 : type (binary_info), pointer :: b
534 : integer, intent(in) :: id, device_id
535 : real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
536 : logical, intent(in) :: subplot
537 : character (len = *), intent(in) :: title
538 : integer, intent(out) :: ierr
539 : call do_history_panels_plot(&
540 : id, b, device_id, &
541 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
542 : b% pg% History_Panels9_xaxis_name, &
543 : b% pg% History_Panels9_xmin, &
544 : b% pg% History_Panels9_xmax, &
545 : b% pg% History_Panels9_dxmin, &
546 : b% pg% History_Panels9_xmargin, &
547 : b% pg% History_Panels9_max_width, &
548 : b% pg% History_Panels9_num_panels, &
549 : b% pg% History_Panels9_other_ymin, &
550 : b% pg% History_Panels9_other_ymax, &
551 : b% pg% History_Panels9_other_yaxis_reversed, &
552 : b% pg% History_Panels9_other_yaxis_log, &
553 : b% pg% History_Panels9_other_dymin, &
554 : b% pg% History_Panels9_points_name, &
555 : b% pg% History_Panels9_other_ymargin, &
556 : b% pg% History_Panels9_other_yaxis_name, &
557 : b% pg% History_Panels9_ymin, &
558 : b% pg% History_Panels9_ymax, &
559 : b% pg% History_Panels9_xaxis_reversed, &
560 : b% pg% History_Panels9_yaxis_reversed, &
561 : b% pg% History_Panels9_xaxis_log, &
562 : b% pg% History_Panels9_yaxis_log, &
563 : b% pg% History_Panels9_dymin, &
564 : b% pg% History_Panels9_ymargin, &
565 : b% pg% History_Panels9_yaxis_name, &
566 : b% pg% History_Panels9_use_decorator, &
567 : b% pg% History_Panels9_pgbinary_decorator, &
568 0 : ierr)
569 0 : end subroutine do_History_Panels9_plot
570 :
571 :
572 0 : subroutine do_history_panels_plot(&
573 : id, b, device_id, &
574 : vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
575 : hist_xaxis_name, hist_xmin_in, hist_xmax, dxmin, hist_xmargin, &
576 : hist_max_width, hist_num_panels, &
577 0 : hist_other_ymin, hist_other_ymax, &
578 0 : hist_other_yaxis_reversed, hist_other_yaxis_log, &
579 0 : hist_other_dymin, hist_points_name, &
580 0 : hist_other_ymargin, hist_other_yaxis_name, &
581 0 : hist_ymin, hist_ymax, &
582 0 : hist_xaxis_reversed, hist_yaxis_reversed, &
583 0 : hist_xaxis_log, hist_yaxis_log, &
584 0 : hist_dymin, hist_ymargin, hist_yaxis_name, &
585 : use_decorator, pgbinary_decorator, &
586 : ierr)
587 :
588 : use utils_lib
589 : use pgstar_support, only : set_xleft_xright, set_ytop_ybot
590 : use pgstar_colors
591 :
592 : type (binary_info), pointer :: b
593 : integer, intent(in) :: id, device_id, hist_num_panels
594 : logical, intent(in) :: subplot, hist_xaxis_reversed, hist_xaxis_log
595 : character (len = *), intent(in) :: title, hist_xaxis_name
596 : real, intent(in) :: &
597 : vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale, &
598 : hist_xmin_in, hist_xmax, hist_max_width, hist_xmargin, dxmin
599 : real, intent(in), dimension(:) :: &
600 : hist_other_ymin, hist_other_ymax, &
601 : hist_other_dymin, hist_other_ymargin, &
602 : hist_ymin, hist_ymax, hist_dymin, hist_ymargin
603 : logical, intent(in), dimension(:) :: &
604 : hist_other_yaxis_reversed, hist_other_yaxis_log, &
605 : hist_yaxis_reversed, hist_yaxis_log
606 : logical, intent(in) :: use_decorator
607 : character (len = *), intent(in), dimension(:) :: &
608 : hist_points_name, hist_other_yaxis_name, hist_yaxis_name
609 : integer, intent(out) :: ierr
610 : procedure(pgbinary_decorator_interface), pointer :: pgbinary_decorator
611 :
612 : character (len = strlen) :: yname, other_yname
613 0 : real, pointer, dimension(:) :: xvec, yvec, other_yvec
614 0 : real, pointer, dimension(:) :: yfile_xdata, other_yfile_xdata
615 0 : real, pointer, dimension(:) :: yfile_ydata, other_yfile_ydata
616 : integer :: i, ii, n, j, k, max_width, step_min, step_max, &
617 : y_color, other_y_color, &
618 : yfile_data_len, other_yfile_data_len
619 0 : real :: hist_xmin, xleft, xright, &
620 0 : ymargin, panel_dy, panel_ytop, panel_ybot, &
621 0 : ybot, ytop, xpt, ypt, errpt, &
622 0 : other_ybot, other_ytop
623 : logical :: have_yaxis, have_other_yaxis
624 :
625 : integer :: ix, iounit, ishape, num_pts
626 :
627 : include 'formats'
628 :
629 : ierr = 0
630 :
631 0 : call integer_dict_lookup(b% binary_history_names_dict, hist_xaxis_name, ix, ierr)
632 0 : if (ierr /= 0) ix = -1
633 0 : if (ix <= 0) then
634 0 : write(*, *)
635 : write(*, *) 'ERROR: failed to find ' // &
636 0 : trim(hist_xaxis_name) // ' in history data'
637 0 : write(*, *)
638 0 : ierr = -1
639 : end if
640 :
641 0 : hist_xmin = hist_xmin_in
642 :
643 0 : if (hist_xaxis_name == 'model_number') then
644 0 : max_width = int(hist_max_width)
645 0 : step_min = int(hist_xmin)
646 0 : if (step_min <= 0) step_min = 1
647 0 : step_max = int(hist_xmax)
648 0 : if (step_max <= 0) step_max = b% model_number
649 0 : if (step_min >= b% model_number) step_min = 1
650 0 : if (max_width > 0) step_min = max(step_min, step_max - max_width)
651 : else
652 0 : step_min = 1
653 0 : step_max = b% model_number
654 : end if
655 :
656 0 : n = count_hist_points(b, step_min, step_max)
657 0 : allocate(xvec(n), yvec(n), other_yvec(n), stat = ierr)
658 0 : if (ierr /= 0) then
659 0 : write(*, *) 'allocate failed for PGBINARY'
660 0 : return
661 : end if
662 :
663 0 : call get_hist_points(b, step_min, step_max, n, ix, xvec)
664 :
665 0 : if (hist_xaxis_log) then
666 0 : do k = 1, n
667 0 : xvec(k) = log10(max(tiny(xvec(k)), abs(xvec(k))))
668 : end do
669 : end if
670 :
671 0 : if (hist_max_width > 0d0 .and. hist_xaxis_name /= 'model_number') then
672 0 : ii = n
673 0 : do i = ii, 1, -1
674 0 : if (xvec(ii) - xvec(i) > hist_max_width) then
675 0 : do j = i, ii
676 0 : xvec(j - i + 1) = xvec(j)
677 : end do
678 0 : n = n - i + 1
679 0 : hist_xmin = xvec(n) - hist_max_width
680 0 : exit
681 : end if
682 : end do
683 : end if
684 :
685 : call set_xleft_xright(&
686 : n, xvec, hist_xmin, hist_xmax, hist_xmargin, &
687 0 : hist_xaxis_reversed, dxmin, xleft, xright)
688 :
689 0 : call pgsave
690 0 : call pgsch(txt_scale)
691 :
692 0 : ymargin = 0.05
693 0 : y_color = clr_Goldenrod
694 0 : other_y_color = clr_LightSkyBlue
695 :
696 0 : panel_dy = (vp_ytop - vp_ybot) / real(hist_num_panels)
697 :
698 0 : do j = 1, hist_num_panels
699 :
700 0 : yfile_data_len = 0
701 0 : other_yfile_data_len = 0
702 :
703 0 : yname = hist_yaxis_name(j)
704 0 : if (len_trim(yname) == 0) then
705 : have_yaxis = .false.
706 : else
707 0 : have_yaxis = get1_yvec(yname, yvec)
708 0 : if (.not. have_yaxis) then
709 0 : if (.not. read_values_from_file(yname, &
710 : yfile_xdata, yfile_ydata, yfile_data_len)) then
711 : write(*, *) &
712 0 : 'bad yaxis for History panels plot ' // trim(yname)
713 0 : cycle
714 : end if
715 : have_yaxis = .true.
716 : end if
717 : end if
718 :
719 0 : other_yname = hist_other_yaxis_name(j)
720 0 : if (len_trim(hist_other_yaxis_name(j)) == 0) then
721 : have_other_yaxis = .false.
722 : else
723 0 : have_other_yaxis = get1_yvec(other_yname, other_yvec)
724 0 : if (.not. have_other_yaxis) then
725 0 : if (.not. read_values_from_file(other_yname, &
726 : other_yfile_xdata, other_yfile_ydata, other_yfile_data_len)) then
727 : write(*, *) &
728 0 : 'bad other yaxis for History panels plot ' // trim(other_yname)
729 0 : cycle
730 : end if
731 : have_other_yaxis = .true.
732 : end if
733 : end if
734 :
735 0 : if ((.not. have_yaxis) .and. (.not. have_other_yaxis)) cycle
736 :
737 0 : panel_ytop = vp_ytop - real(j - 1) * panel_dy
738 0 : panel_ybot = panel_ytop - panel_dy
739 :
740 0 : call pgsvp(vp_xleft, vp_xright, panel_ybot, panel_ytop)
741 :
742 0 : if (j == 1) then
743 0 : if (.not. subplot) then
744 0 : call show_model_number_pgbinary(b)
745 0 : call show_age_pgbinary(b)
746 : end if
747 0 : call show_title_pgbinary(b, title)
748 : end if
749 :
750 0 : if (have_other_yaxis) then
751 0 : if (other_yfile_data_len > 0) then
752 0 : if (hist_other_yaxis_log(j)) then
753 0 : do k = 1, other_yfile_data_len
754 : other_yfile_ydata(k) = &
755 0 : log10(max(tiny(other_yfile_ydata(k)), abs(other_yfile_ydata(k))))
756 : end do
757 : end if
758 : call set_ytop_ybot(&
759 : other_yfile_data_len, other_yfile_ydata, &
760 : hist_other_ymin(j), hist_other_ymax(j), -101.0, &
761 : hist_other_ymargin(j), hist_other_yaxis_reversed(j), &
762 0 : hist_other_dymin(j), other_ybot, other_ytop)
763 : else
764 0 : if (hist_other_yaxis_log(j)) then
765 0 : do k = 1, n
766 0 : other_yvec(k) = log10(max(tiny(other_yvec(k)), abs(other_yvec(k))))
767 : end do
768 : end if
769 : call set_ytop_ybot(&
770 : n, other_yvec, hist_other_ymin(j), hist_other_ymax(j), -101.0, &
771 : hist_other_ymargin(j), hist_other_yaxis_reversed(j), &
772 0 : hist_other_dymin(j), other_ybot, other_ytop)
773 : end if
774 : !write(*,1) trim(other_yname), other_ybot, other_ytop
775 0 : call pgswin(xleft, xright, other_ybot, other_ytop)
776 0 : call pgscf(1)
777 0 : call pgsci(clr_Foreground)
778 0 : call show_box_pgbinary(b, '', 'CMSTV')
779 0 : call pgsci(other_y_color)
780 0 : if (hist_other_yaxis_log(j)) then
781 0 : call show_right_yaxis_label_pgbinary(b, 'log ' // other_yname)
782 : else
783 0 : call show_right_yaxis_label_pgbinary(b, other_yname)
784 : end if
785 0 : call pgslw(b% pg% pgbinary_lw)
786 0 : if (other_yfile_data_len > 0) then
787 : call pgline(&
788 0 : other_yfile_data_len, other_yfile_xdata, other_yfile_ydata)
789 0 : deallocate(other_yfile_xdata, other_yfile_ydata)
790 0 : nullify(other_yfile_xdata, other_yfile_ydata)
791 : else
792 0 : call pgline(n, xvec, other_yvec)
793 : end if
794 0 : call pgslw(1)
795 : end if
796 :
797 0 : if (have_yaxis) then
798 0 : if (yfile_data_len > 0) then
799 0 : if (hist_yaxis_log(j)) then
800 0 : do k = 1, yfile_data_len
801 0 : yfile_ydata(k) = log10(max(tiny(yfile_ydata(k)), abs(yfile_ydata(k))))
802 : end do
803 : end if
804 : call set_ytop_ybot(&
805 : yfile_data_len, yfile_ydata, hist_ymin(j), hist_ymax(j), -101.0, &
806 : hist_ymargin(j), hist_yaxis_reversed(j), &
807 0 : hist_dymin(j), ybot, ytop)
808 : else
809 0 : if (hist_yaxis_log(j)) then
810 0 : do k = 1, n
811 0 : yvec(k) = log10(max(tiny(yvec(k)), abs(yvec(k))))
812 : end do
813 : end if
814 : call set_ytop_ybot(&
815 : n, yvec, hist_ymin(j), hist_ymax(j), -101.0, &
816 : hist_ymargin(j), hist_yaxis_reversed(j), &
817 0 : hist_dymin(j), ybot, ytop)
818 : end if
819 : !write(*,1) trim(yname), ybot, ytop
820 0 : call pgswin(xleft, xright, ybot, ytop)
821 0 : call pgscf(1)
822 0 : call pgsci(clr_Foreground)
823 0 : if (j < hist_num_panels) then
824 0 : if (.not. have_other_yaxis) then
825 0 : call show_box_pgbinary(b, 'BCST1', 'BCMNSTV1')
826 : else
827 0 : call show_box_pgbinary(b, 'BCST', 'BNSTV')
828 : end if
829 : else
830 0 : if (.not. have_other_yaxis) then
831 0 : call show_box_pgbinary(b, 'BCNST1', 'BCMNSTV1')
832 : else
833 0 : call show_box_pgbinary(b, 'BCNST', 'BNSTV')
834 : end if
835 : end if
836 :
837 0 : if (len_trim(hist_points_name(j)) > 0) then
838 0 : iounit = 33
839 : open(unit = iounit, file = trim(hist_points_name(j)), &
840 0 : status = 'old', action = 'read', iostat = ierr)
841 0 : if (ierr /= 0) then
842 0 : write(*, '(a)') 'failed to open ' // trim(hist_points_name(j))
843 0 : return
844 : end if
845 0 : read(iounit, *) num_pts
846 0 : ishape = b% pg% History_Panel_points_marker ! 5
847 0 : call pgsave
848 0 : call pgsci(b% pg% History_Panel_points_ci) !1)
849 0 : call pgslw(b% pg% History_Panel_points_lw) !2)
850 0 : call pgsch(b% pg% History_Panel_points_ch) !1.0)
851 0 : do k = 1, num_pts
852 0 : if (b% pg% History_Panel_points_error_bars) then
853 0 : read(iounit, *) xpt, ypt, errpt
854 : else
855 0 : read(iounit, *) xpt, ypt
856 : end if
857 0 : if (mod(k - 1, b% pg% History_Panel_points_interval) == 0) then
858 0 : if (b% pg% History_Panel_points_error_bars) then
859 0 : call pgmove(xpt, ypt + errpt)
860 0 : call pgdraw(xpt, ypt - errpt)
861 : else
862 0 : call pgpt1(xpt, ypt, ishape)
863 : end if
864 : end if
865 : end do
866 0 : close(iounit)
867 0 : call pgunsa
868 : end if
869 :
870 0 : call pgsci(y_color)
871 0 : if (hist_yaxis_log(j)) then
872 0 : call show_left_yaxis_label_pgbinary(b, 'log ' // yname)
873 : else
874 0 : call show_left_yaxis_label_pgbinary(b, yname)
875 : end if
876 0 : call pgslw(b% pg% pgbinary_lw)
877 0 : if (yfile_data_len > 0) then
878 0 : call pgline(yfile_data_len, yfile_xdata, yfile_ydata)
879 0 : deallocate(yfile_xdata, yfile_ydata)
880 0 : nullify(yfile_xdata, yfile_ydata)
881 : else
882 0 : call pgline(n, xvec, yvec)
883 : end if
884 0 : call pgslw(1)
885 : end if
886 :
887 0 : call pgsci(clr_Foreground)
888 0 : call show_pgbinary_decorator(b% binary_id, use_decorator, pgbinary_decorator, j, ierr)
889 : end do
890 :
891 0 : if (hist_xaxis_log) then
892 0 : call show_xaxis_label_pgbinary(b, 'log ' // hist_xaxis_name)
893 : else
894 0 : call show_xaxis_label_pgbinary(b, hist_xaxis_name)
895 : end if
896 :
897 0 : deallocate(xvec, yvec, other_yvec)
898 :
899 0 : call pgunsa
900 :
901 : contains
902 :
903 :
904 0 : logical function get1_yvec(name, vec)
905 : character (len = *) :: name
906 : real, dimension(:), pointer :: vec
907 0 : get1_yvec = get1_hist_yvec(b, step_min, step_max, n, name, vec)
908 0 : end function get1_yvec
909 :
910 :
911 : end subroutine do_history_panels_plot
912 :
913 :
914 : end module pgbinary_history_panels
915 :
|