Skip to content

Conversation

@pmocz
Copy link
Member

@pmocz pmocz commented Jul 15, 2025

meant to replace: #786

Todo:

  • update changelog
  • move rest of custom things out of run_stars_extras.f90
  • add new colors options to rsp tests, which used to use old colors?
  • add table caching (for future PR)

@pmocz pmocz changed the title [ci skip] new branch with clean history new colors branch with clean history Jul 15, 2025
@pmocz pmocz requested a review from rsmolec as a code owner July 16, 2025 20:31
Comment on lines 364 to 365
character(len=strlen) :: color_file_names !(max_num_color_files)
integer :: color_num_colors !(max_num_bcs_per_file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still use this variable at all, and it really is now scalar instead of array? Or should we just delete it entirely?

Suggested change
character(len=strlen) :: color_file_names !(max_num_color_files)
integer :: color_num_colors !(max_num_bcs_per_file)

Comment on lines 500 to 508
min_dist = ABS(x_val - x_grid(1))
i_x = 1
DO i = 2, SIZE(x_grid)
dist = ABS(x_val - x_grid(i))
IF (dist < min_dist) THEN
min_dist = dist
i_x = i
END IF
END DO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the Fortran instrinsic MINLOC here? Something like

Suggested change
min_dist = ABS(x_val - x_grid(1))
i_x = 1
DO i = 2, SIZE(x_grid)
dist = ABS(x_val - x_grid(i))
IF (dist < min_dist) THEN
min_dist = dist
i_x = i
END IF
END DO
i_x = MINLOC(ABS(x_val - x_grid))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I have changed this. Thank you

FUNCTION h00(t) RESULT(h)
REAL(dp), INTENT(IN) :: t
REAL(dp) :: h
h = 2.0_dp*t**3 - 3.0_dp*t**2 + 1.0_dp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For bit-for-bit reproducibility, use pow or powN from our math_lib, or just write the multiplications out explicitly. E.g.

Suggested change
h = 2.0_dp*t**3 - 3.0_dp*t**2 + 1.0_dp
h = 2.0_dp*t*t*t - 3.0_dp*t*t + 1.0_dp

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you I did not know that

@rhdtownsend
Copy link
Contributor

Many of the DEALLOCATE statements at the end of routines are superfluous -- allocatable arrays that are allocated inside a routine are automatically deallocated on exit (unless they are dummy arguments).

self.ax.set_ylim(self.ylim)
plt.tight_layout()

def parse_inlist_file(self, inlist_path="../inlist_colors"):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is already defined above in the class? Is this re-definition needed/used?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a mistake as I was working to remove pandas dependency. I have changed this now.

@pmocz pmocz merged commit 3e9dac6 into main Sep 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants