mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Fix detachment in implicit

Open matthiasfabry opened this issue 2 years ago • 8 comments

allows b% other_implicit_function_to_solve to signal that the binary is detached, so b% check_implicit_rlo can take action accordingly

matthiasfabry avatar Oct 10 '22 08:10 matthiasfabry

I don't want to pick on this PR as "wrong" (it's not!) but there's a general cosmetic point that I don't think we've discussed and possibly should.

The only actual change in binary/other/mod_other_implicit_rlo.f90 seems to be the addition of the detached logical argument. Pretty much the whole file is marked as changed, though, I think only because of the change to indentation. I don't think we have strict style here but it's hard to see what's actually changed when so much is just indents.

warrickball avatar Oct 10 '22 08:10 warrickball

@matthiasfabry can you see if your editor can be configured to use https://editorconfig.org/ then you can point it at https://github.com/MESAHub/mesa/blob/main/.editorconfig which sets our indentation style. Or just make sure its set to 3 spaces per indentation.

rjfarmer avatar Oct 10 '22 08:10 rjfarmer

@matthiasfabry can you see if your editor can be configured to use https://editorconfig.org/ then you can point it at https://github.com/MESAHub/mesa/blob/main/.editorconfig which sets our indentation style. Or just make sure its set to 3 spaces per indentation.

I suspect a lot of existing code doesn't adhere to this style, either... I personally favour just leaving things until a lot of code in a particular area is overhauled. I don't want to bike-shed over this but it does bury the meaningful changes in minor ones.

warrickball avatar Oct 10 '22 08:10 warrickball

the diff view allows to hide whitespace changes, which clears up a lot! But yes, spacing should be addressed I believe. Eg. why do all module declarations start with 6 spaces? With the fortran standard of 80 characters per line, that's nearly 10% of your space gone. Nearly all of the spacing changes in files is my formatter removing those leading 6 spaces.

@rjfarmer I do use the .editorconfig, however it says nothing on indentation

matthiasfabry avatar Oct 10 '22 08:10 matthiasfabry

the diff view allows to hide whitespace changes, which clears up a lot!

Aha! I wasn't aware of that option. Thanks!

warrickball avatar Oct 10 '22 08:10 warrickball

the diff view allows to hide whitespace changes, which clears up a lot! But yes, spacing should be addressed I believe. Eg. why do all module declarations start with 6 spaces? With the fortran standard of 80 characters per line, that's nearly 10% of your space gone. Nearly all of the spacing changes in files is my formatter removing those leading 6 spaces.

Fixed form fortran requires things to start in column 6, though we do use free-form fortran we never really changed that style point.

rjfarmer avatar Oct 10 '22 08:10 rjfarmer

I think it would be better for us to adopt a practice of avoiding commits with many lines of superficial whitespace changes. Can you configure your editor to not auto-format files when you're making small changes?

evbauer avatar Oct 14 '22 16:10 evbauer

Of course. For this small a PR, I've reverted some commits. Although I would like to see the dev team pushing to a more modern free-form Fortran indentation style. I'm sure there must be tools out there to reformat the whole .f90 codebase this way. (edit) As a matter of fact, It seems my IDE is able to do this.

matthiasfabry avatar Oct 17 '22 08:10 matthiasfabry

Is it just me or did this break jdot_gr_check and star_plus_point_mass?

warrickball avatar Dec 15 '22 11:12 warrickball

I can reproduce locally, checking now

orlox avatar Dec 15 '22 12:12 orlox

Our cluster is back up and I'll work through some compilation failures with ifort.

warrickball avatar Dec 15 '22 12:12 warrickball

Just a clarification, I meant that I locally reproduced the problem so it is real. Looking for a fix now.

orlox avatar Dec 15 '22 14:12 orlox

fix commited!

orlox avatar Dec 16 '22 11:12 orlox