Replies: 10 comments 9 replies
-
@mvertens , thanks for opening the issue. Just as a comment, I fear the line length issue fixed in #293 was stemming from emacs auto-indention and line arrangements - such issues need to be avoided, if we go this route. |
Beta Was this translation helpful? Give feedback.
-
@jmaerz - this was my mistake in compressing lines. This was not emacs auto-indent. Sorry about that. |
Beta Was this translation helpful? Give feedback.
-
Hi @JorgSchwinger, @TomasTorsvik , any further thoughts on this? - I am asking since the initial idea was that some code cleanup would be nice to have for the final CMIP6-compatible iHAMOCC version - as a starting point for the merging process of |
Beta Was this translation helpful? Give feedback.
-
I think I can get emacs to do the type of do-loop indentation that @JorgSchwinger wants. I just need to prototype it. |
Beta Was this translation helpful? Give feedback.
-
I am not insisting on the specific do-loop style. This was how the HAMOCC code was originally written - I got very used to it and think it makes some sense - but we can abandon it. (BLOM has something similar though, where certain do-loops are not indented) Regarding the automated stuff, I would be worried a bit about indentation of continuation lines. These are often not following a standard indentation for a good reason - to vertically align with lines above. This really increases readability a lot. I fear this will be lost with the automatic procedure? |
Beta Was this translation helpful? Give feedback.
-
Here a compiled list of thoughts provoked by #299:
I guess, I didn't know, how much I would appreciate some code cosmetics :-D In the course of the code maintenance, we can potentially also think about rewriting some of the last subroutine files into module files, while I would opt for keeping the the name and number of files (just add a I just talked to @JorgSchwinger, further suggestions on his side:
Link to former iHAMOCC coding practice: https://github.com/NorESMhub/BLOM/blob/master/doc/coding-guidelines.rst - which can then be updated accordingly. |
Beta Was this translation helpful? Give feedback.
-
@mvertens , @JorgSchwinger , @TomasTorsvik , after talking to @JorgSchwinger and as suggested by @mvertens , it would be good to have a zoom-meeting next week on i) regression testing and, after opening the can of worms with iHAMOCC coding style ii) some coding style practice. Since from the iHAMOCC side, we are almost ready for NorESM2.1 that just contains bugfixes (once merging current |
Beta Was this translation helpful? Give feedback.
-
I have prototyped a simple first pass through of emacs auto-indenting (which took about 1 minute to be carried out). If you want to look at it before the call see - https://github.com/mvertens/BLOM/tree/feature/new_formatting. |
Beta Was this translation helpful? Give feedback.
-
Hi, I opened a draft PR as a starting point for capital versus small letters in Fortran code, see: #304 |
Beta Was this translation helpful? Give feedback.
-
@matsbn - I have reformatted the HAMOCC code to have all subroutines in modules and to have all the code be indented coherently as well as be F90 compliant. I am wondering if I could take on doing the same thing in the rest of the BLOM code. It took be about a day to do this for HAMOCC and I think it would only take me a day or so to do it for BLOM. It would be nice to have everything consistent across the BLOM code if possible. Please let me know what you think. |
Beta Was this translation helpful? Give feedback.
-
@JorgSchwinger - it is possible to auto-indent all of blom or just the hamocc part of blom with emacs.
For example - see https://unix.stackexchange.com/questions/162057/can-i-have-emacs-automatically-indent-my-whole-code-after-it-is-all-written. Emacs can also be run through every file offline in a script to do this. This was actually done for ww3 recently as part of a big reformatting effort.
There might be a way to have the do loop structure in place that you want - but I'm not sure how to do it. The nice thing about the emacs capability is that it could keep the code indented consistently without a lot of extra work.
Beta Was this translation helpful? Give feedback.
All reactions