Skip to content

Commit

Permalink
change debug param name all to dbg for more consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
pmocz committed Sep 6, 2024
1 parent 079f2d7 commit 08b31d7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 42 deletions.
10 changes: 5 additions & 5 deletions atm/private/atm_table.f90
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ subroutine eval_table( &
real(dp), intent(out) :: dlnP_dlnkap
integer, intent(out) :: ierr

logical, parameter :: DBG = .FALSE.
logical, parameter :: dbg = .false.

real(dp) :: g
real(dp) :: logg
Expand Down Expand Up @@ -125,14 +125,14 @@ subroutine eval_table( &

! Perform the table lookup

if (DBG) write(*,*) 'call get_table_values', id
if (dbg) write(*,*) 'call get_table_values', id
call get_table_values( &
id, Z, logg, Teff, &
Pgas, dPgas_dTeff, dPgas_dlogg, &
T, dT_dTeff, dT_dlogg, &
ierr)
if (ierr /= 0) then
if (DBG) write(*,*) 'get_table_values(_at_fixed_Z) ierr', ierr
if (dbg) write(*,*) 'get_table_values(_at_fixed_Z) ierr', ierr
return
end if

Expand Down Expand Up @@ -191,7 +191,7 @@ subroutine eval_table( &

endif

if (DBG .or. is_bad(lnP) .or. is_bad(lnT)) then
if (dbg .or. is_bad(lnP) .or. is_bad(lnT)) then
write(*,*) 'eval_table'
write(*,1) 'Teff', Teff
write(*,1) 'T', T
Expand Down Expand Up @@ -234,7 +234,7 @@ subroutine get_table_alfa_beta( &
integer, parameter :: BLEND_IN_Y = 4
integer, parameter :: BLEND_CORNER_OUT = 5

logical, parameter :: DBG = .FALSE.
logical, parameter :: dbg = .false.

real(dp) :: g
real(dp) :: logTeff
Expand Down
16 changes: 8 additions & 8 deletions star/private/overshoot.f90
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ subroutine add_overshooting (s, ierr)
type(star_info), pointer :: s
integer, intent(out) :: ierr

logical, parameter :: DEBUG = .FALSE.
logical, parameter :: dbg = .false.

integer :: i
integer :: j
Expand All @@ -79,7 +79,7 @@ subroutine add_overshooting (s, ierr)

ierr = 0

if (DEBUG) then
if (dbg) then
write(*, 3) 'add_overshooting; model, n_conv_bdy=', s%model_number, s%num_conv_boundaries
end if

Expand All @@ -90,7 +90,7 @@ subroutine add_overshooting (s, ierr)
! Skip this boundary if it's too close to the center

if (s%conv_bdy_q(i) < s%min_overshoot_q) then
if (DEBUG) then
if (dbg) then
write(*,*) 'skip since s%conv_bdy_q(i) < min_overshoot_q', i
endif
cycle conv_bdy_loop
Expand All @@ -100,7 +100,7 @@ subroutine add_overshooting (s, ierr)
! overshoot there

if (s%conv_bdy_loc(i) == 1) then
if (DEBUG) then
if (dbg) then
write(*,*) 'skip since s%conv_bdy_loc(i) == 1', i
endif
cycle conv_bdy_loop
Expand All @@ -127,7 +127,7 @@ subroutine add_overshooting (s, ierr)
s%burn_he_conv_region(i) .OR. &
s%burn_z_conv_region(i) )
case ('any')
match_zone_type = .TRUE.
match_zone_type = .true.
case default
write(*,*) 'Invalid overshoot_zone_type: j, s%overshoot_zone_type(j)=', j, s%overshoot_zone_type(j)
ierr = -1
Expand All @@ -142,7 +142,7 @@ subroutine add_overshooting (s, ierr)
case ('shell')
match_zone_loc = .NOT. is_core
case ('any')
match_zone_loc = .TRUE.
match_zone_loc = .true.
case default
write(*,*) 'Invalid overshoot_zone_loc: j, s%overshoot_zone_loc(j)=', j, s%overshoot_zone_loc(j)
ierr = -1
Expand All @@ -155,7 +155,7 @@ subroutine add_overshooting (s, ierr)
case ('top')
match_bdy_loc = s%top_conv_bdy(i)
case ('any')
match_bdy_loc = .TRUE.
match_bdy_loc = .true.
case default
write(*,*) 'Invalid overshoot_bdy_loc: j, s%overshoot_bdy_loc(j)=', j, s%overshoot_bdy_loc(j)
ierr = -1
Expand All @@ -164,7 +164,7 @@ subroutine add_overshooting (s, ierr)

if (.NOT. (match_zone_type .AND. match_zone_loc .AND. match_bdy_loc)) cycle criteria_loop

if (DEBUG) then
if (dbg) then
write(*,*) 'Overshooting at convective boundary: i, j=', i, j
write(*,*) ' s%overshoot_scheme=', TRIM(s%overshoot_scheme(j))
write(*,*) ' s%overshoot_zone_type=', TRIM(s%overshoot_zone_type(j))
Expand Down
50 changes: 25 additions & 25 deletions star/private/predictive_mix.f90
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ subroutine add_predictive_mixing (s, ierr)
type(star_info), pointer :: s
integer, intent(out) :: ierr

logical, parameter :: DEBUG = .FALSE.
logical, parameter :: dbg = .false.

integer :: i
integer :: j
Expand All @@ -71,22 +71,22 @@ subroutine add_predictive_mixing (s, ierr)

ierr = 0

if (DEBUG) then
if (dbg) then
write(*, *) 'add_predictive_mixing; model, n_conv_bdy=', &
s%model_number, s%num_conv_boundaries
end if

! Loop over convective boundaries, from center to surface

mix_mask = .FALSE.
mix_mask = .false.

conv_bdy_loop : do i = 1, s%num_conv_boundaries

! Skip this boundary if it's at the surface, since we don't
! predictively mix there

if (s%conv_bdy_loc(i) == 1) then
if (DEBUG) then
if (dbg) then
write(*,*) 'skip since s%conv_bdy_loc(i) == 1', i
endif
cycle conv_bdy_loop
Expand All @@ -113,7 +113,7 @@ subroutine add_predictive_mixing (s, ierr)
s%burn_he_conv_region(i) .OR. &
s%burn_z_conv_region(i) )
case ('any')
match_zone_type = .TRUE.
match_zone_type = .true.
case default
write(*,*) 'Invalid predictive_zone_type: j, s%predictive_zone_type(j)=', j, s%predictive_zone_type(j)
ierr = -1
Expand All @@ -136,7 +136,7 @@ subroutine add_predictive_mixing (s, ierr)
case ('surf')
match_zone_loc = is_surf_zone
case ('any')
match_zone_loc = .TRUE.
match_zone_loc = .true.
case default
write(*,*) 'Invalid predictive_zone_loc: j, s%predictive_zone_loc(j)=', j, s%predictive_zone_loc(j)
ierr = -1
Expand All @@ -149,7 +149,7 @@ subroutine add_predictive_mixing (s, ierr)
case ('top')
match_bdy_loc = s%top_conv_bdy(i)
case ('any')
match_bdy_loc = .TRUE.
match_bdy_loc = .true.
case default
write(*,*) 'Invalid predictive_bdy_loc: j, s%predictive_bdy_loc(j)=', j, s%predictive_bdy_loc(j)
ierr = -1
Expand All @@ -161,7 +161,7 @@ subroutine add_predictive_mixing (s, ierr)
if (s%conv_bdy_q(i) < s%predictive_bdy_q_min(j) .OR. &
s%conv_bdy_q(i) > s%predictive_bdy_q_max(j)) cycle criteria_loop

if (DEBUG) then
if (dbg) then
write(*,*) 'Predictive mixing at convective boundary: i, j=', i, j
write(*,*) ' s%predictive_zone_type=', TRIM(s%predictive_zone_type(j))
write(*,*) ' s%predictive_zone_loc=', TRIM(s%predictive_zone_loc(j))
Expand Down Expand Up @@ -219,8 +219,8 @@ subroutine do_predictive_mixing (s, i, j, ierr, mix_mask)
integer, intent(out) :: ierr
logical, intent(inout) :: mix_mask(:)

logical, parameter :: DEBUG = .FALSE.
logical, parameter :: DUMP_PREDICTIONS = .FALSE.
logical, parameter :: dbg = .false.
logical, parameter :: DUMP_PREDICTIONS = .false.

real(dp) :: superad_thresh
real(dp) :: ingest_factor
Expand Down Expand Up @@ -330,7 +330,7 @@ subroutine do_predictive_mixing (s, i, j, ierr, mix_mask)

end if

if (DEBUG) then
if (dbg) then
if (k_bot_cz < s%nz) then
write(*,*) 'Predictive mixing: i, j, q_top, q_bot:', i, j, s%q(k_top_cz), s%q(k_bot_cz+1)
else
Expand Down Expand Up @@ -401,7 +401,7 @@ subroutine do_predictive_mixing (s, i, j, ierr, mix_mask)

if (.NOT. ALL(s%gradr(k_a:k_b) > s%grada_face(k_a:k_b))) then

ledoux_extension = .FALSE.
ledoux_extension = .false.

else

Expand All @@ -428,7 +428,7 @@ subroutine do_predictive_mixing (s, i, j, ierr, mix_mask)
if (iso_r /= 0) then

if (SIGN(1._dp, xa_mz_burn(iso_r)-xa_ez(iso_r)) /= SIGN(1._dp, xa_ez_burn(iso_r)-xa_ez(iso_r))) then
if (DEBUG) then
if (dbg) then
write(*,*) 'Exiting predictive search due to abundance reversal'
end if
exit search_loop
Expand Down Expand Up @@ -457,7 +457,7 @@ subroutine do_predictive_mixing (s, i, j, ierr, mix_mask)
! If the mass ingested exceeds the limit, finish the search

if (m_ingest > m_ingest_limit) then
if (DEBUG) then
if (dbg) then
write(*,*) 'Exiting predictive search due to ingestion limit exceeded'
end if
exit search_loop
Expand All @@ -473,7 +473,7 @@ subroutine do_predictive_mixing (s, i, j, ierr, mix_mask)

if (( outward .AND. gradr(k_a) < grada(k_a)) .OR. &
(.NOT. outward .AND. gradr(k_b) < grada(k_b))) then
if (DEBUG) then
if (dbg) then
write(*,*) 'Exiting predictive search due to non-convective growing boundary'
endif
exit search_loop
Expand All @@ -491,7 +491,7 @@ subroutine do_predictive_mixing (s, i, j, ierr, mix_mask)
endif

if (superad_min <= superad_thresh) then
if (DEBUG) then
if (dbg) then
write(*,*) 'Exiting predictive search due to convection-zone split'
endif
exit search_loop
Expand Down Expand Up @@ -528,18 +528,18 @@ subroutine do_predictive_mixing (s, i, j, ierr, mix_mask)
end do
call mesa_error(__FILE__,__LINE__,'Double predictive')
else
mix_mask(k_top_mz:k_bot_mz) = .FALSE.
mix_mask(k_top_mz:k_bot_mz) = .false.
endif

! Return now if no additional mixing should occur

if (outward .AND. k_top_mz == k_top_cz) then
if (DEBUG) then
if (dbg) then
write(*,*) 'No predictive mixing at top of zone; boundary i=', i
endif
return
elseif (.NOT. outward .AND. k_bot_mz == k_bot_cz) then
if (DEBUG) then
if (dbg) then
write(*,*) 'No predictive mixing at bottom of zone; boundary i=', i
endif
return
Expand All @@ -553,7 +553,7 @@ subroutine do_predictive_mixing (s, i, j, ierr, mix_mask)
call eval_mixing_coeffs(s, k_bot_mz, k_top_mz, xa_mz_burn, &
k_a, k_b, D, vc, grada, gradr, ierr)
if (ierr /= 0) then
if (DEBUG) write(*,*) 'Non-zero return from eval_mixing_coeffs in do_predictive_mixing/predictive_mix'
if (dbg) write(*,*) 'Non-zero return from eval_mixing_coeffs in do_predictive_mixing/predictive_mix'
return
endif

Expand Down Expand Up @@ -638,7 +638,7 @@ subroutine do_predictive_mixing (s, i, j, ierr, mix_mask)

end if

if (DEBUG) then
if (dbg) then
write(*,*) 'Predictive mixing: i, k_a, k_b, q_a, q_b, superad_min=', i, k_a, k_b, s%q(k_a), s%q(k_b), &
superad_min
endif
Expand Down Expand Up @@ -709,7 +709,7 @@ subroutine eval_mixing_coeffs (s, k_bot_mz, k_top_mz, xa_mx, k_a, k_b, D, vc, gr
real(dp), intent(out) :: gradr(:)
integer, intent(out) :: ierr

logical, parameter :: DEBUG = .FALSE.
logical, parameter :: dbg = .false.

real(dp) :: xh
real(dp) :: xhe
Expand Down Expand Up @@ -912,7 +912,7 @@ subroutine eval_eos (s, k, z, x, abar, zbar, xa, &
real(dp), intent(out) :: d_dlnT(:)
integer, intent(out) :: ierr

logical, parameter :: DEBUG = .FALSE.
logical, parameter :: dbg = .false.
real(dp), parameter :: LOGRHO_TOL = 1E-8_dp
real(dp), parameter :: LOGPGAS_TOL = 1E-8_dp

Expand All @@ -924,15 +924,15 @@ subroutine eval_eos (s, k, z, x, abar, zbar, xa, &
! pressure are as specified in the model, but with abundances
! given by xa and other input abundance parameters

! (NEEDS FIXING TO HANDLE CASE WHEN LNPGAS_FLAG = .TRUE.)
! (NEEDS FIXING TO HANDLE CASE WHEN LNPGAS_FLAG = .true.)

call solve_eos_given_PgasT( &
s, k, xa, &
s%lnT(k)/ln10, s%lnPgas(k)/ln10, s%lnd(k)/ln10, LOGRHO_TOL, LOGPGAS_TOL, &
logRho, res, d_dlnd, d_dlnT, d_dxa, &
ierr)
if (ierr /= 0) then
if (DEBUG) write(*,*) 'Non-zero return from solve_eos_given_PgasT in eval_eos/predictive_mix'
if (dbg) write(*,*) 'Non-zero return from solve_eos_given_PgasT in eval_eos/predictive_mix'
return
endif

Expand Down
8 changes: 4 additions & 4 deletions star/private/pulse_utils.f90
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ subroutine set_segment_indices (s, k_a, k_b, include_last_face)
integer, allocatable, intent(out) :: k_b(:)
logical, intent(in) :: include_last_face

logical, parameter :: DEBUG = .FALSE.
logical, parameter :: dbg = .false.

real(dp) :: grad_mu(s%nz)
logical :: mask(s%nz)
Expand Down Expand Up @@ -102,13 +102,13 @@ subroutine set_segment_indices (s, k_a, k_b, include_last_face)

call qsort(i, s%nz, -ABS(grad_mu))

mask(i(n_mk+1:)) = .FALSE.
mask(i(n_mk+1:)) = .false.

endif

else

mask = .FALSE.
mask = .false.

endif

Expand All @@ -131,7 +131,7 @@ subroutine set_segment_indices (s, k_a, k_b, include_last_face)
sg = sg + 1
k_a(sg) = k

if (DEBUG) then
if (dbg) then
write(*, 100) k, grad_mu(k)
100 format('placing double point at k=', I6, 1X, '(grad_mu=', 1PE10.3, ')')
endif
Expand Down

0 comments on commit 08b31d7

Please sign in to comment.