NOAA-GFDL / SIS2

NOAA-GFDL's Sea Ice Simulator version 2
Other
16 stars 43 forks source link

Parameter doc files are inconsistently formatted with PGI #120

Closed adcroft closed 4 years ago

adcroft commented 4 years ago

gnu and intel produce consistent output but the PGI compiler has started leading to diffs, e.g.:

diff --git a/ice_ocean_SIS2/Baltic/SIS_parameter_doc.all b/ice_ocean_SIS2/Baltic/SIS_parameter_doc.all
index 54c7c2e..e612345 100644
--- a/ice_ocean_SIS2/Baltic/SIS_parameter_doc.all
+++ b/ice_ocean_SIS2/Baltic/SIS_parameter_doc.all
@@ -265,15 +265,13 @@ ICE_THICKNESS_INIT_CONFIG = "data_override" ! default = "data_override"
                                 ! initialized for a new run:
                                 !     file - read sea ice concentrations from a specified file
                                 !     data_override - use the data_override capability or zero everywhere
-                                !     uniform - sea ice has uniform thickness where the concentration is
-                                !       nonzero.
+                                !     uniform - sea ice has uniform thickness where the concentration is nonzero.
 SNOW_THICKNESS_INIT_CONFIG = "data_override" ! default = "data_override"
                                 ! A string that determines how the initial total sea ice concentration is
                                 ! initialized for a new run:
                                 !     file - read sea ice concentrations from a specified file
                                 !     data_override - use the data_override capability or zero everywhere
-                                !     uniform - sea ice has uniform thickness where the concentration is
-                                !       nonzero.
+                                !     uniform - sea ice has uniform thickness where the concentration is nonzero.
 ICE_SALINITY_INIT_CONFIG = "uniform" ! default = "uniform"
                                 ! A string that determines how the sea ice salinity is initialized for a new
                                 ! run:

I have not had a chance to figure when the divergence happened.

marshallward commented 4 years ago

Lots of \t and \n in these line length calculations, and AFAIK it's nonstandard to convert those into ASCII codes. (Gfortran only does it if you enable certain flags).

Hallberg-NOAA commented 4 years ago

The problem seems to be that the len_trim intrinsic function gives different lengths for on tabs on different compilers. We are taking this into account when we replace tabs with a pair of spaces before writing messages in writeMessageAndDesc, at line 526 in MOM_document.F90. But we are not taking this into account when we determine where to automatically set new-lines on lines 502 and 506 of the same file.

For SIS2, this issue of non-reproducing documentation across compiler is being corrected in a PR that will come shortly by explicitly replacing the tabs in the offending parameter descriptions with two spaces, but there should also be modifications made in MOM_document.F90.

Hallberg-NOAA commented 4 years ago

This issue has been addressed by https://github.com/NOAA-GFDL/MOM6/pull/1124.