NCAR / obs2ioda

Converter developed by @jamiebresch to transform conventional and remote sensing observations in different formats to the IODA format needed in JEDI
4 stars 4 forks source link

Add standardized compiler flags for GNU and Intel with enhanced debugging options #21

Open amstokely opened 4 days ago

amstokely commented 4 days ago

This PR introduces standardized Fortran compiler flags tailored for the GNU and Intel compilers, enhancing both build consistency and debugging capability across all build types. The updates are as follows:

These flags standardize the compilation environment, making it easier for developers to catch issues, particularly in Debug builds where aggressive error-trapping is employed.

ibanos90 commented 4 days ago

Hi @amstokely, these are great additions! I wonder if we should update the instructions about how to build the code using these changes. Thanks!

amstokely commented 4 days ago

Hi @amstokely, these are great additions! I wonder if we should update the instructions about how to build the code using these changes. Thanks! I can update the README with instructions on how to compile in Debug/Release mode.

mgduda commented 4 days ago

@amstokely If I recall correctly the Fortran 2003 standard specifies a maximum of 132 columns for free-format source. Is there a specific reason for adding the -ffree-line-length-none flag to not enforce the standard limit?

Also, is pre-processing currently required for any Fortran source, and if not, is there a specific reason for adding -cpp / -fpp? An alternative would be to rename source files to use the .F90 suffix, which almost universally causes Fortran compilers to automatically pre-process the source. This might be preferable, as it wouldn't require adding compiler-specific flags for every Fortran compiler that we aim to support.

amstokely commented 3 days ago

@amstokely If I recall correctly the Fortran 2003 standard specifies a maximum of 132 columns for free-format source. Is there a specific reason for adding the -ffree-line-length-none flag to not enforce the standard limit?

Also, is pre-processing currently required for any Fortran source, and if not, is there a specific reason for adding -cpp / -fpp? An alternative would be to rename source files to use the .F90 suffix, which almost universally causes Fortran compilers to automatically pre-process the source. This might be preferable, as it wouldn't require adding compiler-specific flags for every Fortran compiler that we aim to support.

@mgduda -ffree-line-length-none was included in the original Makefile, which is why I included it here. I can remove this flag and see if it causes it any problems. That is good to know about using .F90 vs .f90 for enabling the preprocessor. I'll remove these flags for now and if I need to use the preprocessor in the future I'll try changing the file ext to .F90.