Skip to content

Commit

Permalink
Merge branch 'dev' into f/AD-shear
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Branlard committed Mar 13, 2024
2 parents b71173c + a2661d2 commit 57024da
Show file tree
Hide file tree
Showing 120 changed files with 27,245 additions and 4,148 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/automated-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev # gcovr
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev # gcovr
- name: Setup workspace
run: cmake -E make_directory ${{runner.workspace}}/openfast/build
- name: Configure build
Expand Down Expand Up @@ -241,7 +241,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure build
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -279,7 +279,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure build
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure build
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand All @@ -339,7 +339,7 @@ jobs:
### BUILD AND TEST JOBS

build-test-uadriver-debug:
# UA driver requires -DUA_OUTS, cannot be compiled with other
# UA driver used to require -DUA_OUTS
runs-on: ubuntu-22.04
steps:
- name: Checkout
Expand Down Expand Up @@ -374,7 +374,6 @@ jobs:
-DVARIABLE_TRACKING=OFF \
-DBUILD_TESTING:BOOL=ON \
-DCTEST_PLOT_ERRORS:BOOL=ON \
-DCMAKE_Fortran_FLAGS="-DUA_OUTS=ON" \
${GITHUB_WORKSPACE}
- name: Build all
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -419,7 +418,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -477,7 +476,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -538,7 +537,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" vtk
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -586,7 +585,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -718,7 +717,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -768,7 +767,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -818,7 +817,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -868,7 +867,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -918,7 +917,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -968,7 +967,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down Expand Up @@ -1017,7 +1016,7 @@ jobs:
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand Down
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ endif()
option(BUILD_TESTING "Build the testing tree." OFF)
if(BUILD_TESTING)
option(CODECOVERAGE "Enable infrastructure for measuring code coverage." OFF)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DUNIT_TEST")
option(BUILD_UNIT_TESTING "Enable unit testing" ON)
if(BUILD_UNIT_TESTING)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DUNIT_TEST")
endif()
endif()

