Skip to content

Commit

Permalink
CMakeLists.txt, w3iorsmd.F90: troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewMasarik-NOAA committed Mar 7, 2024
1 parent 01b3b61 commit a8c17a6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
14 changes: 8 additions & 6 deletions model/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ target_include_directories(ww3_lib
# Set compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(compile_flags -no-fma -ip -g -traceback -i4 -real-size 32 -fp-model precise
-assume byterecl -fno-alias -fno-fnalias)
-assume byterecl -fno-alias -fno-fnalias -fpp -save-temps)
# set(compile_flags -no-fma -ip -g -traceback -i4 -real-size 32 -fp-model precise
# -assume byterecl -fno-alias -fno-fnalias)
# -sox only works on Linux
if(LINUX)
list(APPEND compile_flags -sox)
Expand All @@ -70,7 +72,7 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(compile_flags -g -fno-second-underscore -ffree-line-length-none)
set(compile_flags_release -O3)
set(compile_flags_debug -Wall -fcheck=all -ffpe-trap=invalid,zero,overflow -frecursive -fbacktrace)

if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
target_compile_options(ww3_lib PUBLIC -fallow-argument-mismatch)
endif()
Expand All @@ -79,7 +81,7 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "PGI")
set(compile_flags -g -i4 -r4 -Kieee)
set(compile_flags_release -O3)
set(compile_flags_debug -O0 -Mbounds -Mchkfpstk -Mchkstk -Mdalign -Mdclchk -Mdepchk -Miomutex -Ktrap=fp -Mrecursive -traceback)

if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
target_compile_options(ww3_lib PUBLIC -fallow-argument-mismatch -fallow-invalid-boz)
endif()
Expand Down Expand Up @@ -131,13 +133,13 @@ if(MULTI_ESMF)
if (NOT TARGET esmf)
find_package(ESMF MODULE REQUIRED)
endif()

target_sources(ww3_lib PRIVATE wmesmfmd.F90)
target_link_libraries(ww3_lib PUBLIC esmf)
set_target_properties(ww3_lib PROPERTIES OUTPUT_NAME "ww3_multi_esmf")
# Don't build executables when building WW3 ESMF library
set(programs "")
endif()
endif()

set_property(SOURCE w3initmd.F90
APPEND
Expand Down Expand Up @@ -211,7 +213,7 @@ install(

install(FILES ${CMAKE_BINARY_DIR}/switch DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod DESTINATION ${CMAKE_INSTALL_PREFIX})


export(EXPORT WW3Exports
NAMESPACE WW3::
Expand Down
14 changes: 11 additions & 3 deletions model/src/w3iorsmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT )
IGRD = 1
END IF
!
WRITE(*,*) 'TESTING... LPDLIB=',LPDLIB
!
CALL W3SETO ( IGRD, NDSE, NDST )
CALL W3SETG ( IGRD, NDSE, NDST )
CALL W3SETW ( IGRD, NDSE, NDST )
Expand Down Expand Up @@ -650,15 +652,21 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT )
!
! I/O server version writing of spectra ( !/MPI )
!
WRITE (*,*) 'GOT HERE!!! -BMPI- LPDLIB=',LPDLIB
#ifdef W3_MPI
ELSE
!
IF (LPDLIB) THEN
WRITE (*,*) 'GOT HERE!!! -AMPI- LPDLIB=',LPDLIB
!!!MTM ELSE
!
WRITE (*,*) 'BEFORE LPDLIB IF. LPDLIB=',LPDLIB
IF (LPDLIB) THEN
WRITE (*,*) 'INSIDE LPDLIB IF. LPDLIB=',LPDLIB
#endif
#ifdef W3_TIMINGS
CALL PRINT_MY_TIME("Before UNST_PDLIB_WRITE_TO_FILE")
#endif
#ifdef W3_PDLIB
WRITE (*,*) 'INNER W3_PDLIB. LPDLIB=',LPDLIB
WRITE (*,*) 'IN: IAPROC=',IAPROC
CALL UNST_PDLIB_WRITE_TO_FILE(NDSR)
#endif
#ifdef W3_TIMINGS
Expand Down

0 comments on commit a8c17a6

Please sign in to comment.