You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the cmake build system uses CMAKE_Fortran_FLAGS as default compiler options for all CAPS and SCHEMES. These options are added to the compiler options for individual files, because of the definition
set_target_properties(ccppphys PROPERTIES VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
COMPILE_FLAGS "${CMAKE_Fortran_FLAGS}"
LINK_FLAGS "${CMAKE_Fortran_FLAGS}")
Because of this, forcing certain compiler options (or removing them) for individual files does not work.
Example: in order to compile gfdl_fv_sat_adj.F90 with default real kind 4 with the GNU compilers, it is necessary to remove the "-fdefault-real-8" compiler option, which the current system doesn't allow. For Intel, this problem is overcome by adding "-real-size 32" to the compiler options for this file. When the compiler options are combined, "-real-size 32" ends up after "-real-size 64" and as such overwrites "-real-size 64". For the PGI compiler, this has not been tested yet.
The correct way to do this would be to specify default compiler options for all CAPS and SCHEMES before adjustments are made for individual files, and remove COMPILE_FLAGS and LINK_FLAGS fro the above code snippet.
The text was updated successfully, but these errors were encountered:
* New metadata for GP scheme.
* Removed redundant importing of kind_phys
* add units to index_for_diagnostic_printout metadata
* Bugfix in GP sampling routines.
grantfirl
added a commit
to grantfirl/ccpp-physics
that referenced
this issue
Sep 26, 2024
Currently, the cmake build system uses CMAKE_Fortran_FLAGS as default compiler options for all CAPS and SCHEMES. These options are added to the compiler options for individual files, because of the definition
Because of this, forcing certain compiler options (or removing them) for individual files does not work.
Example: in order to compile gfdl_fv_sat_adj.F90 with default real kind 4 with the GNU compilers, it is necessary to remove the "-fdefault-real-8" compiler option, which the current system doesn't allow. For Intel, this problem is overcome by adding "-real-size 32" to the compiler options for this file. When the compiler options are combined, "-real-size 32" ends up after "-real-size 64" and as such overwrites "-real-size 64". For the PGI compiler, this has not been tested yet.
The correct way to do this would be to specify default compiler options for all CAPS and SCHEMES before adjustments are made for individual files, and remove COMPILE_FLAGS and LINK_FLAGS fro the above code snippet.
The text was updated successfully, but these errors were encountered: