Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing file_extension user option #722

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions binary/defaults/pgbinary.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@

! file_device
! ~~~~~~~~~~~
! file_extension
! ~~~~~~~~~~~~~~

! 'png' is Portable Network Graphics format; can also use 'pdf'
! 'png' for Portable Network Graphics format
! 'vcps' for Color PostScript ('ps')
! 'ps' for PostScript

! ::

file_device = 'png'
file_extension = 'png'


! file_digits
Expand Down
2 changes: 0 additions & 2 deletions binary/private/pgbinary_ctrls_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ module pgbinary_ctrls_io
namelist /pgbinary/ &

file_device, &
file_extension, &
file_digits, &
pgbinary_interval, &
pause, &
Expand Down Expand Up @@ -1455,7 +1454,6 @@ subroutine store_pgbinary_controls(b, ierr)
pg => b% pg

pg% file_device = file_device
pg% file_extension = file_extension
pg% file_digits = file_digits
pg% pgbinary_interval = pgbinary_interval
pg% pause = pause
Expand Down
8 changes: 7 additions & 1 deletion binary/private/pgbinary_support.f90
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ subroutine create_file_name(b, dir, prefix, name)
character (len = *), intent(in) :: dir, prefix
character (len = *), intent(out) :: name
character (len = strlen) :: num_str, fstring
character (len = 32) :: file_extension
write(fstring, '( "(i",i2.2,".",i2.2,")" )') &
b% pg% file_digits, b% pg% file_digits
write(num_str, fstring) b% model_number
Expand All @@ -177,7 +178,12 @@ subroutine create_file_name(b, dir, prefix, name)
else
name = prefix
end if
name = trim(name) // trim(num_str) // '.' // trim(b% pg% file_extension)
if (b%pg%file_device=='vcps') then
file_extension = 'ps'
else
file_extension = b%pg%file_device
end if
name = trim(name) // trim(num_str) // '.' // trim(file_extension)
end subroutine create_file_name


Expand Down
6 changes: 0 additions & 6 deletions binary/test_suite/evolve_both_stars/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ pgstar commands used for the binary and star1 plots above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
!file_device = 'png' ! png
!file_extension = 'png'

file_device = 'vcps' ! postscript
file_extension = 'ps'

pgstar_interval = 1

Expand Down Expand Up @@ -246,10 +243,7 @@ pgstar commands used for the star2 plot above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
!file_device = 'png' ! png
!file_extension = 'png'

file_device = 'vcps' ! postscript
file_extension = 'ps'

pgstar_interval = 1

Expand Down
3 changes: 0 additions & 3 deletions binary/test_suite/jdot_gr_check/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ pgstar commands used for the plot above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
!file_device = 'png' ! png
!file_extension = 'png'

file_device = 'vcps' ! postscript
file_extension = 'ps'

pgstar_interval = 1

Expand Down
3 changes: 0 additions & 3 deletions binary/test_suite/jdot_ls_check/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ pgstar commands used for the plot above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
!file_device = 'png' ! png
!file_extension = 'png'

file_device = 'vcps' ! postscript
file_extension = 'ps'

pgstar_interval = 1

Expand Down
3 changes: 0 additions & 3 deletions binary/test_suite/jdot_ml_check/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ pgstar commands used for the binary and star1 plots above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
!file_device = 'png' ! png
!file_extension = 'png'

file_device = 'vcps' ! postscript
file_extension = 'ps'

pgstar_interval = 1

Expand Down
3 changes: 0 additions & 3 deletions binary/test_suite/star_plus_point_mass/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ pgstar commands used for the plots above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
!file_device = 'png' ! png
!file_extension = 'png'

file_device = 'vcps' ! postscript
file_extension = 'ps'

pgstar_interval = 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ pgstar commands used for the plots above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
!file_device = 'png' ! png
!file_extension = 'png'

file_device = 'vcps' ! postscript
file_extension = 'ps'

pgstar_interval = 1

Expand Down
10 changes: 10 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ Changelog
Changes in main
===============

.. _Backwards-incompatible changes main:

Backwards-incompatible changes
------------------------------

``pgstar`` / ``pgbinary``
~~~~~~~~~~~~~~~~~~~~~~~~~

