LCOV - code coverage report
Current view: top level - star/private - pgstar_profile_panels.f90 (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 364 0
Test Date: 2025-06-06 17:08:43 Functions: 0.0 % 19 0

            Line data    Source code
       1              : ! ***********************************************************************
       2              : !
       3              : !   Copyright (C) 2013-2019  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_profile_panels
      21              : 
      22              :       use star_private_def
      23              :       use const_def, only: dp, rsun
      24              :       use pgstar_support
      25              :       use pgstar_trho_profile
      26              :       use star_pgstar
      27              : 
      28              :       implicit none
      29              : 
      30              :       contains
      31              : 
      32            0 :       subroutine Profile_Panels1_plot(id, device_id, ierr)
      33              :          integer, intent(in) :: id, device_id
      34              :          integer, intent(out) :: ierr
      35              :          type (star_info), pointer :: s
      36              :          ierr = 0
      37            0 :          call get_star_ptr(id, s, ierr)
      38            0 :          if (ierr /= 0) return
      39            0 :          call pgslct(device_id)
      40            0 :          call pgbbuf()
      41            0 :          call pgeras()
      42              :          call do_profile_panels1_plot(s, id, device_id, &
      43              :             s% pg% Profile_Panels1_xleft, s% pg% Profile_Panels1_xright, &
      44              :             s% pg% Profile_Panels1_ybot, s% pg% Profile_Panels1_ytop, .false., &
      45            0 :             s% pg% Profile_Panels1_title, s% pg% Profile_Panels1_txt_scale, ierr)
      46            0 :          if (ierr /= 0) return
      47            0 :          call pgebuf()
      48              :       end subroutine Profile_Panels1_plot
      49              : 
      50              : 
      51            0 :       subroutine do_profile_panels1_plot(s, id, device_id, &
      52              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
      53              :          type (star_info), pointer :: s
      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 Pro_panels_plot(s, device_id, &
      60              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
      61              :             s% pg% Profile_Panels1_xaxis_reversed, &
      62              :             s% pg% Profile_Panels1_yaxis_reversed, &
      63              :             s% pg% Profile_Panels1_other_yaxis_reversed, &
      64              :             s% pg% Profile_Panels1_yaxis_log, &
      65              :             s% pg% Profile_Panels1_other_yaxis_log, &
      66              :             s% pg% Profile_Panels1_same_yaxis_range, &
      67              :             s% pg% Profile_Panels1_xaxis_name, &
      68              :             s% pg% Profile_Panels1_yaxis_name, &
      69              :             s% pg% Profile_Panels1_other_yaxis_name, &
      70              :             s% pg% Profile_Panels1_xmin, s% pg% Profile_Panels1_xmax, &
      71              :             s% pg% Profile_Panels1_xmargin, s% pg% Profile_Panels1_show_mix_regions_on_xaxis, &
      72              :             s% pg% Profile_Panels1_ymin, s% pg% Profile_Panels1_other_ymin, &
      73              :             s% pg% Profile_Panels1_ymax, s% pg% Profile_Panels1_other_ymax, &
      74              :             s% pg% Profile_Panels1_ycenter, s% pg% Profile_Panels1_other_ycenter, &
      75              :             s% pg% Profile_Panels1_ymargin, s% pg% Profile_Panels1_other_ymargin, &
      76              :             s% pg% Profile_Panels1_dymin, s% pg% Profile_Panels1_other_dymin, &
      77              :             s% pg% Profile_Panels1_show_grid, &
      78              :             s% pg% Profile_Panels1_num_panels, &
      79              :             s% pg% Profile_Panels1_use_decorator, &
      80              :             s% pg% Profile_Panels1_pgstar_decorator, &
      81              :             1, &
      82            0 :             ierr)
      83            0 :       end subroutine do_profile_panels1_plot
      84              : 
      85              : 
      86            0 :       subroutine Profile_Panels2_plot(id, device_id, ierr)
      87              :          integer, intent(in) :: id, device_id
      88              :          integer, intent(out) :: ierr
      89              :          type (star_info), pointer :: s
      90              :          ierr = 0
      91            0 :          call get_star_ptr(id, s, ierr)
      92            0 :          if (ierr /= 0) return
      93            0 :          call pgslct(device_id)
      94            0 :          call pgbbuf()
      95            0 :          call pgeras()
      96              :          call do_profile_Panels2_plot(s, id, device_id, &
      97              :             s% pg% Profile_Panels2_xleft, s% pg% Profile_Panels2_xright, &
      98              :             s% pg% Profile_Panels2_ybot, s% pg% Profile_Panels2_ytop, .false., &
      99            0 :             s% pg% Profile_Panels2_title, s% pg% Profile_Panels2_txt_scale, ierr)
     100            0 :          if (ierr /= 0) return
     101            0 :          call pgebuf()
     102              :       end subroutine Profile_Panels2_plot
     103              : 
     104              : 
     105            0 :       subroutine do_profile_Panels2_plot(s, id, device_id, &
     106              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
     107              :          type (star_info), pointer :: s
     108              :          integer, intent(in) :: id, device_id
     109              :          real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
     110              :          logical, intent(in) :: subplot
     111              :          character (len=*), intent(in) :: title
     112              :          integer, intent(out) :: ierr
     113              :          call Pro_panels_plot(s, device_id, &
     114              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
     115              :             s% pg% Profile_Panels2_xaxis_reversed, &
     116              :             s% pg% Profile_Panels2_yaxis_reversed, &
     117              :             s% pg% Profile_Panels2_other_yaxis_reversed, &
     118              :             s% pg% Profile_Panels2_yaxis_log, &
     119              :             s% pg% Profile_Panels2_other_yaxis_log, &
     120              :             s% pg% Profile_Panels2_same_yaxis_range, &
     121              :             s% pg% Profile_Panels2_xaxis_name, &
     122              :             s% pg% Profile_Panels2_yaxis_name, &
     123              :             s% pg% Profile_Panels2_other_yaxis_name, &
     124              :             s% pg% Profile_Panels2_xmin, s% pg% Profile_Panels2_xmax, &
     125              :             s% pg% Profile_Panels2_xmargin, s% pg% Profile_Panels2_show_mix_regions_on_xaxis, &
     126              :             s% pg% Profile_Panels2_ymin, s% pg% Profile_Panels2_other_ymin, &
     127              :             s% pg% Profile_Panels2_ymax, s% pg% Profile_Panels2_other_ymax, &
     128              :             s% pg% Profile_Panels2_ycenter, s% pg% Profile_Panels2_other_ycenter, &
     129              :             s% pg% Profile_Panels2_ymargin, s% pg% Profile_Panels2_other_ymargin, &
     130              :             s% pg% Profile_Panels2_dymin, s% pg% Profile_Panels2_other_dymin, &
     131              :             s% pg% Profile_Panels2_show_grid, &
     132              :             s% pg% Profile_Panels2_num_panels, &
     133              :             s% pg% Profile_Panels2_use_decorator, &
     134              :             s% pg% Profile_Panels2_pgstar_decorator, &
     135              :             2, &
     136            0 :             ierr)
     137            0 :       end subroutine do_profile_Panels2_plot
     138              : 
     139              : 
     140            0 :       subroutine Profile_Panels3_plot(id, device_id, ierr)
     141              :          integer, intent(in) :: id, device_id
     142              :          integer, intent(out) :: ierr
     143              :          type (star_info), pointer :: s
     144              :          ierr = 0
     145            0 :          call get_star_ptr(id, s, ierr)
     146            0 :          if (ierr /= 0) return
     147            0 :          call pgslct(device_id)
     148            0 :          call pgbbuf()
     149            0 :          call pgeras()
     150              :          call do_profile_Panels3_plot(s, id, device_id, &
     151              :             s% pg% Profile_Panels3_xleft, s% pg% Profile_Panels3_xright, &
     152              :             s% pg% Profile_Panels3_ybot, s% pg% Profile_Panels3_ytop, .false., &
     153            0 :             s% pg% Profile_Panels3_title, s% pg% Profile_Panels3_txt_scale, ierr)
     154            0 :          if (ierr /= 0) return
     155            0 :          call pgebuf()
     156              :       end subroutine Profile_Panels3_plot
     157              : 
     158              : 
     159            0 :       subroutine do_profile_Panels3_plot(s, id, device_id, &
     160              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
     161              :          type (star_info), pointer :: s
     162              :          integer, intent(in) :: id, device_id
     163              :          real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
     164              :          logical, intent(in) :: subplot
     165              :          character (len=*), intent(in) :: title
     166              :          integer, intent(out) :: ierr
     167              :          call Pro_panels_plot(s, device_id, &
     168              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
     169              :             s% pg% Profile_Panels3_xaxis_reversed, &
     170              :             s% pg% Profile_Panels3_yaxis_reversed, &
     171              :             s% pg% Profile_Panels3_other_yaxis_reversed, &
     172              :             s% pg% Profile_Panels3_yaxis_log, &
     173              :             s% pg% Profile_Panels3_other_yaxis_log, &
     174              :             s% pg% Profile_Panels3_same_yaxis_range, &
     175              :             s% pg% Profile_Panels3_xaxis_name, &
     176              :             s% pg% Profile_Panels3_yaxis_name, &
     177              :             s% pg% Profile_Panels3_other_yaxis_name, &
     178              :             s% pg% Profile_Panels3_xmin, s% pg% Profile_Panels3_xmax, &
     179              :             s% pg% Profile_Panels3_xmargin, s% pg% Profile_Panels3_show_mix_regions_on_xaxis, &
     180              :             s% pg% Profile_Panels3_ymin, s% pg% Profile_Panels3_other_ymin, &
     181              :             s% pg% Profile_Panels3_ymax, s% pg% Profile_Panels3_other_ymax, &
     182              :             s% pg% Profile_Panels3_ycenter, s% pg% Profile_Panels3_other_ycenter, &
     183              :             s% pg% Profile_Panels3_ymargin, s% pg% Profile_Panels3_other_ymargin, &
     184              :             s% pg% Profile_Panels3_dymin, s% pg% Profile_Panels3_other_dymin, &
     185              :             s% pg% Profile_Panels3_show_grid, &
     186              :             s% pg% Profile_Panels3_num_panels, &
     187              :             s% pg% Profile_Panels3_use_decorator, &
     188              :             s% pg% Profile_Panels3_pgstar_decorator, &
     189              :             3, &
     190            0 :             ierr)
     191            0 :       end subroutine do_profile_Panels3_plot
     192              : 
     193              : 
     194            0 :       subroutine Profile_Panels4_plot(id, device_id, ierr)
     195              :          integer, intent(in) :: id, device_id
     196              :          integer, intent(out) :: ierr
     197              :          type (star_info), pointer :: s
     198              :          ierr = 0
     199            0 :          call get_star_ptr(id, s, ierr)
     200            0 :          if (ierr /= 0) return
     201            0 :          call pgslct(device_id)
     202            0 :          call pgbbuf()
     203            0 :          call pgeras()
     204              :          call do_profile_Panels4_plot(s, id, device_id, &
     205              :             s% pg% Profile_Panels4_xleft, s% pg% Profile_Panels4_xright, &
     206              :             s% pg% Profile_Panels4_ybot, s% pg% Profile_Panels4_ytop, .false., &
     207            0 :             s% pg% Profile_Panels4_title, s% pg% Profile_Panels4_txt_scale, ierr)
     208            0 :          if (ierr /= 0) return
     209            0 :          call pgebuf()
     210              :       end subroutine Profile_Panels4_plot
     211              : 
     212              : 
     213            0 :       subroutine do_Profile_Panels4_plot(s, id, device_id, &
     214              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
     215              :          type (star_info), pointer :: s
     216              :          integer, intent(in) :: id, device_id
     217              :          real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
     218              :          logical, intent(in) :: subplot
     219              :          character (len=*), intent(in) :: title
     220              :          integer, intent(out) :: ierr
     221              :          call Pro_panels_plot(s, device_id, &
     222              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
     223              :             s% pg% Profile_Panels4_xaxis_reversed, &
     224              :             s% pg% Profile_Panels4_yaxis_reversed, &
     225              :             s% pg% Profile_Panels4_other_yaxis_reversed, &
     226              :             s% pg% Profile_Panels4_yaxis_log, &
     227              :             s% pg% Profile_Panels4_other_yaxis_log, &
     228              :             s% pg% Profile_Panels4_same_yaxis_range, &
     229              :             s% pg% Profile_Panels4_xaxis_name, &
     230              :             s% pg% Profile_Panels4_yaxis_name, &
     231              :             s% pg% Profile_Panels4_other_yaxis_name, &
     232              :             s% pg% Profile_Panels4_xmin, s% pg% Profile_Panels4_xmax, &
     233              :             s% pg% Profile_Panels4_xmargin, s% pg% Profile_Panels4_show_mix_regions_on_xaxis, &
     234              :             s% pg% Profile_Panels4_ymin, s% pg% Profile_Panels4_other_ymin, &
     235              :             s% pg% Profile_Panels4_ymax, s% pg% Profile_Panels4_other_ymax, &
     236              :             s% pg% Profile_Panels4_ycenter, s% pg% Profile_Panels4_other_ycenter, &
     237              :             s% pg% Profile_Panels4_ymargin, s% pg% Profile_Panels4_other_ymargin, &
     238              :             s% pg% Profile_Panels4_dymin, s% pg% Profile_Panels4_other_dymin, &
     239              :             s% pg% Profile_Panels4_show_grid, &
     240              :             s% pg% Profile_Panels4_num_panels, &
     241              :             s% pg% Profile_Panels4_use_decorator, &
     242              :             s% pg% Profile_Panels4_pgstar_decorator, &
     243              :             4, &
     244            0 :             ierr)
     245            0 :       end subroutine do_profile_Panels4_plot
     246              : 
     247              : 
     248            0 :       subroutine Profile_Panels5_plot(id, device_id, ierr)
     249              :          integer, intent(in) :: id, device_id
     250              :          integer, intent(out) :: ierr
     251              :          type (star_info), pointer :: s
     252              :          ierr = 0
     253            0 :          call get_star_ptr(id, s, ierr)
     254            0 :          if (ierr /= 0) return
     255            0 :          call pgslct(device_id)
     256            0 :          call pgbbuf()
     257            0 :          call pgeras()
     258              :          call do_Profile_Panels5_plot(s, id, device_id, &
     259              :             s% pg% Profile_Panels5_xleft, s% pg% Profile_Panels5_xright, &
     260              :             s% pg% Profile_Panels5_ybot, s% pg% Profile_Panels5_ytop, .false., &
     261            0 :             s% pg% Profile_Panels5_title, s% pg% Profile_Panels5_txt_scale, ierr)
     262            0 :          if (ierr /= 0) return
     263            0 :          call pgebuf()
     264              :       end subroutine Profile_Panels5_plot
     265              : 
     266              : 
     267            0 :       subroutine do_Profile_Panels5_plot(s, id, device_id, &
     268              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
     269              :          type (star_info), pointer :: s
     270              :          integer, intent(in) :: id, device_id
     271              :          real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
     272              :          logical, intent(in) :: subplot
     273              :          character (len=*), intent(in) :: title
     274              :          integer, intent(out) :: ierr
     275              :          call Pro_panels_plot(s, device_id, &
     276              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
     277              :             s% pg% Profile_Panels5_xaxis_reversed, &
     278              :             s% pg% Profile_Panels5_yaxis_reversed, &
     279              :             s% pg% Profile_Panels5_other_yaxis_reversed, &
     280              :             s% pg% Profile_Panels5_yaxis_log, &
     281              :             s% pg% Profile_Panels5_other_yaxis_log, &
     282              :             s% pg% Profile_Panels5_same_yaxis_range, &
     283              :             s% pg% Profile_Panels5_xaxis_name, &
     284              :             s% pg% Profile_Panels5_yaxis_name, &
     285              :             s% pg% Profile_Panels5_other_yaxis_name, &
     286              :             s% pg% Profile_Panels5_xmin, s% pg% Profile_Panels5_xmax, &
     287              :             s% pg% Profile_Panels5_xmargin, s% pg% Profile_Panels5_show_mix_regions_on_xaxis, &
     288              :             s% pg% Profile_Panels5_ymin, s% pg% Profile_Panels5_other_ymin, &
     289              :             s% pg% Profile_Panels5_ymax, s% pg% Profile_Panels5_other_ymax, &
     290              :             s% pg% Profile_Panels5_ycenter, s% pg% Profile_Panels5_other_ycenter, &
     291              :             s% pg% Profile_Panels5_ymargin, s% pg% Profile_Panels5_other_ymargin, &
     292              :             s% pg% Profile_Panels5_dymin, s% pg% Profile_Panels5_other_dymin, &
     293              :             s% pg% Profile_Panels5_show_grid, &
     294              :             s% pg% Profile_Panels5_num_panels, &
     295              :             s% pg% Profile_Panels5_use_decorator, &
     296              :             s% pg% Profile_Panels5_pgstar_decorator, &
     297              :             5, &
     298            0 :             ierr)
     299            0 :       end subroutine do_Profile_Panels5_plot
     300              : 
     301              : 
     302            0 :       subroutine Profile_Panels6_plot(id, device_id, ierr)
     303              :          integer, intent(in) :: id, device_id
     304              :          integer, intent(out) :: ierr
     305              :          type (star_info), pointer :: s
     306              :          ierr = 0
     307            0 :          call get_star_ptr(id, s, ierr)
     308            0 :          if (ierr /= 0) return
     309            0 :          call pgslct(device_id)
     310            0 :          call pgbbuf()
     311            0 :          call pgeras()
     312              :          call do_Profile_Panels6_plot(s, id, device_id, &
     313              :             s% pg% Profile_Panels6_xleft, s% pg% Profile_Panels6_xright, &
     314              :             s% pg% Profile_Panels6_ybot, s% pg% Profile_Panels6_ytop, .false., &
     315            0 :             s% pg% Profile_Panels6_title, s% pg% Profile_Panels6_txt_scale, ierr)
     316            0 :          if (ierr /= 0) return
     317            0 :          call pgebuf()
     318              :       end subroutine Profile_Panels6_plot
     319              : 
     320              : 
     321            0 :       subroutine do_Profile_Panels6_plot(s, id, device_id, &
     322              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
     323              :          type (star_info), pointer :: s
     324              :          integer, intent(in) :: id, device_id
     325              :          real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
     326              :          logical, intent(in) :: subplot
     327              :          character (len=*), intent(in) :: title
     328              :          integer, intent(out) :: ierr
     329              :          call Pro_panels_plot(s, device_id, &
     330              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
     331              :             s% pg% Profile_Panels6_xaxis_reversed, &
     332              :             s% pg% Profile_Panels6_yaxis_reversed, &
     333              :             s% pg% Profile_Panels6_other_yaxis_reversed, &
     334              :             s% pg% Profile_Panels6_yaxis_log, &
     335              :             s% pg% Profile_Panels6_other_yaxis_log, &
     336              :             s% pg% Profile_Panels6_same_yaxis_range, &
     337              :             s% pg% Profile_Panels6_xaxis_name, &
     338              :             s% pg% Profile_Panels6_yaxis_name, &
     339              :             s% pg% Profile_Panels6_other_yaxis_name, &
     340              :             s% pg% Profile_Panels6_xmin, s% pg% Profile_Panels6_xmax, &
     341              :             s% pg% Profile_Panels6_xmargin, s% pg% Profile_Panels6_show_mix_regions_on_xaxis, &
     342              :             s% pg% Profile_Panels6_ymin, s% pg% Profile_Panels6_other_ymin, &
     343              :             s% pg% Profile_Panels6_ymax, s% pg% Profile_Panels6_other_ymax, &
     344              :             s% pg% Profile_Panels6_ycenter, s% pg% Profile_Panels6_other_ycenter, &
     345              :             s% pg% Profile_Panels6_ymargin, s% pg% Profile_Panels6_other_ymargin, &
     346              :             s% pg% Profile_Panels6_dymin, s% pg% Profile_Panels6_other_dymin, &
     347              :             s% pg% Profile_Panels6_show_grid, &
     348              :             s% pg% Profile_Panels6_num_panels, &
     349              :             s% pg% Profile_Panels6_use_decorator, &
     350              :             s% pg% Profile_Panels6_pgstar_decorator, &
     351              :             6, &
     352            0 :             ierr)
     353            0 :       end subroutine do_Profile_Panels6_plot
     354              : 
     355              : 
     356            0 :       subroutine Profile_Panels7_plot(id, device_id, ierr)
     357              :          integer, intent(in) :: id, device_id
     358              :          integer, intent(out) :: ierr
     359              :          type (star_info), pointer :: s
     360              :          ierr = 0
     361            0 :          call get_star_ptr(id, s, ierr)
     362            0 :          if (ierr /= 0) return
     363            0 :          call pgslct(device_id)
     364            0 :          call pgbbuf()
     365            0 :          call pgeras()
     366              :          call do_Profile_Panels7_plot(s, id, device_id, &
     367              :             s% pg% Profile_Panels7_xleft, s% pg% Profile_Panels7_xright, &
     368              :             s% pg% Profile_Panels7_ybot, s% pg% Profile_Panels7_ytop, .false., &
     369            0 :             s% pg% Profile_Panels7_title, s% pg% Profile_Panels7_txt_scale, ierr)
     370            0 :          if (ierr /= 0) return
     371            0 :          call pgebuf()
     372              :       end subroutine Profile_Panels7_plot
     373              : 
     374              : 
     375            0 :       subroutine do_Profile_Panels7_plot(s, id, device_id, &
     376              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
     377              :          type (star_info), pointer :: s
     378              :          integer, intent(in) :: id, device_id
     379              :          real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
     380              :          logical, intent(in) :: subplot
     381              :          character (len=*), intent(in) :: title
     382              :          integer, intent(out) :: ierr
     383              :          call Pro_panels_plot(s, device_id, &
     384              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
     385              :             s% pg% Profile_Panels7_xaxis_reversed, &
     386              :             s% pg% Profile_Panels7_yaxis_reversed, &
     387              :             s% pg% Profile_Panels7_other_yaxis_reversed, &
     388              :             s% pg% Profile_Panels7_yaxis_log, &
     389              :             s% pg% Profile_Panels7_other_yaxis_log, &
     390              :             s% pg% Profile_Panels7_same_yaxis_range, &
     391              :             s% pg% Profile_Panels7_xaxis_name, &
     392              :             s% pg% Profile_Panels7_yaxis_name, &
     393              :             s% pg% Profile_Panels7_other_yaxis_name, &
     394              :             s% pg% Profile_Panels7_xmin, s% pg% Profile_Panels7_xmax, &
     395              :             s% pg% Profile_Panels7_xmargin, s% pg% Profile_Panels7_show_mix_regions_on_xaxis, &
     396              :             s% pg% Profile_Panels7_ymin, s% pg% Profile_Panels7_other_ymin, &
     397              :             s% pg% Profile_Panels7_ymax, s% pg% Profile_Panels7_other_ymax, &
     398              :             s% pg% Profile_Panels7_ycenter, s% pg% Profile_Panels7_other_ycenter, &
     399              :             s% pg% Profile_Panels7_ymargin, s% pg% Profile_Panels7_other_ymargin, &
     400              :             s% pg% Profile_Panels7_dymin, s% pg% Profile_Panels7_other_dymin, &
     401              :             s% pg% Profile_Panels7_show_grid, &
     402              :             s% pg% Profile_Panels7_num_panels, &
     403              :             s% pg% Profile_Panels7_use_decorator, &
     404              :             s% pg% Profile_Panels7_pgstar_decorator, &
     405              :             7, &
     406            0 :             ierr)
     407            0 :       end subroutine do_Profile_Panels7_plot
     408              : 
     409              : 
     410            0 :       subroutine Profile_Panels8_plot(id, device_id, ierr)
     411              :          integer, intent(in) :: id, device_id
     412              :          integer, intent(out) :: ierr
     413              :          type (star_info), pointer :: s
     414              :          ierr = 0
     415            0 :          call get_star_ptr(id, s, ierr)
     416            0 :          if (ierr /= 0) return
     417            0 :          call pgslct(device_id)
     418            0 :          call pgbbuf()
     419            0 :          call pgeras()
     420              :          call do_Profile_Panels8_plot(s, id, device_id, &
     421              :             s% pg% Profile_Panels8_xleft, s% pg% Profile_Panels8_xright, &
     422              :             s% pg% Profile_Panels8_ybot, s% pg% Profile_Panels8_ytop, .false., &
     423            0 :             s% pg% Profile_Panels8_title, s% pg% Profile_Panels8_txt_scale, ierr)
     424            0 :          if (ierr /= 0) return
     425            0 :          call pgebuf()
     426              :       end subroutine Profile_Panels8_plot
     427              : 
     428              : 
     429            0 :       subroutine do_Profile_Panels8_plot(s, id, device_id, &
     430              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
     431              :          type (star_info), pointer :: s
     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 Pro_panels_plot(s, device_id, &
     438              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
     439              :             s% pg% Profile_Panels8_xaxis_reversed, &
     440              :             s% pg% Profile_Panels8_yaxis_reversed, &
     441              :             s% pg% Profile_Panels8_other_yaxis_reversed, &
     442              :             s% pg% Profile_Panels8_yaxis_log, &
     443              :             s% pg% Profile_Panels8_other_yaxis_log, &
     444              :             s% pg% Profile_Panels8_same_yaxis_range, &
     445              :             s% pg% Profile_Panels8_xaxis_name, &
     446              :             s% pg% Profile_Panels8_yaxis_name, &
     447              :             s% pg% Profile_Panels8_other_yaxis_name, &
     448              :             s% pg% Profile_Panels8_xmin, s% pg% Profile_Panels8_xmax, &
     449              :             s% pg% Profile_Panels8_xmargin, s% pg% Profile_Panels8_show_mix_regions_on_xaxis, &
     450              :             s% pg% Profile_Panels8_ymin, s% pg% Profile_Panels8_other_ymin, &
     451              :             s% pg% Profile_Panels8_ymax, s% pg% Profile_Panels8_other_ymax, &
     452              :             s% pg% Profile_Panels8_ycenter, s% pg% Profile_Panels8_other_ycenter, &
     453              :             s% pg% Profile_Panels8_ymargin, s% pg% Profile_Panels8_other_ymargin, &
     454              :             s% pg% Profile_Panels8_dymin, s% pg% Profile_Panels8_other_dymin, &
     455              :             s% pg% Profile_Panels8_show_grid, &
     456              :             s% pg% Profile_Panels8_num_panels, &
     457              :             s% pg% Profile_Panels8_use_decorator, &
     458              :             s% pg% Profile_Panels8_pgstar_decorator, &
     459              :             8, &
     460            0 :             ierr)
     461            0 :       end subroutine do_Profile_Panels8_plot
     462              : 
     463              : 
     464            0 :       subroutine Profile_Panels9_plot(id, device_id, ierr)
     465              :          integer, intent(in) :: id, device_id
     466              :          integer, intent(out) :: ierr
     467              :          type (star_info), pointer :: s
     468              :          ierr = 0
     469            0 :          call get_star_ptr(id, s, ierr)
     470            0 :          if (ierr /= 0) return
     471            0 :          call pgslct(device_id)
     472            0 :          call pgbbuf()
     473            0 :          call pgeras()
     474              :          call do_Profile_Panels9_plot(s, id, device_id, &
     475              :             s% pg% Profile_Panels9_xleft, s% pg% Profile_Panels9_xright, &
     476              :             s% pg% Profile_Panels9_ybot, s% pg% Profile_Panels9_ytop, .false., &
     477            0 :             s% pg% Profile_Panels9_title, s% pg% Profile_Panels9_txt_scale, ierr)
     478            0 :          if (ierr /= 0) return
     479            0 :          call pgebuf()
     480              :       end subroutine Profile_Panels9_plot
     481              : 
     482              : 
     483            0 :       subroutine do_Profile_Panels9_plot(s, id, device_id, &
     484              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, ierr)
     485              :          type (star_info), pointer :: s
     486              :          integer, intent(in) :: id, device_id
     487              :          real, intent(in) :: vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale
     488              :          logical, intent(in) :: subplot
     489              :          character (len=*), intent(in) :: title
     490              :          integer, intent(out) :: ierr
     491              :          call Pro_panels_plot(s, device_id, &
     492              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
     493              :             s% pg% Profile_Panels9_xaxis_reversed, &
     494              :             s% pg% Profile_Panels9_yaxis_reversed, &
     495              :             s% pg% Profile_Panels9_other_yaxis_reversed, &
     496              :             s% pg% Profile_Panels9_yaxis_log, &
     497              :             s% pg% Profile_Panels9_other_yaxis_log, &
     498              :             s% pg% Profile_Panels9_same_yaxis_range, &
     499              :             s% pg% Profile_Panels9_xaxis_name, &
     500              :             s% pg% Profile_Panels9_yaxis_name, &
     501              :             s% pg% Profile_Panels9_other_yaxis_name, &
     502              :             s% pg% Profile_Panels9_xmin, s% pg% Profile_Panels9_xmax, &
     503              :             s% pg% Profile_Panels9_xmargin, s% pg% Profile_Panels9_show_mix_regions_on_xaxis, &
     504              :             s% pg% Profile_Panels9_ymin, s% pg% Profile_Panels9_other_ymin, &
     505              :             s% pg% Profile_Panels9_ymax, s% pg% Profile_Panels9_other_ymax, &
     506              :             s% pg% Profile_Panels9_ycenter, s% pg% Profile_Panels9_other_ycenter, &
     507              :             s% pg% Profile_Panels9_ymargin, s% pg% Profile_Panels9_other_ymargin, &
     508              :             s% pg% Profile_Panels9_dymin, s% pg% Profile_Panels9_other_dymin, &
     509              :             s% pg% Profile_Panels9_show_grid, &
     510              :             s% pg% Profile_Panels9_num_panels, &
     511              :             s% pg% Profile_Panels9_use_decorator, &
     512              :             s% pg% Profile_Panels9_pgstar_decorator, &
     513              :             9, &
     514            0 :             ierr)
     515            0 :       end subroutine do_Profile_Panels9_plot
     516              : 
     517              : 
     518            0 :       subroutine Pro_panels_plot(s, device_id, &
     519              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, subplot, title, txt_scale, &
     520              :             panels_xaxis_reversed, &
     521            0 :             panels_yaxis_reversed, &
     522            0 :             panels_other_yaxis_reversed, &
     523            0 :             panels_yaxis_log, &
     524            0 :             panels_other_yaxis_log, &
     525            0 :             panels_same_yaxis_range, &
     526              :             panels_xaxis_name, &
     527            0 :             panels_yaxis_name, &
     528            0 :             panels_other_yaxis_name, &
     529              :             panels_xmin_in, panels_xmax_in, &
     530              :             panels_xmargin_in, show_mix_regions, &
     531            0 :             panels_ymin, panels_other_ymin, &
     532            0 :             panels_ymax, panels_other_ymax, &
     533            0 :             panels_ycenter, panels_other_ycenter, &
     534            0 :             panels_ymargin, panels_other_ymargin, &
     535            0 :             panels_dymin, panels_other_dymin, &
     536              :             panels_show_grid, &
     537              :             panels_num_panels, &
     538              :             use_decorator, pgstar_decorator, &
     539              :             panels_id, &
     540              :             ierr)
     541              : 
     542              :          use pgstar_abundance, only: do_abundance_panel
     543              :          use pgstar_power, only: do_power_panel
     544              :          use pgstar_dynamo, only: do_Dynamo_panel
     545              :          use pgstar_mixing_Ds, only: do_Mixing_panel
     546              :          use pgstar_mode_prop, only: do_mode_propagation_panel
     547              :          use pgstar_summary_profile, only: do_summary_profile_panel
     548              :          use pgstar_colors
     549              :          use utils_lib
     550              :          use profile_getval, only: get_profile_val, get_profile_id
     551              : 
     552              :          type (star_info), pointer :: s
     553              :          integer, intent(in) :: &
     554              :             device_id, panels_num_panels, panels_id
     555              :          real, intent(in) :: &
     556              :             vp_xleft, vp_xright, vp_ybot, vp_ytop, txt_scale, &
     557              :             panels_xmin_in, panels_xmax_in, panels_xmargin_in
     558              :          logical, intent(in) :: subplot, show_mix_regions
     559              :          logical, intent(in), dimension(:) :: &
     560              :             panels_yaxis_log, &
     561              :             panels_other_yaxis_log, &
     562              :             panels_same_yaxis_range
     563              :          real, intent(in), dimension(:) :: &
     564              :             panels_ymin, panels_other_ymin, &
     565              :             panels_ymax, panels_other_ymax, &
     566              :             panels_ycenter, panels_other_ycenter, &
     567              :             panels_ymargin, panels_other_ymargin, &
     568              :             panels_dymin, panels_other_dymin
     569              :          character (len=*), intent(in) :: &
     570              :             title, panels_xaxis_name
     571              :          character (len=*), intent(in), dimension(:) :: &
     572              :             panels_yaxis_name, &
     573              :             panels_other_yaxis_name
     574              :          logical, intent(in) :: &
     575              :             panels_xaxis_reversed, use_decorator
     576              :          logical, intent(in), dimension(:) :: &
     577              :             panels_yaxis_reversed, &
     578              :             panels_other_yaxis_reversed
     579              :          logical, intent(in) :: panels_show_grid
     580              :          integer, intent(out) :: ierr
     581              :          procedure(pgstar_decorator_interface), pointer :: pgstar_decorator
     582              : 
     583              :          integer :: &
     584              :             j, k, nz, y_color, clr_sav, id, &
     585              :             other_y_color, grid_min, grid_max, npts, yaxis_id, other_yaxis_id, ishape
     586            0 :          real :: panel_dy, panel_ybot, panel_ytop, &
     587            0 :             dx, other_ytop, other_ybot, &
     588            0 :             ybot, ytop, xmin, xmax, xleft, xright, panels_xmargin, &
     589            0 :             panels_xmin, panels_xmax, xwidth_left_frac, xwidth_right_frac, &
     590            0 :             xwidth_left_of_shock, xwidth_right_of_shock, shock_xmin, shock_xmax, &
     591            0 :             xshock_sp
     592            0 :          real(dp) :: photosphere_logxm, xshock
     593              :          character (len=strlen) :: xname, yname, other_yname
     594              :          logical :: found_shock
     595            0 :          real, allocatable, dimension(:) :: xvec, yvec, other_yvec, unshifted_xvec
     596            0 :          real, allocatable, dimension(:) :: yfile_xdata, other_yfile_xdata
     597            0 :          real, allocatable, dimension(:) :: yfile_ydata, other_yfile_ydata
     598              :          integer :: yfile_data_len, other_yfile_data_len, xaxis_id
     599              : 
     600              :          include 'formats'
     601              : 
     602            0 :          ierr = 0
     603              : 
     604            0 :          id = s% id
     605              : 
     606            0 :          call pgsave
     607            0 :          call pgsch(txt_scale)
     608              : 
     609            0 :          y_color = clr_Goldenrod
     610            0 :          other_y_color = clr_LightSkyBlue
     611              : 
     612            0 :          panel_dy = (vp_ytop - vp_ybot)/real(panels_num_panels)
     613              : 
     614            0 :          nz = s% nz
     615            0 :          allocate (xvec(nz), yvec(nz), other_yvec(nz), unshifted_xvec(nz))
     616              : 
     617            0 :          panels_xmin = panels_xmin_in
     618            0 :          panels_xmax = panels_xmax_in
     619            0 :          panels_xmargin = panels_xmargin_in
     620              : 
     621            0 :          xwidth_left_frac = s% pg% Profile_Panels_xwidth_left_div_shock_value
     622            0 :          xwidth_right_frac = s% pg% Profile_Panels_xwidth_right_div_shock_value
     623            0 :          xwidth_left_of_shock = s% pg% Profile_Panels_xwidth_left_of_shock
     624            0 :          xwidth_right_of_shock = s% pg% Profile_Panels_xwidth_right_of_shock
     625              : 
     626            0 :          xshock = 0
     627            0 :          found_shock = .false.
     628              : 
     629            0 :          xaxis_id = get_profile_id(s, panels_xaxis_name)
     630            0 :          if (xaxis_id > 0 .and. s% v_center >= 0 .and. ( &
     631              :                s% pg% Profile_Panels_show_Mach_1_location .or. &
     632              :                xwidth_left_frac > 0 .or. xwidth_right_frac > 0 .or. &
     633              :                xwidth_left_of_shock > 0 .or. xwidth_right_of_shock > 0)) then
     634            0 :             found_shock = find_shock(s, xaxis_id, xshock)
     635            0 :             if (found_shock .and. xshock <= 0) then
     636            0 :                write(*,*) 'Panel:',panels_id,' shock location on xaxis must be positive for tracking location in plot.'
     637            0 :                if (panels_xaxis_name == 'logR') write(*,*) 'perhaps use logR_cm instead of logR?'
     638            0 :                write(*,'(A)')
     639              :                found_shock = .false.
     640              :             end if
     641              :          end if
     642            0 :          xshock_sp=real(xshock,kind=kind(xshock_sp))
     643              : 
     644            0 :          if (found_shock .and. ( &
     645              :                xwidth_left_frac > 0 .or. xwidth_right_frac > 0 .or. &
     646              :                xwidth_left_of_shock > 0 .or. xwidth_right_of_shock > 0)) then
     647              : 
     648            0 :             xmin = get_profile_val(s, xaxis_id, nz)
     649            0 :             xmax = get_profile_val(s, xaxis_id, 1)
     650            0 :             if (xmin > xmax) then  ! switch
     651            0 :                dx = xmin; xmin = xmax; xmax = dx
     652              :             end if
     653              : 
     654            0 :             shock_xmin = -HUGE(shock_xmin)
     655            0 :             if (xwidth_left_frac > 0) &
     656            0 :                shock_xmin = xshock*(1.0 - xwidth_left_frac)
     657            0 :             if (xwidth_left_of_shock > 0) &
     658            0 :                shock_xmin = max(shock_xmin, xshock_sp - xwidth_left_of_shock)
     659            0 :             if (shock_xmin > xmin) then
     660            0 :                panels_xmin = shock_xmin
     661            0 :                panels_xmargin = 0
     662              :             end if
     663              : 
     664            0 :             shock_xmax = HUGE(shock_xmax)
     665            0 :             if (xwidth_right_frac > 0) &
     666            0 :                shock_xmax = xshock*(1.0 + xwidth_right_frac)
     667            0 :             if (xwidth_right_of_shock > 0) &
     668            0 :                shock_xmax = min(shock_xmax, xshock_sp + xwidth_right_of_shock)
     669            0 :             if (shock_xmax < xmax) then
     670            0 :                panels_xmax = shock_xmax
     671            0 :                panels_xmargin = 0
     672              :             end if
     673              : 
     674              :          end if
     675              : 
     676              :          call set_xaxis_bounds( &
     677              :             s, panels_xaxis_name, panels_xmin, &
     678              :             panels_xmax, panels_xaxis_reversed, panels_xmargin, &
     679              :             xvec, xmin, xmax, xleft, xright, dx, &
     680            0 :             grid_min, grid_max, npts, ierr)
     681            0 :          if (ierr /= 0) then
     682            0 :             write(*,*) 'Panel:',panels_id,' set_xaxis_bounds error in Profile panels -- please check ' // &
     683            0 :                trim(panels_xaxis_name)
     684            0 :             write(*,1) 'xleft', xleft
     685            0 :             write(*,1) 'xright', xright
     686            0 :             stop
     687              :             return
     688              :          end if
     689            0 :          if (xleft == xright) return
     690              : 
     691            0 :          if (found_shock .and. s% pg% Profile_Panels_show_Mach_1_location) then
     692              :             ! mark shock location
     693            0 :             call pgsave
     694            0 :             call pgsvp(vp_xleft, vp_xright, vp_ybot, vp_ytop)
     695            0 :             call pgswin(0.0, 1.0, 0.0, 1.0)
     696            0 :             call pgsci(clr_Gray)
     697            0 :             call pgsls(Line_Type_Dash)
     698            0 :             call pgslw(1)
     699            0 :             dx = (xshock - xmin)/(xmax - xmin)
     700            0 :             call pgmove(dx, 0.0)
     701            0 :             call pgdraw(dx, 1.0)
     702            0 :             call pgunsa
     703              :          end if
     704              : 
     705            0 :          if (s% pg% Profile_Panels_show_photosphere_location .and. &
     706              :                (panels_xaxis_name == 'mass' .or. &
     707              :                 panels_xaxis_name == 'logxm' .or. &
     708              :                 panels_xaxis_name == 'radius' .or. &
     709              :                 panels_xaxis_name == 'radius_cm')) then
     710            0 :             call pgsave
     711            0 :             call pgsvp(vp_xleft, vp_xright, vp_ybot, vp_ytop)
     712            0 :             call pgswin(0.0, 1.0, 0.0, 1.0)
     713            0 :             call pgsci(clr_Gray)
     714            0 :             call pgsls(Line_Type_Dash)
     715            0 :             call pgslw(5)
     716            0 :             if (panels_xaxis_name == 'radius') then
     717            0 :                dx = (s% photosphere_r - xmin)/(xmax - xmin)
     718            0 :             else if (panels_xaxis_name == 'radius_cm') then
     719            0 :                dx = (s% photosphere_r*Rsun - xmin)/(xmax - xmin)
     720            0 :             else if (panels_xaxis_name == 'mass') then
     721            0 :                dx = (s% photosphere_m - xmin)/(xmax - xmin)
     722              :             else
     723            0 :                if (s% star_mass > s% photosphere_m) then
     724            0 :                   photosphere_logxm = log10(s% star_mass - s% photosphere_m)
     725              :                else
     726            0 :                   photosphere_logxm = -99
     727              :                end if
     728            0 :                dx = 1 - (photosphere_logxm - xmin)/(xmax - xmin)
     729            0 :                write(*,2) 'Panel:',panels_id,' photosphere_xm xmin photo_x xmax dx', s% model_number, &
     730            0 :                   s% star_mass - s% photosphere_m, &
     731            0 :                   xmin, photosphere_logxm, xmax, dx
     732              :             end if
     733            0 :             call pgmove(dx, 0.0)
     734            0 :             call pgdraw(dx, 1.0)
     735            0 :             call pgunsa
     736              :          end if
     737              : 
     738            0 :          do k=1,nz
     739            0 :             unshifted_xvec(k) = xvec(k)
     740              :          end do
     741            0 :          if (grid_min > 1) then
     742            0 :             do k=1,npts
     743            0 :                xvec(k) = xvec(k+grid_min-1)
     744              :             end do
     745              :          end if
     746              : 
     747            0 :          do j = 1, panels_num_panels
     748              : 
     749            0 :             panel_ytop = vp_ytop - real(j-1)*panel_dy
     750            0 :             panel_ybot = panel_ytop - panel_dy
     751              : 
     752            0 :             call pgsvp(vp_xleft, vp_xright, panel_ybot, panel_ytop)
     753              : 
     754            0 :             if (j == 1) then
     755            0 :                if (.not. subplot) then
     756            0 :                   call show_model_number_pgstar(s)
     757            0 :                   call show_age_pgstar(s)
     758              :                end if
     759            0 :                call show_title_pgstar(s, title, 0.4)
     760              :             end if
     761              : 
     762            0 :             yname = panels_yaxis_name(j)
     763              : 
     764            0 :             if (trim(yname) == 'Abundance') then
     765              : 
     766              :                call do_abundance_panel(s, id, device_id, &
     767              :                   vp_xleft, vp_xright, panel_ybot, panel_ytop, .true., '', txt_scale, &
     768              :                   panels_xaxis_name, xmin, xmax, panels_xaxis_reversed, &
     769              :                   panels_ymin(j), panels_ymax(j), &
     770            0 :                   .true., (j == panels_num_panels), ierr)
     771            0 :                if (ierr /= 0) then
     772            0 :                   write(*,*) 'Panel:',panels_id,' panels failed in do_abundance_panel'
     773            0 :                   stop
     774              :                end if
     775              :                cycle
     776              : 
     777            0 :             else if (trim(yname) == 'Power') then
     778              : 
     779              :                call do_power_panel(s, id, device_id, &
     780              :                   vp_xleft, vp_xright, panel_ybot, panel_ytop, .true., '', txt_scale, &
     781              :                   panels_xaxis_name, xmin, xmax, panels_xaxis_reversed, &
     782              :                   panels_ymin(j), panels_ymax(j), &
     783            0 :                   .true., (j == panels_num_panels), ierr)
     784            0 :                if (ierr /= 0) then
     785            0 :                   write(*,*) 'Panel:',panels_id,' panels failed in do_power_panel'
     786            0 :                   stop
     787              :                end if
     788              :                cycle
     789              : 
     790            0 :             else if (trim(yname) == 'Dynamo') then
     791              : 
     792              :                call do_Dynamo_panel(s, id, device_id, &
     793              :                   vp_xleft, vp_xright, panel_ybot, panel_ytop, .true., '', txt_scale, &
     794              :                   panels_xaxis_name, xmin, xmax, panels_xaxis_reversed, &
     795            0 :                   .true., (j == panels_num_panels), ierr)
     796            0 :                if (ierr /= 0) then
     797            0 :                   write(*,*) 'Panel:',panels_id,' panels failed in do_dynamo_panel'
     798            0 :                   stop
     799              :                end if
     800              :                cycle
     801              : 
     802            0 :             else if (trim(yname) == 'Mixing') then
     803              : 
     804              :                call do_Mixing_panel(s, id, device_id, &
     805              :                   vp_xleft, vp_xright, panel_ybot, panel_ytop, .true., '', txt_scale, &
     806              :                   panels_xaxis_name, xmin, xmax, panels_xaxis_reversed, &
     807              :                   panels_ymin(j), panels_ymax(j), &
     808            0 :                   .true., (j == panels_num_panels), ierr)
     809            0 :                if (ierr /= 0) then
     810            0 :                   write(*,*) 'Panel:',panels_id,' panels failed in do_mixing_panel'
     811            0 :                   stop
     812              :                end if
     813              :                cycle
     814              : 
     815            0 :             else if (trim(yname) == 'Mode_Prop') then
     816              : 
     817              :                call do_mode_propagation_panel(s, id, device_id, &
     818              :                   vp_xleft, vp_xright, panel_ybot, panel_ytop, .true., '', txt_scale, &
     819              :                   panels_xaxis_name, xmin, xmax, panels_xaxis_reversed, &
     820            0 :                   .true., (j == panels_num_panels), ierr)
     821            0 :                if (ierr /= 0) then
     822            0 :                   write(*,*) 'Panel:',panels_id,' panels failed in do_mode_propagation_panel'
     823            0 :                   stop
     824              :                end if
     825              :                cycle
     826              : 
     827            0 :             else if (trim(yname) == 'Summary_Profile') then
     828              : 
     829              :                call do_summary_profile_panel(s, id, device_id, &
     830              :                   vp_xleft, vp_xright, panel_ybot, panel_ytop, .true., '', txt_scale, &
     831              :                   panels_xaxis_name, xmin, xmax, panels_xaxis_reversed, &
     832            0 :                   .true., (j == panels_num_panels), ierr)
     833            0 :                if (ierr /= 0) then
     834            0 :                   write(*,*) 'Panel:',panels_id,' panels failed in do_summary_profile_panel'
     835            0 :                   stop
     836              :                end if
     837              :                cycle
     838              : 
     839              :             end if
     840              : 
     841            0 :             other_yaxis_id = 0
     842            0 :             yfile_data_len = 0
     843            0 :             other_yfile_data_len = 0
     844              : 
     845            0 :             if (len_trim(panels_other_yaxis_name(j)) > 0) then
     846            0 :                other_yname = panels_other_yaxis_name(j)
     847            0 :                other_yaxis_id = get_profile_id(s, other_yname)
     848            0 :                if (other_yaxis_id <= 0) then
     849            0 :                   if (.not. read_values_from_file(other_yname, &
     850              :                         other_yfile_xdata, other_yfile_ydata, other_yfile_data_len)) then
     851              :                      write(*,'(A,1X,I1,A,1X,I1,A)') &
     852            0 :                      'Panel:',panels_id,' bad other yaxis(',j,') for Profile panels plot name=',trim(other_yname)
     853            0 :                      return
     854              :                   end if
     855            0 :                   if (panels_other_yaxis_log(j)) then
     856            0 :                      do k=1,other_yfile_data_len
     857            0 :                         other_yfile_ydata(k) = log10(max(tiny(other_yfile_ydata(k)),abs(other_yfile_ydata(k))))
     858              :                      end do
     859              :                   end if
     860              :                   call set_ytop_ybot( &
     861              :                      other_yfile_data_len, other_yfile_ydata, panels_other_ymin(j), &
     862              :                      panels_other_ymax(j), panels_other_ycenter(j), panels_other_ymargin(j), &
     863            0 :                      panels_other_yaxis_reversed(j), panels_other_dymin(j), other_ybot, other_ytop)
     864              :                else
     865            0 :                   do k=1,npts
     866            0 :                      other_yvec(k) = get_profile_val(s, other_yaxis_id, k+grid_min-1)
     867              :                   end do
     868            0 :                   if (panels_other_yaxis_log(j)) then
     869            0 :                      do k=1,npts
     870            0 :                         other_yvec(k) = log10(max(tiny(other_yvec(k)),abs(other_yvec(k))))
     871              :                      end do
     872              :                   end if
     873              :                   call set_ytop_ybot( &
     874              :                      npts, other_yvec, panels_other_ymin(j), panels_other_ymax(j), panels_other_ycenter(j), &
     875              :                      panels_other_ymargin(j), panels_other_yaxis_reversed(j), &
     876            0 :                      panels_other_dymin(j), other_ybot, other_ytop)
     877              :                end if
     878              :             end if
     879              : 
     880            0 :             yaxis_id = get_profile_id(s, yname)
     881            0 :             if (yaxis_id <= 0) then
     882            0 :                if (.not. read_values_from_file( &
     883              :                      yname, yfile_xdata, yfile_ydata, yfile_data_len)) then
     884              :                   write(*,'(A,1X,I1,A,1X,I1,A)') &
     885            0 :                   'Panel:',panels_id,' bad yaxis(',j,') for Profile panels plot name=',trim(yname)
     886            0 :                   return
     887              :                end if
     888            0 :                if (panels_yaxis_log(j)) then
     889            0 :                   do k=1,yfile_data_len
     890            0 :                      yfile_ydata(k) = log10(max(tiny(yfile_ydata(k)),abs(yfile_ydata(k))))
     891              :                   end do
     892              :                end if
     893              :                call set_ytop_ybot( &
     894              :                   yfile_data_len, yfile_xdata, panels_ymin(j), panels_ycenter(j), panels_ymax(j), &
     895            0 :                   panels_ymargin(j), panels_yaxis_reversed(j), panels_dymin(j), ybot, ytop)
     896              :             else
     897            0 :                do k=1,npts
     898            0 :                   yvec(k) = get_profile_val(s, yaxis_id, k+grid_min-1)
     899              :                end do
     900            0 :                if (panels_yaxis_log(j)) then
     901            0 :                   do k=1,npts
     902            0 :                      yvec(k) = log10(max(tiny(yvec(k)),abs(yvec(k))))
     903              :                   end do
     904              :                end if
     905              :                call set_ytop_ybot( &
     906              :                   npts, yvec, panels_ymin(j), panels_ymax(j), panels_ycenter(j), panels_ymargin(j), &
     907            0 :                   panels_yaxis_reversed(j), panels_dymin(j), ybot, ytop)
     908              :             end if
     909              : 
     910            0 :             if (panels_same_yaxis_range(j) .and. len_trim(panels_other_yaxis_name(j)) > 0) then
     911            0 :                if (other_ybot < ybot) ybot = other_ybot
     912            0 :                if (ybot < other_ybot) other_ybot = ybot
     913            0 :                if (other_ytop > ytop) ytop = other_ytop
     914            0 :                if (ytop > other_ytop) other_ytop = ytop
     915              :             end if
     916              : 
     917            0 :             if (len_trim(panels_other_yaxis_name(j)) > 0) then
     918            0 :                call pgswin(xleft, xright, other_ybot, other_ytop)
     919            0 :                call pgscf(1)
     920            0 :                call pgsci(clr_Foreground)
     921            0 :                call show_box_pgstar(s,'','CMSTV')
     922            0 :                call pgsci(other_y_color)
     923            0 :                if (panels_other_yaxis_log(j)) then
     924            0 :                   call show_right_yaxis_label_pgstar(s,'log ' // other_yname)
     925              :                else
     926            0 :                   call show_right_yaxis_label_pgstar(s,other_yname)
     927              :                end if
     928            0 :                call pgslw(s% pg% pgstar_lw)
     929            0 :                call pgsci(other_y_color)
     930            0 :                if (other_yfile_data_len > 0) then
     931              :                   call pgline( &
     932            0 :                      other_yfile_data_len, other_yfile_xdata, other_yfile_ydata)
     933            0 :                   deallocate(other_yfile_xdata, other_yfile_ydata)
     934              :                else
     935            0 :                   call pgline(npts, xvec, other_yvec)
     936            0 :                   if (panels_show_grid) then
     937            0 :                      ishape = 21
     938            0 :                      do k=1,npts
     939            0 :                         call pgpt1(xvec(k),other_yvec(k),ishape)
     940              :                      end do
     941              :                   end if
     942              :                end if
     943            0 :                call pgslw(1)
     944              :             end if
     945              : 
     946            0 :             call pgswin(xleft, xright, ybot, ytop)
     947            0 :             call pgscf(1)
     948            0 :             call pgsci(clr_Foreground)
     949            0 :             if (j < panels_num_panels) then
     950            0 :                if (other_yaxis_id <= 0 .and. other_yfile_data_len <= 0) then
     951            0 :                   call show_box_pgstar(s,'BCST','BCMNSTV')
     952              :                else
     953            0 :                   call show_box_pgstar(s,'BCST','BNSTV')
     954              :                end if
     955              :             else
     956            0 :                if (other_yaxis_id <= 0 .and. other_yfile_data_len <= 0) then
     957            0 :                   call show_box_pgstar(s,'BCNST','BCMNSTV')
     958              :                else
     959            0 :                   call show_box_pgstar(s,'BCNST','BNSTV')
     960              :                end if
     961              :             end if
     962              : 
     963            0 :             call pgqci(clr_sav)
     964            0 :             call pgsci(y_color)
     965            0 :             if (panels_yaxis_log(j)) then
     966            0 :                call show_left_yaxis_label_pgstar(s,'log ' // yname)
     967              :             else
     968            0 :                call show_left_yaxis_label_pgstar(s,yname)
     969              :             end if
     970            0 :             call pgslw(s% pg% pgstar_lw)
     971            0 :             if (yfile_data_len > 0) then
     972            0 :                call pgsls(s% pg% pgstar_profile_line_style)
     973            0 :                call pgline(yfile_data_len, yfile_xdata, yfile_ydata)
     974            0 :                call pgsls(1)
     975            0 :                deallocate(yfile_xdata, yfile_ydata)
     976              :             else
     977            0 :                call pgsls(s% pg% pgstar_profile_line_style)
     978            0 :                call pgline(npts, xvec, yvec)
     979            0 :                call pgsls(1)
     980            0 :                if (panels_show_grid) then
     981            0 :                   ishape = 21
     982            0 :                   do k=1,npts
     983            0 :                      call pgpt1(xvec(k),yvec(k),ishape)
     984              :                   end do
     985              :                end if
     986              :             end if
     987            0 :             call pgslw(1)
     988            0 :             call pgsci(clr_Foreground)
     989              : 
     990            0 :             call show_pgstar_decorator(s% id, use_decorator, pgstar_decorator, j, ierr)
     991              :          end do
     992              : 
     993            0 :          xname = trim(panels_xaxis_name)
     994            0 :          call show_xaxis_label_pgstar(s,xname)
     995              : 
     996            0 :          if (show_mix_regions) then  ! show mix regions at bottom of plot
     997            0 :             call pgslw(10)
     998              :             call show_mix_regions_on_xaxis( &
     999            0 :                s,ybot,ytop,grid_min,grid_max,unshifted_xvec)
    1000              :          end if
    1001              : 
    1002            0 :          deallocate(xvec, yvec, other_yvec, unshifted_xvec)
    1003              : 
    1004            0 :          call pgunsa
    1005              : 
    1006            0 :       end subroutine Pro_panels_plot
    1007              : 
    1008              :       end module pgstar_profile_panels
        

Generated by: LCOV version 2.0-1