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