Skip to content

Commit

Permalink
Merge pull request #731 from MESAHub/chore/pmocz/format
Browse files Browse the repository at this point in the history
implicit save and floating point literal gotchas
  • Loading branch information
pmocz authored Sep 6, 2024
2 parents 0e84b02 + 08b31d7 commit 9cd0805
Show file tree
Hide file tree
Showing 35 changed files with 163 additions and 163 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
4 changes: 2 additions & 2 deletions auto_diff/private/auto_diff_real_15var_order1_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,14 @@ subroutine assign_from_real_dp(this, other)
type(auto_diff_real_15var_order1), intent(out) :: this
real(dp), intent(in) :: other
this%val = other
this%d1Array = 0_dp
this%d1Array = 0.0_dp
end subroutine assign_from_real_dp

subroutine assign_from_int(this, other)
type(auto_diff_real_15var_order1), intent(out) :: this
integer, intent(in) :: other
this%val = other
this%d1Array = 0_dp
this%d1Array = 0.0_dp
end subroutine assign_from_int

function equal_self(this, other) result(z)
Expand Down
6 changes: 3 additions & 3 deletions auto_diff/private/auto_diff_real_1var_order1_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,14 @@ subroutine assign_from_real_dp(this, other)
type(auto_diff_real_1var_order1), intent(out) :: this
real(dp), intent(in) :: other
this%val = other
this%d1val1 = 0_dp
this%d1val1 = 0.0_dp
end subroutine assign_from_real_dp

subroutine assign_from_int(this, other)
type(auto_diff_real_1var_order1), intent(out) :: this
integer, intent(in) :: other
this%val = other
this%d1val1 = 0_dp
this%d1val1 = 0.0_dp
end subroutine assign_from_int

function equal_self(this, other) result(z)
Expand Down Expand Up @@ -1294,7 +1294,7 @@ function differentiate_auto_diff_real_1var_order1_1(this) result(derivative)
type(auto_diff_real_1var_order1), intent(in) :: this
type(auto_diff_real_1var_order1) :: derivative
derivative%val = this%d1val1
derivative%d1val1 = 0_dp
derivative%d1val1 = 0.0_dp
end function differentiate_auto_diff_real_1var_order1_1

end module auto_diff_real_1var_order1_module
16 changes: 8 additions & 8 deletions auto_diff/private/auto_diff_real_2var_order1_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -379,16 +379,16 @@ subroutine assign_from_real_dp(this, other)
type(auto_diff_real_2var_order1), intent(out) :: this
real(dp), intent(in) :: other
this%val = other
this%d1val1 = 0_dp
this%d1val2 = 0_dp
this%d1val1 = 0.0_dp
this%d1val2 = 0.0_dp
end subroutine assign_from_real_dp

subroutine assign_from_int(this, other)
type(auto_diff_real_2var_order1), intent(out) :: this
integer, intent(in) :: other
this%val = other
this%d1val1 = 0_dp
this%d1val2 = 0_dp
this%d1val1 = 0.0_dp
this%d1val2 = 0.0_dp
end subroutine assign_from_int

function equal_self(this, other) result(z)
Expand Down Expand Up @@ -1511,16 +1511,16 @@ function differentiate_auto_diff_real_2var_order1_1(this) result(derivative)
type(auto_diff_real_2var_order1), intent(in) :: this
type(auto_diff_real_2var_order1) :: derivative
derivative%val = this%d1val1
derivative%d1val1 = 0_dp
derivative%d1val2 = 0_dp
derivative%d1val1 = 0.0_dp
derivative%d1val2 = 0.0_dp
end function differentiate_auto_diff_real_2var_order1_1

function differentiate_auto_diff_real_2var_order1_2(this) result(derivative)
type(auto_diff_real_2var_order1), intent(in) :: this
type(auto_diff_real_2var_order1) :: derivative
derivative%val = this%d1val2
derivative%d1val1 = 0_dp
derivative%d1val2 = 0_dp
derivative%d1val1 = 0.0_dp
derivative%d1val2 = 0.0_dp
end function differentiate_auto_diff_real_2var_order1_2

end module auto_diff_real_2var_order1_module
32 changes: 16 additions & 16 deletions auto_diff/private/auto_diff_real_2var_order2_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -385,22 +385,22 @@ subroutine assign_from_real_dp(this, other)
type(auto_diff_real_2var_order2), intent(out) :: this
real(dp), intent(in) :: other
this%val = other
this%d1val1 = 0_dp
this%d1val2 = 0_dp
this%d2val1 = 0_dp
this%d1val1_d1val2 = 0_dp
this%d2val2 = 0_dp
this%d1val1 = 0.0_dp
this%d1val2 = 0.0_dp
this%d2val1 = 0.0_dp
this%d1val1_d1val2 = 0.0_dp
this%d2val2 = 0.0_dp
end subroutine assign_from_real_dp

