Change all instances of !$ to !, unless followed by OMP#671
Conversation
|
@Whyborn I removed some that were directly interfering. The ones I removed were made by Vanessa Haverd. I hope a test shows this is bitwise comparable and I can confidently avoid having to review every instance over 26 files :) |
|
It will definitely be bitwise compatible in CABLE offline, as we don't set I asked for your review mainly because you may know some of the history as to why this was done in the past. There are some bits that look like they're true comments, some bits that looked like they have been used as debugging by misusing |
|
@Whyborn - You're right - there is no legitimate reason for it. In between CMIPs (so it had no meaning offline as you say) Vanessa added these comments which appeared simply to be her style. There was one instance where some of the !$ lines were a problem (I think it was in canopy), but then this seemed to go away again in another. Anyway, we're better off without them - oh I remember - I think - it was in trying to reproduce ESM1.5 behavior with ESM1.6 (all the since removed cable_runtime%esm15 switches and #IF def ESM15) but I don't think these lines were causing a difference in the output, I think it wasn't even getting that far, maybe the build even. It interpreted it as an OMP directive but then there was nothing valid following it. |
JhanSrbinovsky
left a comment
There was a problem hiding this comment.
There were even more of these! I only got rid of the ones that were interfering with whatever it was we were doing at the time (AM3/ESM1.6) From some of the comments I recognize that it was Vanessa Haverd that use "!$" as a comment - very annoying.
I hope that you can do a back to back. test and verify it is bitwise the same so I can confidently avoid reviewing 26 files :)
|
The benchcab run shows bitwise equivalence. The lines were causing issues when I tried a naive copy of the CABLE science files into JULES, as |
CABLE
Thank you for submitting a pull request to the CABLE Project.
Description
There were many instances where the "!$" sequence was misused as a regular comment. These lines are treated as code when certain directives are passed e.g.
-qopenmpas we do in the ACCESS-AM3 build. There are some lines which are truly OpenMP directives, and these lines are untouched. All other instances of '!$' are changed to be regular comments with '!'.@JhanSrbinovsky Do you know if this was ever used to contextually include code, through misuse of the
-qopenmpoption? If this was ever used for practical reasons, those bits should be moved to standard preprocessor directives.Fixes #670
Type of change
Please delete options that are not relevant.
Testing
📚 Documentation preview 📚: https://cable--671.org.readthedocs.build/en/671/