diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 509e899a4..47dea7293 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -42,6 +42,7 @@ if(ALBEDO_INTELMPI_WORKAROUNDS) add_compile_options(-DDISABLE_PARALLEL_RESTART_READ) endif() + #TODO: this machine specific block can easyly go in cmake toolchain. if(${FESOM_PLATFORM_STRATEGY} STREQUAL levante.dkrz.de ) message(STATUS "multithreading disabled for Levante") # multithreading suddenly produces an error, disable it until a fix is found. issue #413 @@ -286,28 +287,33 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${NETCDF_Fortran_INCLUDE_DIRE target_include_directories(${PROJECT_NAME} PRIVATE ${MCT_Fortran_INCLUDE_DIRECTORIES} ${MPEU_Fortran_INCLUDE_DIRECTORIES}) target_include_directories(${PROJECT_NAME} PRIVATE ${SCRIP_Fortran_INCLUDE_DIRECTORIES}) target_include_directories(${PROJECT_NAME} PRIVATE ${YAC_Fortran_INCLUDE_DIRECTORIES} ${YAXT_Fortran_INCLUDE_DIRECTORIES}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_C) target_link_libraries(${PROJECT_NAME} PRIVATE ${NETCDF_Fortran_LIBRARIES} ${NETCDF_C_LIBRARIES} ${OASIS_Fortran_LIBRARIES}) target_link_libraries(${PROJECT_NAME} PRIVATE ${MCT_Fortran_LIBRARIES} ${MPEU_Fortran_LIBRARIES} ${SCRIP_Fortran_LIBRARIES}) - - # OASIS-YAK target_link_libraries(${PROJECT_NAME} PRIVATE ${YACUTILS_Fortran_LIBRARIES} ${YACCORE_Fortran_LIBRARIES}) target_link_libraries(${PROJECT_NAME} PRIVATE ${YAXT_Fortran_LIBRARIES} ${YAXTC_Fortran_LIBRARIES}) -#set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE Fortran) - -#target_include_directories(${PROJECT_NAME} PRIVATE ${NETCDF_Fortran_INCLUDE_DIRECTORIES} ${OASIS_Fortran_INCLUDE_DIRECTORIES}) -#target_include_directories(${PROJECT_NAME} PRIVATE ${MCT_Fortran_INCLUDE_DIRECTORIES} ${MPEU_Fortran_INCLUDE_DIRECTORIES}) -#target_include_directories(${PROJECT_NAME} PRIVATE ${SCRIP_Fortran_INCLUDE_DIRECTORIES}) -#target_include_directories(${PROJECT_NAME} PRIVATE ${YAC_Fortran_INCLUDE_DIRECTORIES} ${YAXT_Fortran_INCLUDE_DIRECTORIES}) -##target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_C ${NETCDF_Fortran_LIBRARIES} ${NETCDF_C_LIBRARIES} ${OASIS_Fortran_LIBRARIES}) -#target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_C ${MCT_Fortran_LIBRARIES} ${MPEU_Fortran_LIBRARIES} ${SCRIP_Fortran_LIBRARIES} ${OASIS_Fortran_LIBRARIES}) - -## OASIS-YAK -#target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_C ${YACUTILS_Fortran_LIBRARIES} ${YACCORE_Fortran_LIBRARIES}) -#target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_C ${YAXT_Fortran_LIBRARIES} ${YAXTC_Fortran_LIBRARIES}) +set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE Fortran) +if(${ENABLE_OPENMP} AND NOT ${CMAKE_Fortran_COMPILER_ID} STREQUAL Cray) + target_compile_options(${PROJECT_NAME} PRIVATE ${OpenMP_Fortran_FLAGS}) # currently we only have OpenMP in the Fortran part + target_link_libraries(${PROJECT_NAME} OpenMP::OpenMP_Fortran) + + # there is a problem (at least on levante with ifort) with openmp and I/O multithreading being active at the same time + # in this case the simulation stops and never finishes + # this has been observed with IFS-Fesom and Fesom standalone + # until the problem is identified, we exclude the I/O and multithreading files from openmp compilation, i.e. "-qno-openmp" for ifort + if(NOT ${DISABLE_MULTITHREADING}) + if(${CMAKE_Fortran_COMPILER_ID} STREQUAL Intel ) + set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/io_restart.F90 PROPERTIES COMPILE_OPTIONS "-qno-openmp") + set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/async_threads_module.F90 PROPERTIES COMPILE_OPTIONS "-qno-openmp") + set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/io_meandata.F90 PROPERTIES COMPILE_OPTIONS "-qno-openmp") + endif() + endif() +endif() +#set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE Fortran) # fesom.x executable add_executable(${PROJECT_NAME}.x ${src_home}/fesom_main.F90) diff --git a/src/ifs_interface/ifs_notused.F90 b/src/ifs_interface/ifs_notused.F90 index 1cedbc82c..3cd5c9dbb 100644 --- a/src/ifs_interface/ifs_notused.F90 +++ b/src/ifs_interface/ifs_notused.F90 @@ -176,6 +176,7 @@ SUBROUTINE nemogcmcoup_update_add( mype, npes, icomm, & if(fesom%mype==0) then WRITE(0,*)'In nemogcmcoup_update_add FESOM dummy routine. Proceeding...' + !CALL abort endif diff --git a/src/oce_ale_pressure_bv.F90 b/src/oce_ale_pressure_bv.F90 index a2f759d74..55f087170 100644 --- a/src/oce_ale_pressure_bv.F90 +++ b/src/oce_ale_pressure_bv.F90 @@ -2925,6 +2925,7 @@ subroutine compute_sigma_xy(TF1,SF1, partit, mesh) END DO !$OMP END DO !$OMP END PARALLEL + CALL MPI_BARRIER(MPI_COMM_FESOM,MPIerr) call exchange_nod(sigma_xy, partit) !$OMP BARRIER end subroutine compute_sigma_xy