Skip to content

Commit 619e4f9

Browse files
authored
Stop trying to convert history values to ints (#555)
We would attempt to detect whether a extra history value was meant to be an int or a float. But this was error prone with very large values. Instead just treat everything as a float (given users can only provide values in floats anyway this should not change peoples results). Closes #354
1 parent 019cbd7 commit 619e4f9

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

docs/source/changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ thus the variable ``s% extra_pressure`` is now an ``auto_diff``
2121
and allows for the setting of the partial derivatives the
2222
pressure with respect to other variables.
2323

24+
run_star_extras
25+
---------------
26+
27+
Previously we had logic to determine if a extra history value should be saved
28+
as an int or a float (users can only provide data as a float). This was error
29+
prone, so now we save extra history values as floats.
30+
2431

2532

2633
Changes in r23.05.1

star/private/history.f90

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -484,17 +484,7 @@ subroutine do_extra_col(pass, j, col_offset)
484484
else if (pass == 2) then
485485
call do_name(j + col_offset, extra_col_names(j))
486486
else if (pass == 3) then
487-
if (abs(extra_col_vals(j)) < huge(int_val))then
488-
int_val = int(extra_col_vals(j))
489-
if (abs(extra_col_vals(j) - dble(int_val)) < &
490-
1d-10 * max(1d-10, abs(extra_col_vals(j)))) then
491-
call do_int_val(j + col_offset, int_val)
492-
else
493-
call do_val(j + col_offset, extra_col_vals(j))
494-
end if
495-
else
496-
call do_val(j + col_offset, extra_col_vals(j))
497-
end if
487+
call do_val(j + col_offset, extra_col_vals(j))
498488
end if
499489
end subroutine do_extra_col
500490

0 commit comments

Comments
 (0)