Removed `file_extension` option because it is redundant with `file_device`. Delete `file_extension` from your inlists.

.. _New Features main:

New Features
Expand Down
2 changes: 0 additions & 2 deletions docs/source/using_mesa/using_pgstar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,10 @@ PGSTAR has a number of options to control its file output.
The default output format is PNG::

file_device = 'png'
file_extension = 'png'

but you can use PostScript output by setting::

file_device = 'vcps'
file_extension = 'ps'

You can change the foreground/background color of your plots between
black/white and white/black::
Expand Down
19 changes: 4 additions & 15 deletions star/defaults/pgstar.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,14 @@
! file_device
! ~~~~~~~~~~~

! 'png' is Portable Network Graphics format
! can also use:
! 'ps' (in combination with file_extension = 'ps') for PostScript
! or:
! 'vcps' (in combination with file_extension = 'eps') for Encapsulated PostScript
! 'png' for Portable Network Graphics format
! 'vcps' for Color PostScript ('ps')
! 'ps' for PostScript

! ::

file_device = 'png'

! file_extension
! ~~~~~~~~~~~~~~

! Can use: 'png', 'ps', or 'eps' with the appropriate file_device

! ::

file_extension = 'png'


! file_digits
! ~~~~~~~~~~~
Expand All @@ -121,7 +110,7 @@
! delta_HR_limit_for_file_output
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

! trigger file output by distance travelled on HR diagram
! trigger file output by distance traveled on HR diagram
! negative means no limit
! HR distance since last file output = sum of dHR
! where per step dHR = same definition as used for timestep limits
Expand Down
2 changes: 0 additions & 2 deletions star/private/pgstar_ctrls_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ module pgstar_ctrls_io
namelist /pgstar/ &

file_device, &
file_extension, &
file_digits, &
pgstar_interval, &
pause, &
Expand Down Expand Up @@ -3154,7 +3153,6 @@ subroutine store_pgstar_controls(s, ierr)
ierr = 0

s% pg% file_device = file_device
s% pg% file_extension = file_extension
s% pg% file_digits = file_digits
s% pg% pgstar_interval = pgstar_interval
s% pg% pause = pause
Expand Down
8 changes: 7 additions & 1 deletion star/private/pgstar_support.f90
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,20 @@ subroutine create_file_name(s, dir, prefix, name)
character (len = *), intent(in) :: dir, prefix
character (len = *), intent(out) :: name
character (len = strlen) :: num_str, fstring
character (len = 32) :: file_extension
write(fstring, '( "(i",i2.2,".",i2.2,")" )') s% pg% file_digits, s% pg% file_digits
write(num_str, fstring) s% model_number
if (len_trim(dir) > 0) then
name = trim(dir) // '/' // trim(prefix)
else
name = prefix
end if
name = trim(name) // trim(num_str) // '.' // trim(s% pg% file_extension)
if (s%pg%file_device=='vcps') then
file_extension = 'ps'
else
file_extension = s%pg%file_device ! e.g.: png, ps
end if
name = trim(name) // trim(num_str) // '.' // trim(file_extension)
end subroutine create_file_name


Expand Down
3 changes: 0 additions & 3 deletions star/test_suite/1.3M_ms_high_Z/inlist_pgstar
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
! MESA uses PGPLOT for live plotting and gives the user a tremendous
! amount of control of the presentation of the information.

! device
file_white_on_black_flag = .true.
file_device = 'vcps' ! postscript
file_extension = 'ps'
!file_device = 'png' ! png
!file_extension = 'png'

pgstar_interval = 10

Expand Down
5 changes: 1 addition & 4 deletions star/test_suite/1.4M_ms_op_mono/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ pgstar commands used for the plots above:

pgstar_interval = 10

! device

file_white_on_black_flag = .true.
file_device = 'vcps'
file_extension = 'ps'
file_device = 'vcps'

! two profile panels
Profile_Panels1_win_flag = .true.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,8 @@

pgstar_interval = 50

! device
file_white_on_black_flag = .true.
file_device = 'vcps' ! postscript
file_extension = 'ps'