subroutine assign_from_int(this, other)
type(auto_diff_real_2var_order2), intent(out) :: this
integer, intent(in) :: other
this%val = other
this%d1val1 = 0_dp
this%d1val2 = 0_dp
this%d2val1 = 0_dp
this%d1val1_d1val2 = 0_dp
this%d2val2 = 0_dp
this%d1val1 = 0.0_dp
this%d1val2 = 0.0_dp
this%d2val1 = 0.0_dp
this%d1val1_d1val2 = 0.0_dp
this%d2val2 = 0.0_dp
end subroutine assign_from_int

function equal_self(this, other) result(z)
Expand Down Expand Up @@ -1969,9 +1969,9 @@ function differentiate_auto_diff_real_2var_order2_1(this) result(derivative)
derivative%val = this%d1val1
derivative%d1val1 = this%d2val1
derivative%d1val2 = this%d1val1_d1val2
derivative%d2val1 = 0_dp
derivative%d1val1_d1val2 = 0_dp
derivative%d2val2 = 0_dp
derivative%d2val1 = 0.0_dp
derivative%d1val1_d1val2 = 0.0_dp
derivative%d2val2 = 0.0_dp
end function differentiate_auto_diff_real_2var_order2_1

function differentiate_auto_diff_real_2var_order2_2(this) result(derivative)
Expand All @@ -1980,9 +1980,9 @@ function differentiate_auto_diff_real_2var_order2_2(this) result(derivative)
derivative%val = this%d1val2
derivative%d1val1 = this%d1val1_d1val2
derivative%d1val2 = this%d2val2
derivative%d2val1 = 0_dp
derivative%d1val1_d1val2 = 0_dp
derivative%d2val2 = 0_dp
derivative%d2val1 = 0.0_dp
derivative%d1val1_d1val2 = 0.0_dp
derivative%d2val2 = 0.0_dp
end function differentiate_auto_diff_real_2var_order2_2

end module auto_diff_real_2var_order2_module
52 changes: 26 additions & 26 deletions auto_diff/private/auto_diff_real_2var_order3_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -393,30 +393,30 @@ subroutine assign_from_real_dp(this, other)
type(auto_diff_real_2var_order3), intent(out) :: this
real(dp), intent(in) :: other
this%val = other
this%d1val1 = 0_dp
this%d1val2 = 0_dp
this%d2val1 = 0_dp
this%d1val1_d1val2 = 0_dp
this%d2val2 = 0_dp
this%d3val1 = 0_dp
this%d2val1_d1val2 = 0_dp
this%d1val1_d2val2 = 0_dp
this%d3val2 = 0_dp
this%d1val1 = 0.0_dp
this%d1val2 = 0.0_dp
this%d2val1 = 0.0_dp
this%d1val1_d1val2 = 0.0_dp
this%d2val2 = 0.0_dp
this%d3val1 = 0.0_dp
this%d2val1_d1val2 = 0.0_dp
this%d1val1_d2val2 = 0.0_dp
this%d3val2 = 0.0_dp
end subroutine assign_from_real_dp

subroutine assign_from_int(this, other)
type(auto_diff_real_2var_order3), intent(out) :: this
integer, intent(in) :: other
this%val = other
this%d1val1 = 0_dp
this%d1val2 = 0_dp
this%d2val1 = 0_dp
this%d1val1_d1val2 = 0_dp
this%d2val2 = 0_dp
this%d3val1 = 0_dp
this%d2val1_d1val2 = 0_dp
this%d1val1_d2val2 = 0_dp
this%d3val2 = 0_dp
this%d1val1 = 0.0_dp
this%d1val2 = 0.0_dp
this%d2val1 = 0.0_dp
this%d1val1_d1val2 = 0.0_dp
this%d2val2 = 0.0_dp
this%d3val1 = 0.0_dp
this%d2val1_d1val2 = 0.0_dp
this%d1val1_d2val2 = 0.0_dp
this%d3val2 = 0.0_dp
end subroutine assign_from_int

function equal_self(this, other) result(z)
Expand Down Expand Up @@ -3317,10 +3317,10 @@ function differentiate_auto_diff_real_2var_order3_1(this) result(derivative)
derivative%d2val1 = this%d3val1
derivative%d1val1_d1val2 = this%d2val1_d1val2
derivative%d2val2 = this%d1val1_d2val2
derivative%d3val1 = 0_dp
derivative%d2val1_d1val2 = 0_dp
derivative%d1val1_d2val2 = 0_dp
derivative%d3val2 = 0_dp
derivative%d3val1 = 0.0_dp
derivative%d2val1_d1val2 = 0.0_dp
derivative%d1val1_d2val2 = 0.0_dp
derivative%d3val2 = 0.0_dp
end function differentiate_auto_diff_real_2var_order3_1

