Skip to content

Commit

Permalink
substitutions of secday into source
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Fabry committed Aug 11, 2022
1 parent 0f86d90 commit 950a4e5
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion binary/private/binary_evolve.f90
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ subroutine binarydata_init(b, doing_restart)
end if
else
call set_period_eccentricity(b% binary_id, &
b% initial_period_in_days*(24d0*60d0*60d0), b% initial_eccentricity, ierr)
b% initial_period_in_days*secday, b% initial_eccentricity, ierr)
if (ierr /= 0) then
return
end if
Expand Down
2 changes: 1 addition & 1 deletion binary/private/binary_history.f90
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ subroutine binary_history_getval( &
int_val = b% d_i
is_int_val = .true.
case(bh_period_days)
val = b% period/(60d0*60d0*24d0)
val = b% period/secday
case(bh_period_hr)
val = b% period/(60d0*60d0)
case(bh_period_minutes)
Expand Down
4 changes: 2 additions & 2 deletions binary/private/run_binary_support.f90
Original file line number Diff line number Diff line change
Expand Up @@ -933,10 +933,10 @@ subroutine do_binary_job_controls_after(binary_id, b, restart, ierr)

if (b% job% change_period_eccentricity .or. &
(b% job% change_initial_period_eccentricity .and. .not. restart)) then
if (b% period /= b% job% new_period*60d0*60d0*24d0 .or. &
if (b% period /= b% job% new_period*secday .or. &
b% eccentricity /= b% job% new_eccentricity) then
call set_period_eccentricity(binary_id, &
b% job% new_period*60d0*60d0*24d0, b% job% new_eccentricity, ierr)
b% job% new_period*secday, b% job% new_eccentricity, ierr)
if (ierr /= 0) then
write(*,*) "error in set_period_eccentricity"
return
Expand Down
2 changes: 1 addition & 1 deletion binary/test_suite/double_bh/src/run_binary_extras.f90
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ integer function extras_binary_finish_step(binary_id)
b% s1% star_age < 1d2)) then
! if here, still not in ZAMS, keep period fixed
call binary_set_period_eccentricity(b% binary_id, &
b% initial_period_in_days*(24d0*60d0*60d0), 0d0, ierr)
b% initial_period_in_days*secday, 0d0, ierr)
if (ierr /= 0) then
return
end if
Expand Down
2 changes: 1 addition & 1 deletion binary/test_suite/jdot_ls_check/src/run_star_extras.f90
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ subroutine data_for_extra_history_columns(id, n, names, vals, ierr)
end if
spin_period = 2*pi/s% omega_avg_surf
i = 0
i=i+1; names(i) = 'spin_period_days'; vals(i) = spin_period/(60d0*60d0*24d0)
i=i+1; names(i) = 'spin_period_days'; vals(i) = spin_period/secday
i=i+1; names(i) = 'spin_period_hr'; vals(i) = spin_period/(60d0*60d0)
i=i+1; names(i) = 'spin_period_minutes'; vals(i) = spin_period/60d0
i=i+1; names(i) = 'spin_orital_period_ratio'; vals(i) = spin_period/b% period
Expand Down
8 changes: 4 additions & 4 deletions star/private/do_one_utils.f90
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,15 @@ subroutine output_terminal_summary(s,io)
trim(s% terminal_show_age_units) == 'secs') then
age = age*secyer
else if (trim(s% terminal_show_age_units) == 'days') then
age = age*secyer/(24*60*60)
age = age*dayyer
end if

time_step = s% time_step ! in years
if (trim(s% terminal_show_timestep_units) == 'seconds' .or. &
trim(s% terminal_show_timestep_units) == 'secs') then
time_step = time_step*secyer
else if (trim(s% terminal_show_timestep_units) == 'days') then
time_step = time_step*secyer/(24*60*60)
time_step = time_step*dayyer
end if

if (s% terminal_show_log_age) age = safe_log10(age)
Expand Down Expand Up @@ -775,9 +775,9 @@ integer function do_check_limits(id)
call compare_to_target('star_age >= max_age', s% star_age, s% max_age, &
t_max_age)

else if (s% time >= s% max_age_in_days*(60*60*24) .and. s% max_age_in_days > 0) then
else if (s% time >= s% max_age_in_days*secday .and. s% max_age_in_days > 0) then
call compare_to_target('time >= max_age_in_days', &
s% time/(60*60*24), s% max_age_in_days, t_max_age)
s% time/secday, s% max_age_in_days, t_max_age)