Abundance_win_flag = .false. ! switch to .true. to visualize in real-time
Abundance_file_flag = .true.
Expand Down
2 changes: 0 additions & 2 deletions star/test_suite/1.5M_with_diffusion/inlist_to_ZAMS
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@

pgstar_interval = 50

! device
file_white_on_black_flag = .true.
file_device = 'vcps' ! postscript
file_extension = 'ps'

Grid2_win_flag = .false. ! switch to .true. to visualize in real-time
file_digits = 7
Expand Down
6 changes: 0 additions & 6 deletions star/test_suite/12M_pre_ms_to_core_collapse/inlist_pgstar
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,7 @@ pgstar_model_fjust = 1.0
! white_on_black flags -- true means white foreground color on black background
file_white_on_black_flag = .true.
file_device = 'png' ! options 'png' and 'vcps' for png and postscript respectively
file_extension = 'png' ! common names are 'png' and 'ps'


!file_white_on_black_flag = .false.
!file_device = 'vcps' ! options 'png' and 'vcps' for png and postscript respectively
!file_extension = 'ps' ! common names are 'png' and 'ps'


kipp_win_flag=.true.
kipp_file_flag=.true.
Expand Down
2 changes: 0 additions & 2 deletions star/test_suite/15M_dynamo/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ pgstar commands used for the plots above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
!file_device = 'png' ! png
!file_extension = 'png'

file_device = 'vcps' ! postscript
file_extension = 'ps'

pgstar_interval = 10
file_digits = 8
Expand Down
3 changes: 0 additions & 3 deletions star/test_suite/15M_dynamo/inlist_common
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
file_device = 'png' ! png
file_extension = 'png'

!file_device = 'vcps' ! postscript
!file_extension = 'ps'

pgstar_interval = 50
file_digits = 8
Expand Down
2 changes: 0 additions & 2 deletions star/test_suite/16M_conv_premix/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ pgstar commands used for the plots above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
file_device = 'png' ! png
file_extension = 'png'

!file_device = 'vcps' ! postscript
!file_extension = 'ps'

pgstar_interval = 10
file_digits = 8
Expand Down
2 changes: 0 additions & 2 deletions star/test_suite/16M_predictive_mix/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ pgstar commands used for the plots above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
file_device = 'png' ! png
file_extension = 'png'

!file_device = 'vcps' ! postscript
!file_extension = 'ps'

pgstar_interval = 10
file_digits = 8
Expand Down
2 changes: 0 additions & 2 deletions star/test_suite/1M_pre_ms_to_wd/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ pgstar commands used for the plots above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
file_device = 'png' ! png
file_extension = 'png'

!file_device = 'vcps' ! postscript
!file_extension = 'ps'

pgstar_interval = 10
file_digits = 8
Expand Down
2 changes: 0 additions & 2 deletions star/test_suite/1M_thermohaline/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ pgstar commands used for the plots above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
file_device = 'png' ! png
file_extension = 'png'

!file_device = 'vcps' ! postscript
!file_extension = 'ps'

pgstar_interval = 10
file_digits = 8
Expand Down
7 changes: 0 additions & 7 deletions star/test_suite/20M_pre_ms_to_core_collapse/inlist_pgstar
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,6 @@ pgstar_model_fjust = 1.0
! white_on_black flags -- true means white foreground color on black background
file_white_on_black_flag = .true.
file_device = 'png' ! options 'png' and 'vcps' for png and postscript respectively
file_extension = 'png' ! common names are 'png' and 'ps'


!file_white_on_black_flag = .false.
!file_device = 'vcps' ! options 'png' and 'vcps' for png and postscript respectively
!file_extension = 'ps' ! common names are 'png' and 'ps'


kipp_win_flag=.true.
kipp_file_flag=.true.
Expand Down
2 changes: 0 additions & 2 deletions star/test_suite/20M_z2m2_high_rotation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ pgstar commands used for the plots above:

file_white_on_black_flag = .true. ! white_on_black flags -- true means white foreground color on black background
file_device = 'png' ! png
file_extension = 'png'

!file_device = 'vcps' ! postscript
!file_extension = 'ps'

pgstar_interval = 10
file_digits = 8
Expand Down
Loading