function differentiate_auto_diff_real_2var_order3_2(this) result(derivative)
Expand All @@ -3332,10 +3332,10 @@ function differentiate_auto_diff_real_2var_order3_2(this) result(derivative)
derivative%d2val1 = this%d2val1_d1val2
derivative%d1val1_d1val2 = this%d1val1_d2val2
derivative%d2val2 = this%d3val2
derivative%d3val1 = 0_dp
derivative%d2val1_d1val2 = 0_dp
derivative%d1val1_d2val2 = 0_dp
derivative%d3val2 = 0_dp
derivative%d3val1 = 0.0_dp
derivative%d2val1_d1val2 = 0.0_dp
derivative%d1val1_d2val2 = 0.0_dp
derivative%d3val2 = 0.0_dp
end function differentiate_auto_diff_real_2var_order3_2

end module auto_diff_real_2var_order3_module
48 changes: 24 additions & 24 deletions auto_diff/private/auto_diff_real_4var_order1_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -393,20 +393,20 @@ subroutine assign_from_real_dp(this, other)
type(auto_diff_real_4var_order1), intent(out) :: this
real(dp), intent(in) :: other
this%val = other
this%d1val1 = 0_dp
this%d1val2 = 0_dp
this%d1val3 = 0_dp
this%d1val4 = 0_dp
this%d1val1 = 0.0_dp
this%d1val2 = 0.0_dp
this%d1val3 = 0.0_dp
this%d1val4 = 0.0_dp
end subroutine assign_from_real_dp

subroutine assign_from_int(this, other)
type(auto_diff_real_4var_order1), intent(out) :: this
integer, intent(in) :: other
this%val = other
this%d1val1 = 0_dp
this%d1val2 = 0_dp
this%d1val3 = 0_dp
this%d1val4 = 0_dp
this%d1val1 = 0.0_dp
this%d1val2 = 0.0_dp
this%d1val3 = 0.0_dp
this%d1val4 = 0.0_dp
end subroutine assign_from_int

function equal_self(this, other) result(z)
Expand Down Expand Up @@ -1693,40 +1693,40 @@ function differentiate_auto_diff_real_4var_order1_1(this) result(derivative)
type(auto_diff_real_4var_order1), intent(in) :: this
type(auto_diff_real_4var_order1) :: derivative
derivative%val = this%d1val1
derivative%d1val1 = 0_dp
derivative%d1val2 = 0_dp
derivative%d1val3 = 0_dp
derivative%d1val4 = 0_dp
derivative%d1val1 = 0.0_dp
derivative%d1val2 = 0.0_dp
derivative%d1val3 = 0.0_dp
derivative%d1val4 = 0.0_dp
end function differentiate_auto_diff_real_4var_order1_1

function differentiate_auto_diff_real_4var_order1_2(this) result(derivative)
type(auto_diff_real_4var_order1), intent(in) :: this
type(auto_diff_real_4var_order1) :: derivative
derivative%val = this%d1val2
derivative%d1val1 = 0_dp
derivative%d1val2 = 0_dp
derivative%d1val3 = 0_dp
derivative%d1val4 = 0_dp
derivative%d1val1 = 0.0_dp
derivative%d1val2 = 0.0_dp
derivative%d1val3 = 0.0_dp
derivative%d1val4 = 0.0_dp
end function differentiate_auto_diff_real_4var_order1_2

function differentiate_auto_diff_real_4var_order1_3(this) result(derivative)
type(auto_diff_real_4var_order1), intent(in) :: this
type(auto_diff_real_4var_order1) :: derivative
derivative%val = this%d1val3
derivative%d1val1 = 0_dp
derivative%d1val2 = 0_dp
derivative%d1val3 = 0_dp
derivative%d1val4 = 0_dp
derivative%d1val1 = 0.0_dp
derivative%d1val2 = 0.0_dp
derivative%d1val3 = 0.0_dp
derivative%d1val4 = 0.0_dp
end function differentiate_auto_diff_real_4var_order1_3

function differentiate_auto_diff_real_4var_order1_4(this) result(derivative)
type(auto_diff_real_4var_order1), intent(in) :: this
type(auto_diff_real_4var_order1) :: derivative
derivative%val = this%d1val4
derivative%d1val1 = 0_dp
derivative%d1val2 = 0_dp
derivative%d1val3 = 0_dp
derivative%d1val4 = 0_dp
derivative%d1val1 = 0.0_dp
derivative%d1val2 = 0.0_dp
derivative%d1val3 = 0.0_dp
derivative%d1val4 = 0.0_dp
end function differentiate_auto_diff_real_4var_order1_4

end module auto_diff_real_4var_order1_module
4 changes: 2 additions & 2 deletions auto_diff/private/auto_diff_real_star_order1_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,14 @@ subroutine assign_from_real_dp(this, other)
type(auto_diff_real_star_order1), intent(out) :: this
real(dp), intent(in) :: other
this%val = other
this%d1Array = 0_dp
this%d1Array = 0.0_dp
end subroutine assign_from_real_dp

subroutine assign_from_int(this, other)
type(auto_diff_real_star_order1), intent(out) :: this
integer, intent(in) :: other
this%val = other
this%d1Array = 0_dp
this%d1Array = 0.0_dp
end subroutine assign_from_int

function equal_self(this, other) result(z)
Expand Down
Loading

0 comments on commit 9cd0805

Please sign in to comment.