Skip to content

Commit 5433adc

Browse files
authored
Merge pull request #8 from jschwab/update-paths
Add function to determine if .inc files are in star or star_data
2 parents e4638eb + 7fd5e42 commit 5433adc

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

mesa_script/lib/mesa_script.rb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ def self.f_end
1919
end
2020
end
2121

22+
# Determine proper file location for star-related .inc files
23+
def self.star_or_star_data
24+
if Inlist.version >= 12245
25+
'star_data'
26+
else
27+
'star'
28+
end
29+
end
30+
2231
# these hold the names of the namelists as well as the locations of the
2332
# fortran files that define their controls as well as the defaults files
2433
# that define their default values and order in formatted inlists
@@ -129,7 +138,7 @@ def self.delete_methods(namelist)
129138
def self.add_star_job_defaults(verbose: false)
130139
config_namelist(
131140
namelist: :star_job,
132-
source_files: File.join(ENV['MESA_DIR'], 'star', 'private',
141+
source_files: File.join(ENV['MESA_DIR'], star_or_star_data, 'private',
133142
'star_job_controls.inc'),
134143
defaults_file: File.join(ENV['MESA_DIR'], 'star', 'defaults',
135144
'star_job.defaults'),
@@ -141,7 +150,7 @@ def self.add_star_job_defaults(verbose: false)
141150
def self.add_controls_defaults(verbose: false)
142151
config_namelist(
143152
namelist: :controls,
144-
source_files: [File.join(ENV['MESA_DIR'], 'star', 'private',
153+
source_files: [File.join(ENV['MESA_DIR'], star_or_star_data, 'private',
145154
'star_controls.inc'),
146155
File.join(ENV['MESA_DIR'], 'star', 'private',
147156
"ctrls_io.#{f_end}")],
@@ -155,7 +164,7 @@ def self.add_controls_defaults(verbose: false)
155164
def self.add_pgstar_defaults(verbose: false)
156165
config_namelist(
157166
namelist: :pgstar,
158-
source_files: File.join(ENV['MESA_DIR'], 'star', 'private',
167+
source_files: File.join(ENV['MESA_DIR'], star_or_star_data, 'private',
159168
'pgstar_controls.inc'),
160169
defaults_file: File.join(ENV['MESA_DIR'], 'star', 'defaults',
161170
'pgstar.defaults'),

0 commit comments

Comments
 (0)