else if (s% time >= s% max_age_in_seconds .and. s% max_age_in_seconds > 0) then
call compare_to_target('time >= max_age_in_seconds', &
Expand Down
14 changes: 7 additions & 7 deletions star/private/evolve.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ subroutine check_for_extra_heat(s, ierr)
else if (s% max_age_in_seconds > 0) then
end_time = s% max_age_in_seconds
else if (s% max_age_in_days > 0) then
end_time = s% max_age_in_days*(60*60*24)
end_time = s% max_age_in_days*secday
else
end_time = s% max_age*secyer
end if
Expand Down Expand Up @@ -1846,7 +1846,7 @@ integer function prepare_for_new_step(s)
write(*, *) 's% dt_next', s% dt_next
prepare_for_new_step = terminate
if ((s% time >= s% max_age*secyer .and. s% max_age > 0) .or. &
(s% time >= s% max_age_in_days*(60*60*24) .and. s% max_age_in_days > 0) .or. &
(s% time >= s% max_age_in_days*secday .and. s% max_age_in_days > 0) .or. &
(s% time >= s% max_age_in_seconds .and. s% max_age_in_seconds > 0)) then
s% result_reason = result_reason_normal
s% termination_code = t_max_age
Expand Down Expand Up @@ -1922,9 +1922,9 @@ integer function prepare_for_new_step(s)
else if ((s% time + s% dt_next) > s% max_age_in_seconds &
.and. s% max_age_in_seconds > 0) then
s% dt_next = max(0d0, s% max_age_in_seconds - s% time)
else if ((s% time + s% dt_next) > s% max_age_in_days*(60*60*24) &
else if ((s% time + s% dt_next) > s% max_age_in_days*secday &
.and. s% max_age_in_days > 0) then
s% dt_next = max(0d0, s% max_age_in_days*(60*60*24) - s% time)
s% dt_next = max(0d0, s% max_age_in_days*secday - s% time)
end if

s% dt = s% dt_next
Expand Down Expand Up @@ -2096,9 +2096,9 @@ integer function pick_next_timestep(id)
s% dt_next = -s% time
else if ((s% time + s% dt_next) > s% max_age*secyer .and. s% max_age > 0) then
s% dt_next = max(0d0, s% max_age*secyer - s% time)
else if ((s% time + s% dt_next) > s% max_age_in_days*(60*60*24) &
else if ((s% time + s% dt_next) > s% max_age_in_days*secday &
.and. s% max_age_in_days > 0) then
s% dt_next = max(0d0, s% max_age_in_days*(60*60*24) - s% time)
s% dt_next = max(0d0, s% max_age_in_days*secday - s% time)
else if ((s% time + s% dt_next) > s% max_age_in_seconds &
.and. s% max_age_in_seconds > 0) then
s% dt_next = max(0d0, s% max_age_in_seconds - s% time)
Expand All @@ -2107,7 +2107,7 @@ integer function pick_next_timestep(id)
if (s% max_age > 0) then
remaining_years = s% max_age - s% star_age
else if (s% max_age_in_days > 0) then
remaining_years = (s% max_age_in_days*(60*60*24) - s% time)/secyer
remaining_years = (s% max_age_in_days*secday - s% time)/secyer
else if (s% max_age_in_seconds > 0) then
remaining_years = (s% max_age_in_seconds - s% time)/secyer
else
Expand Down
2 changes: 1 addition & 1 deletion star/private/history.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2892,7 +2892,7 @@ subroutine history_getval( &
case(h_RSP_phase)
if (s% RSP_flag) val = (s% time - rsp_phase_time0())/s% RSP_period
case(h_RSP_period_in_days)
if (s% RSP_flag) val = s% RSP_period/(24*60*60) ! days
if (s% RSP_flag) val = s% RSP_period/secday ! days
case(h_RSP_num_periods)
if (s% RSP_flag) int_val = s% RSP_num_periods
is_int_val = .true.
Expand Down
2 changes: 1 addition & 1 deletion star/private/pgstar_history_panels.f90
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ subroutine do_history_panels_plot( &
else if (hist_xaxis_name == 'star_age' .and. automatic_star_age_units) then
if (s% star_age > 1d0) then
hist_xaxis_name = 'star_age_yr'
else if (s% star_age*secyer > 24*60*60) then
else if (s% star_age*secyer > secday) then
hist_xaxis_name = 'star_age_day'
else if (s% star_age*secyer > 60*60) then
hist_xaxis_name = 'star_age_hr'
Expand Down
8 changes: 4 additions & 4 deletions star/private/pgstar_support.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1980,7 +1980,7 @@ subroutine show_age_pgstar(s)
age = age*secyer/(60*60)
units_str = 'hrs'
else if (s% pg% pgstar_show_age_in_days) then
age = age*secyer/(60*60*24)
age = age*secyer/secday
units_str = 'days'
else if (s% pg% pgstar_show_age_in_years) then
!age = age
Expand All @@ -1994,11 +1994,11 @@ subroutine show_age_pgstar(s)
else if (age*secyer < 60*60) then
age = age*secyer/60
units_str = 'mins'
else if (age*secyer < 60*60*24) then
else if (age*secyer < secday) then
age = age*secyer/(60*60)
units_str = 'hrs'
else if (age*secyer < 60*60*24*500) then
age = age*secyer/(60*60*24)
else if (age*secyer < secday*500) then
age = age*secyer/secday
units_str = 'days'
else
!age = age
Expand Down
2 changes: 1 addition & 1 deletion star/private/profile_getval.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2153,7 +2153,7 @@ subroutine getval_for_profile(s, c, k, val, int_flag, int_val)
if (s% calculate_Brunt_N2) val = sqrt(max(0d0,s% brunt_N2(k)))
case (p_brunt_frequency) ! cycles per day
if (s% calculate_Brunt_N2) val = &
(24d0*60d0*60d0/(2*pi))*sqrt(max(0d0,s% brunt_N2(k)))
(secday/(2*pi))*sqrt(max(0d0,s% brunt_N2(k)))
case (p_log_brunt_N)
if (s% calculate_Brunt_N2) val = safe_log10(sqrt(max(0d0,s% brunt_N2(k))))
case (p_log_brunt_N2)
Expand Down
4 changes: 2 additions & 2 deletions star/private/report.f90
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ subroutine do_report(s, ierr)
! s% time is in seconds
s% star_age = s% time/secyer
s% time_years = s% time/secyer
s% time_days = s% time/dble(60*60*24)
s% time_days = s% time/secday
if ( s% model_number <= 0 ) then
s% star_age = 0d0
s% time_days = 0d0
Expand All @@ -236,7 +236,7 @@ subroutine do_report(s, ierr)
! s% dt is in seconds
s% time_step = s% dt/secyer ! timestep in years
s% dt_years = s% dt/secyer
s% dt_days = s% dt/dble(60*60*24)
s% dt_days = s% dt/secday

mstar = s% mstar
s% star_mass = mstar/Msun ! stellar mass in solar units
Expand Down
6 changes: 3 additions & 3 deletions star/test_suite/ccsn_IIp/src/run_star_extras.f90
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ end subroutine set_nico_mass
subroutine create_sedona_Lbol_file()

integer, parameter :: num_times = 205, num_freq = 2999, & ! from 1st line of sedona data
secperday = 24*60*60, io1 = 34, io2 = 35
io1 = 34, io2 = 35
integer :: j, k, ierr, n
real(dp) :: Lbol, time0, freq_i00, Lnu_i00, time, freq_im1, Lnu_im1
character (len=256) :: file_in, file_out
Expand Down Expand Up @@ -399,7 +399,7 @@ subroutine create_sedona_Lbol_file()
Lbol = Lbol + 0.5d0*(Lnu_i00 + Lnu_im1)*(freq_i00 - freq_im1)
end do
if (Lbol > 0d0) then
write(io2,'(f8.2,f10.4)') time0/secperday, log10(Lbol)
write(io2,'(f8.2,f10.4)') time0/secday, log10(Lbol)
n = n+1
end if
end do
Expand Down Expand Up @@ -905,7 +905,7 @@ subroutine data_for_extra_history_columns(id, n, names, vals, ierr)
end do
open(newunit=iounit,file='tau100_L.data', &
status="unknown",form='formatted',position="append")
write(iounit,*) s% time/(24*60*60), vals(5), vals(6)
write(iounit,*) s% time/secday, vals(5), vals(6)
close(iounit)

end subroutine data_for_extra_history_columns
Expand Down
2 changes: 1 addition & 1 deletion stella/res/stella_extras.f90
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ program main
write(*,*) 'eta', k, eta, logT, logRho, n_Fe
call mesa_error(__FILE__,__LINE__)
end if
time_sec = time*60*60*24
time_sec = time*secday
tau_sob = pi*qe*qe/(me*clight)*n_Fe*eta*f*time_sec*lambda0

if ((tau_sob > tau_sob_lo .or. k==2) .and. v_sob_lo_tau == 0d0) then
Expand Down

0 comments on commit 950a4e5

Please sign in to comment.