# Setup Fortran Compiler options based on architecture/compiler
Expand Down Expand Up @@ -184,6 +187,7 @@ set(OPENFAST_MODULES
nwtc-library
version
inflowwind
extloads
aerodyn
aerodyn14
servodyn
Expand All @@ -200,6 +204,7 @@ set(OPENFAST_MODULES
icefloe
wakedynamics
awae
lindyn
map
turbsim
supercontroller
Expand Down Expand Up @@ -277,8 +282,10 @@ if(BUILD_TESTING)
add_subdirectory(reg_tests)

# unit tests
if(NOT (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Flang"))
add_subdirectory(unit_tests)
if(BUILD_UNIT_TESTING)
if(NOT (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Flang"))
add_subdirectory(unit_tests)
endif()
endif()
endif()

Expand Down
124 changes: 124 additions & 0 deletions cmake/FindNetCDF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#
# This file was copied from the VTK repository:
# https://github.com/Kitware/VTK/blob/master/CMake/FindNetCDF.cmake
# VTK is distributed under the OSI-approved BSD 3-clause License.
#
#
# - Find NetCDF
# Find the native NetCDF includes and library
#
# NETCDF_INCLUDE_DIR - user modifiable choice of where netcdf headers are
# NETCDF_LIBRARY - user modifiable choice of where netcdf libraries are
#
# Your package can require certain interfaces to be FOUND by setting these
#
# NETCDF_CXX - require the C++ interface and link the C++ library
# NETCDF_F77 - require the F77 interface and link the fortran library
# NETCDF_F90 - require the F90 interface and link the fortran library
#
# Or equivalently by calling FindNetCDF with a COMPONENTS argument containing one or
# more of "CXX;F77;F90".
#
# When interfaces are requested the user has access to interface specific hints:
#
# NETCDF_${LANG}_INCLUDE_DIR - where to search for interface header files
# NETCDF_${LANG}_LIBRARY - where to search for interface libraries
#
# This module returns these variables for the rest of the project to use.
#
# NETCDF_FOUND - True if NetCDF found including required interfaces (see below)
# NETCDF_LIBRARIES - All netcdf related libraries.
# NETCDF_INCLUDE_DIRS - All directories to include.
# NETCDF_HAS_INTERFACES - Whether requested interfaces were found or not.
# NETCDF_${LANG}_INCLUDE_DIRS/NETCDF_${LANG}_LIBRARIES - C/C++/F70/F90 only interface
#
# Normal usage would be:
# set (NETCDF_F90 "YES")
# find_package (NetCDF REQUIRED)
# target_link_libraries (uses_everthing ${NETCDF_LIBRARIES})
# target_link_libraries (only_uses_f90 ${NETCDF_F90_LIBRARIES})

#search starting from user editable cache var
if (NETCDF_INCLUDE_DIR AND NETCDF_LIBRARY)
# Already in cache, be silent
set (NETCDF_FIND_QUIETLY TRUE)
endif ()

set(USE_DEFAULT_PATHS "NO_DEFAULT_PATH")
if(NETCDF_USE_DEFAULT_PATHS)
set(USE_DEFAULT_PATHS "")
endif()

find_path (NETCDF_INCLUDE_DIR netcdf.h
HINTS "${NETCDF_DIR}/include")
mark_as_advanced (NETCDF_INCLUDE_DIR)
set (NETCDF_C_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR})

find_library (NETCDF_LIBRARY NAMES netcdf
HINTS "${NETCDF_DIR}/lib")
mark_as_advanced (NETCDF_LIBRARY)

set (NETCDF_C_LIBRARIES ${NETCDF_LIBRARY})

#start finding requested language components
set (NetCDF_libs "")
set (NetCDF_includes "${NETCDF_INCLUDE_DIR}")

get_filename_component (NetCDF_lib_dirs "${NETCDF_LIBRARY}" PATH)
set (NETCDF_HAS_INTERFACES "YES") # will be set to NO if we're missing any interfaces

macro (NetCDF_check_interface lang header libs)
if (NETCDF_${lang})
#search starting from user modifiable cache var
find_path (NETCDF_${lang}_INCLUDE_DIR NAMES ${header}
HINTS "${NETCDF_INCLUDE_DIR}"
HINTS "${NETCDF_${lang}_ROOT}/include"
${USE_DEFAULT_PATHS})

find_library (NETCDF_${lang}_LIBRARY NAMES ${libs}
HINTS "${NetCDF_lib_dirs}"
HINTS "${NETCDF_${lang}_ROOT}/lib"
${USE_DEFAULT_PATHS})

mark_as_advanced (NETCDF_${lang}_INCLUDE_DIR NETCDF_${lang}_LIBRARY)

#export to internal varS that rest of project can use directly
set (NETCDF_${lang}_LIBRARIES ${NETCDF_${lang}_LIBRARY})
set (NETCDF_${lang}_INCLUDE_DIRS ${NETCDF_${lang}_INCLUDE_DIR})

if (NETCDF_${lang}_INCLUDE_DIR AND NETCDF_${lang}_LIBRARY)
list (APPEND NetCDF_libs ${NETCDF_${lang}_LIBRARY})
list (APPEND NetCDF_includes ${NETCDF_${lang}_INCLUDE_DIR})
else ()
set (NETCDF_HAS_INTERFACES "NO")
message (STATUS "Failed to find NetCDF interface for ${lang}")
endif ()
endif ()
endmacro ()

list (FIND NetCDF_FIND_COMPONENTS "CXX" _nextcomp)
if (_nextcomp GREATER -1)
set (NETCDF_CXX 1)
endif ()
list (FIND NetCDF_FIND_COMPONENTS "F77" _nextcomp)
if (_nextcomp GREATER -1)
set (NETCDF_F77 1)
endif ()
list (FIND NetCDF_FIND_COMPONENTS "F90" _nextcomp)
if (_nextcomp GREATER -1)
set (NETCDF_F90 1)
endif ()
NetCDF_check_interface (CXX netcdfcpp.h netcdf_c++)
NetCDF_check_interface (F77 netcdf.inc netcdff)
NetCDF_check_interface (F90 netcdf.mod netcdff)

#export accumulated results to internal varS that rest of project can depend on
list (APPEND NetCDF_libs "${NETCDF_C_LIBRARIES}")
set (NETCDF_LIBRARIES ${NetCDF_libs})
set (NETCDF_INCLUDE_DIRS ${NetCDF_includes})

# handle the QUIETLY and REQUIRED arguments and set NETCDF_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (NetCDF
DEFAULT_MSG NETCDF_LIBRARIES NETCDF_INCLUDE_DIRS NETCDF_HAS_INTERFACES)
6 changes: 3 additions & 3 deletions cmake/OpenfastFortranOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ endmacro(check_f2008_features)
#
macro(set_fast_gfortran)
if(NOT WIN32)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpic ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpic")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fPIC ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif(NOT WIN32)

# Fix free-form compilation for OpenFAST
Expand Down
Binary file modified docs/OtherSupporting/OutListParameters.xlsx
Binary file not shown.
Loading

0 comments on commit 57024da

Please sign in to comment.