@@ -60,7 +60,7 @@ end subroutine extras_controls
60
60
ierr = 0
61
61
call do_read_star_job(' inlist' , ierr) ! this does alloc_star
62
62
! and saves the id in id_from_read_star_job
63
- if (ierr /= 0 ) stop 1
63
+ if (ierr /= 0 ) call mesa_error(__FILE__,__LINE__)
64
64
65
65
id = id_from_read_star_job
66
66
id_from_read_star_job = 0
@@ -69,7 +69,7 @@ end subroutine extras_controls
69
69
call star_setup(id, ' inlist' , ierr)
70
70
if (ierr /= 0 ) then
71
71
write (* ,* ) ' failed in star_setup'
72
- stop 1
72
+ call mesa_error(__FILE__,__LINE__)
73
73
end if
74
74
75
75
okay_to_restart = .true.
@@ -85,7 +85,7 @@ end subroutine extras_controls
85
85
call read_astero_search_controls(inlist_astero_fname, ierr)
86
86
if (ierr /= 0 ) then
87
87
write (* ,* ) ' failed in read_astero_search_controls'
88
- stop 1
88
+ call mesa_error(__FILE__,__LINE__)
89
89
end if
90
90
91
91
if (Y_depends_on_Z .and. vary_Y) then
@@ -132,22 +132,22 @@ end subroutine extras_controls
132
132
call write_astero_search_controls(save_controls_filename, ierr)
133
133
if (ierr /= 0 ) then
134
134
write (* ,* ) ' failed in write_astero_search_controls'
135
- stop 1
135
+ call mesa_error(__FILE__,__LINE__)
136
136
end if
137
137
end if
138
138
139
139
call check_search_controls(ierr)
140
140
if (ierr /= 0 ) then
141
141
write (* ,* ) ' failed in check_search_controls'
142
- stop 1
142
+ call mesa_error(__FILE__,__LINE__)
143
143
end if
144
144
145
145
nu_max_sun = s% nu_max_sun
146
146
delta_nu_sun = s% delta_nu_sun
147
147
call init_obs_data(ierr)
148
148
if (ierr /= 0 ) then
149
149
write (* ,* ) ' failed in init_obs_data'
150
- stop 1
150
+ call mesa_error(__FILE__,__LINE__)
151
151
end if
152
152
153
153
next_Y_to_try = - 1
@@ -742,7 +742,7 @@ subroutine bobyqa_fun(n,x,f)
742
742
call save_sample_results_to_file(- 1 ,bobyqa_output_filename,ierr)
743
743
if (ierr /= 0 ) then
744
744
write (* ,* ) ' failed in save_sample_results_to_file'
745
- stop ' bobyqa_fun'
745
+ call mesa_error(__FILE__,__LINE__, ' bobyqa_fun' )
746
746
end if
747
747
748
748
end subroutine bobyqa_fun
@@ -762,7 +762,7 @@ subroutine newuoa_fun(n,x,f)
762
762
call save_sample_results_to_file(- 1 ,newuoa_output_filename,ierr)
763
763
if (ierr /= 0 ) then
764
764
write (* ,* ) ' failed in save_sample_results_to_file'
765
- stop ' newuoa_fun'
765
+ call mesa_error(__FILE__,__LINE__, ' newuoa_fun' )
766
766
end if
767
767
768
768
end subroutine newuoa_fun
@@ -829,7 +829,7 @@ subroutine bobyqa_or_newuoa_fun(n,x,f)
829
829
f = eval1(star_id, ierr)
830
830
if (ierr /= 0 ) then
831
831
write (* ,* ) ' got ierr from eval1'
832
- stop ' bobyqa_fun'
832
+ call mesa_error(__FILE__,__LINE__, ' bobyqa_fun' )
833
833
end if
834
834
if (sample_number == prev_sample_number) then
835
835
if (sample_number <= 0 ) then ! failed on 1st try
@@ -847,7 +847,7 @@ subroutine bobyqa_or_newuoa_fun(n,x,f)
847
847
call show_all_sample_results(6 ,- 1 ,ierr)
848
848
if (ierr /= 0 ) then
849
849
write (* ,* ) ' failed in show_all_sample_results'
850
- stop ' bobyqa_fun'
850
+ call mesa_error(__FILE__,__LINE__, ' bobyqa_fun' )
851
851
end if
852
852
853
853
min_sample_chi2_so_far = minval (sample_chi2(1 :sample_number))
@@ -1437,7 +1437,7 @@ subroutine setup_simplex_and_f(ierr)
1437
1437
ierr = 0
1438
1438
allocate (index (num_samples), stat= ierr)
1439
1439
if (ierr /= 0 ) then
1440
- stop ' failed in allocate before calling qsort from show_all_sample_results'
1440
+ call mesa_error(__FILE__,__LINE__, ' failed in allocate before calling qsort from show_all_sample_results' )
1441
1441
end if
1442
1442
call qsort(index, num_samples, sample_chi2)
1443
1443
max_i = 0
@@ -1533,7 +1533,7 @@ subroutine save_best_for_sample(i, op_code)
1533
1533
call alloc_sample_ptrs(ierr)
1534
1534
if (ierr /= 0 ) then
1535
1535
write (* ,* ) ' ERROR -- failed to allocate for samples'
1536
- stop ' save_best_for_sample'
1536
+ call mesa_error(__FILE__,__LINE__, ' save_best_for_sample' )
1537
1537
return
1538
1538
end if
1539
1539
end if
@@ -1662,7 +1662,7 @@ subroutine set_sample_averages
1662
1662
avg_model_number_top_samples + &
1663
1663
avg_model_number_sigma_limit* avg_model_number_sigma
1664
1664
write (* ,* )
1665
- ! stop 'set_sample_averages'
1665
+ ! call mesa_error(__FILE__,__LINE__, 'set_sample_averages')
1666
1666
1667
1667
end subroutine set_sample_averages
1668
1668
0 commit comments