Skip to content

Commit

Permalink
Merge pull request #548 from ashleymedin/develop
Browse files Browse the repository at this point in the history
This is the continuation of the sundials merge
  • Loading branch information
wknoben authored Nov 8, 2023
2 parents 2c1951d + 8626c3b commit cf74b84
Show file tree
Hide file tree
Showing 69 changed files with 4,024 additions and 2,814 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ site/
Laugh-Tests/
# cmake_build containing cmake build objects
build/cmake_build
runinfo.txt
89 changes: 40 additions & 49 deletions build/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ else()
if(CMAKE_BUILD_TYPE MATCHES Actors)
message("\nUsing Actors Framework, should have been installed previously")
add_compile_definitions(ACTORS_ACTIVE)

add_compile_definitions(V4_ACTIVE)
project(summaactors DESCRIPTION "Summa-Sundials-BE Actors")

include(FortranCInterface)
Expand Down Expand Up @@ -158,7 +158,7 @@ if(CMAKE_BUILD_TYPE MATCHES Cluster)

if(CMAKE_BUILD_TYPE MATCHES Actors)
find_package(CAF REQUIRED)
set(INC_ACTORS ${CAF_INCLUDES} ${PARENT_DIR}/build/includes/global ${PARENT_DIR}/build/includes/summa_actor ${PARENT_DIR}/build/includes/gru_actor ${PARENT_DIR}/build/includes/job_actor ${PARENT_DIR}/build/includes/file_access_actor ${PARENT_DIR}/build/includes/hru_actor)
set(INC_ACTORS ${CAF_INCLUDES} ${PARENT_DIR}/build/includes/global ${PARENT_DIR}/build/includes/summa_actor ${PARENT_DIR}/build/includes/job_actor ${PARENT_DIR}/build/includes/file_access_actor ${PARENT_DIR}/build/includes/hru_actor)
set(LIB_ACTORS ${CAF_LIBRARIES} -lcaf_core -lcaf_io)
endif()

Expand Down Expand Up @@ -206,7 +206,12 @@ else()
message(FATAL_ERROR "Did not find Actors directory, edit CMakeLists.txt to add path")
endif()
link_directories(${DIR_ACTORS}/lib)
set(INC_ACTORS ${DIR_ACTORS}/include ${PARENT_DIR}/build/includes/global ${PARENT_DIR}/build/includes/summa_actor ${PARENT_DIR}/build/includes/gru_actor ${PARENT_DIR}/build/includes/job_actor ${PARENT_DIR}/build/includes/file_access_actor ${PARENT_DIR}/build/includes/hru_actor)
set(INC_ACTORS ${DIR_ACTORS}/include
${PARENT_DIR}/build/includes/global
${PARENT_DIR}/build/includes/summa_actor
${PARENT_DIR}/build/includes/job_actor
${PARENT_DIR}/build/includes/file_access_actor
${PARENT_DIR}/build/includes/hru_actor)
set(LIB_ACTORS ${DIR_ACTORS}/lib -lcaf_core -lcaf_io)
endif()

Expand Down Expand Up @@ -238,21 +243,18 @@ set(HOOKUP_DIR ${F_MASTER}/build/source/hookup)
set(NETCDF_DIR ${F_MASTER}/build/source/netcdf)
set(NOAHMP_DIR ${F_MASTER}/build/source/noah-mp)

# Define directories for source files that might be replaced by actors (identical if not using actors)
set(SUB_DRIVER_DIR ${PARENT_DIR}/build/source/driver)
set(SUB_DSHARE_DIR ${PARENT_DIR}/build/source/dshare)
set(SUB_ENGINE_DIR ${PARENT_DIR}/build/source/engine)
set(SUB_HOOKUP_DIR ${PARENT_DIR}/build/source/hookup)
set(SUB_NETCDF_DIR ${PARENT_DIR}/build/source/netcdf)

# Define Actors specific directories
set(ACTORS_DIR ${PARENT_DIR}/build/source/actors)
set(FILE_ACCESS_DIR ${ACTORS_DIR}/file_access_actor)
set(JOB_ACTOR_DIR ${ACTORS_DIR}/job_actor)
set(HRU_ACTOR_DIR ${ACTORS_DIR}/hru_actor)
set(GRU_ACTOR_DIR ${ACTORS_DIR}/gru_actor)


if(CMAKE_BUILD_TYPE MATCHES Actors)
# Define directories for source files that might be replaced by actors (identical if not using actors)
set(SUB_ENGINE_DIR ${FILE_ACCESS_DIR})
else()
set(SUB_ENGINE_DIR ${PARENT_DIR}/build/source/engine)
endif()
#=========================================================================================
# COMPILE PART 2: Assemble all of the SUMMA sub-routines
#=========================================================================================
Expand Down Expand Up @@ -282,7 +284,7 @@ set(HOOKUP

# Data modules
set(DATAMS
${SUB_DSHARE_DIR}/data_types.f90
${DSHARE_DIR}/data_types.f90
${DSHARE_DIR}/flxMapping.f90
${DSHARE_DIR}/get_ixname.f90
${DSHARE_DIR}/globalData.f90
Expand All @@ -293,6 +295,8 @@ set(DATAMS
set(DATAMS_SUNDIALS
${DSHARE_DIR}/type4ida.f90
${DSHARE_DIR}/type4kinsol.f90)
set(DATAMS_ACTORS
${ACTORS_DIR}/global/actor_data_types.f90)

# Utility modules
set(UTILMS
Expand All @@ -308,8 +312,8 @@ set(UTILMS_SUNDIALS

# NetCDF routines
set(NETCDF
${SUB_NETCDF_DIR}/def_output.f90
${SUB_NETCDF_DIR}/modelwrite.f90
${NETCDF_DIR}/def_output.f90
${NETCDF_DIR}/modelwrite.f90
${NETCDF_DIR}/netcdf_util.f90
${NETCDF_DIR}/read_icond.f90)

Expand Down Expand Up @@ -410,23 +414,17 @@ set(INTERFACE
${ACTORS_DIR}/global/cppwrap_datatypes.f90
${ACTORS_DIR}/global/cppwrap_metadata.f90)
set(FILE_ACCESS_INTERFACE
${FILE_ACCESS_DIR}/fortran_code/cppwrap_fileAccess.f90
${FILE_ACCESS_DIR}/fortran_code/output_structure.f90
${FILE_ACCESS_DIR}/fortran_code/read_force.f90
${FILE_ACCESS_DIR}/fortran_code/write_to_netcdf.f90
${FILE_ACCESS_DIR}/fortran_code/writeOutputFromOutputStructure.f90)
${FILE_ACCESS_DIR}/cppwrap_fileAccess.f90
${FILE_ACCESS_DIR}/output_structure.f90
${FILE_ACCESS_DIR}/read_force.f90
${FILE_ACCESS_DIR}/fileAccess_writeOutput.f90)
set(JOB_INTERFACE
${JOB_ACTOR_DIR}/job_actor.f90)
set(GRU_INTERFACE
${GRU_ACTOR_DIR}/gru_actor.f90)
set(HRU_INTERFACE
${HRU_ACTOR_DIR}/fortran_code/hru_actor.f90
${HRU_ACTOR_DIR}/fortran_code/hru_init.f90
${HRU_ACTOR_DIR}/fortran_code/hru_modelRun.f90
${HRU_ACTOR_DIR}/fortran_code/hru_modelwrite.f90
${HRU_ACTOR_DIR}/fortran_code/hru_restart.f90
${HRU_ACTOR_DIR}/fortran_code/hru_setup.f90
${HRU_ACTOR_DIR}/fortran_code/hru_writeOutput.f90)
${HRU_ACTOR_DIR}/hru_init.f90
${HRU_ACTOR_DIR}/hru_read.f90
${HRU_ACTOR_DIR}/hru_modelRun.f90
${HRU_ACTOR_DIR}/hru_writeOutput.f90)

# Actors actual actor modules
set(ACTORS_GLOBAL
Expand All @@ -436,25 +434,23 @@ set(ACTORS_GLOBAL
${ACTORS_DIR}/global/settings_functions.cpp
${ACTORS_DIR}/global/timing_info.cpp)
set(SUMMA_ACTOR
${ACTORS_DIR}/summa_actor/batch/batch.cpp
${ACTORS_DIR}/summa_actor/batch/batch_container.cpp
${ACTORS_DIR}/summa_actor/client/client.cpp
${ACTORS_DIR}/summa_actor/client/client_container.cpp
${ACTORS_DIR}/summa_actor/batch.cpp
${ACTORS_DIR}/summa_actor/batch_container.cpp
${ACTORS_DIR}/summa_actor/client.cpp
${ACTORS_DIR}/summa_actor/client_container.cpp
${ACTORS_DIR}/summa_actor/summa_actor.cpp
${ACTORS_DIR}/summa_actor/summa_backup_server.cpp
${ACTORS_DIR}/summa_actor/summa_client.cpp
${ACTORS_DIR}/summa_actor/summa_server.cpp)
set(FILE_ACCESS_ACTOR
${ACTORS_DIR}/file_access_actor/cpp_code/file_access_actor.cpp
${ACTORS_DIR}/file_access_actor/cpp_code/forcing_file_info.cpp
${ACTORS_DIR}/file_access_actor/cpp_code/output_container.cpp)
${ACTORS_DIR}/file_access_actor/file_access_actor.cpp
${ACTORS_DIR}/file_access_actor/forcing_file_info.cpp
${ACTORS_DIR}/file_access_actor/output_container.cpp)
set(JOB_ACTOR
${ACTORS_DIR}/job_actor/GRU.cpp
${ACTORS_DIR}/job_actor/job_actor.cpp)
set(GRU_ACTOR
${ACTORS_DIR}/gru_actor/gru_actor.cpp)
set(HRU_ACTOR
${ACTORS_DIR}/hru_actor/cpp_code/hru_actor.cpp)
${ACTORS_DIR}/hru_actor/hru_actor.cpp)


#=========================================================================================
Expand All @@ -467,13 +463,10 @@ set(COMM_ALL
${DATAMS}
${UTILMS})
if(CMAKE_BUILD_TYPE MATCHES Actors)
set(COMM_ALL ${COMM_ALL}
${INTERFACE})
set(COMM_ALL ${COMM_ALL} ${DATAMS_ACTORS} ${INTERFACE})
endif()
if(CMAKE_BUILD_TYPE MATCHES Sundials)
set(COMM_ALL ${COMM_ALL}
${DATAMS_SUNDIALS}
${UTILMS_SUNDIALS})
set(COMM_ALL ${COMM_ALL} ${DATAMS_SUNDIALS} ${UTILMS_SUNDIALS})
endif()

set(SUMMA_ALL
Expand All @@ -485,10 +478,9 @@ set(SUMMA_ALL

if(CMAKE_BUILD_TYPE MATCHES Actors)
set(SUMMA_ALL ${SUMMA_ALL}
${FILE_ACCESS_INTERFACE}
${JOB_INTERFACE}
${GRU_INTERFACE}
${HRU_INTERFACE})
${FILE_ACCESS_INTERFACE}
${JOB_INTERFACE}
${HRU_INTERFACE})
else()
set(SUMMA_ALL ${SUMMA_ALL}
${PRELIM_NOT_ACTORS}
Expand Down Expand Up @@ -582,7 +574,6 @@ elseif(CMAKE_BUILD_TYPE MATCHES Actors)
${ACTORS_GLOBAL}
${FILE_ACCESS_ACTOR}
${JOB_ACTOR}
${GRU_ACTOR}
${HRU_ACTOR}
${SUMMA_ACTOR}
${SUMMA_CLIENT}
Expand Down
2 changes: 1 addition & 1 deletion build/cmake/build_ngen.cluster.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cmake --build extern/iso_c_fortran_bmi/cmake_build --target all
cmake -B extern/summa/cmake_build -S extern/summa -DCMAKE_BUILD_TYPE=BE_NexGen_Cluster
cmake --build extern/summa/cmake_build --target all

cmake -B cmake_build -S . -DMPI_ACTIVE:BOOL=OFF -DNGEN_ACTIVATE_PYTHON:BOOL=OFF -DBMI_C_LIB_ACTIVE:BOOL=ON -DBMI_FORTRAN_ACTIVE:BOOL=ON
cmake -B cmake_build -S . -DNGEN_WITH_MPI:BOOL=OFF -DNGEN_WITH_PYTHON:BOOL=OFF -DNGEN_WITH_BMI_C:BOOL=ON -DNGEN_WITH_BMI_FORTRAN:BOOL=ON -DNGEN_WITH_NETCDF:BOOL=OFF
# can also add -DCMAKE_BUILD_TYPE=Debug to be able to run in gdb
# make -j 8 -C cmake_build # build w/ 8 parallel jobs, also turn MPI on
make -C cmake_build
2 changes: 1 addition & 1 deletion build/cmake/build_ngen.mac.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cmake --build extern/iso_c_fortran_bmi/cmake_build --target all
cmake -B extern/summa/cmake_build -S extern/summa -DCMAKE_BUILD_TYPE=BE_NexGen
cmake --build extern/summa/cmake_build --target all

cmake -B cmake_build -S . -DMPI_ACTIVE:BOOL=OFF -DNGEN_ACTIVATE_PYTHON:BOOL=OFF -DBMI_C_LIB_ACTIVE:BOOL=ON -DBMI_FORTRAN_ACTIVE:BOOL=ON
cmake -B cmake_build -S . -DNGEN_WITH_MPI:BOOL=OFF -DNGEN_WITH_PYTHON:BOOL=OFF -DNGEN_WITH_BMI_C:BOOL=ON -DNGEN_WITH_BMI_FORTRAN:BOOL=ON -DNGEN_WITH_NETCDF:BOOL=OFF
# can also add -DCMAKE_BUILD_TYPE=Debug to be able to run in gdb
# make -j 8 -C cmake_build # build w/ 8 parallel jobs, also turn MPI on
make -C cmake_build
4 changes: 2 additions & 2 deletions build/cmake_external/build_cmakeActors.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# from {$maindir}/actor-framework, run
# cp ../../summa/build/summa/build/cmake_external/build_cmakeActors.bash build_cmake
# run script from the actor-framework directory with ./build_cmake
# run `make`, then `make install`
# run script from the actor-framework directory with ./build_cmake
# run `cd build`, `make`, then `make install`

export CXX="g++"
./configure --prefix=../install
2 changes: 1 addition & 1 deletion build/cmake_external/build_cmakeSundials.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# run `make`, then `make install`
# Note, using -DEXAMPLES_ENABLE_C=OFF -DEXAMPLES_ENABLE_F2003=OFF, if want to run examples should change

cmake ../../sundials-6.3.0/ -DEXAMPLES_ENABLE_C=OFF -DEXAMPLES_ENABLE_F2003=OFF -DBUILD_FORTRAN_MODULE_INTERFACE=ON -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_INSTALL_PREFIX=../../sundials/instdir -DEXAMPLES_INSTALL_PATH=../../sundials/instdir/examples
cmake ../../sundials-6.6.0/ -DEXAMPLES_ENABLE_C=OFF -DEXAMPLES_ENABLE_F2003=OFF -DBUILD_FORTRAN_MODULE_INTERFACE=ON -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_INSTALL_PREFIX=../../sundials/instdir -DEXAMPLES_INSTALL_PATH=../../sundials/instdir/examples
Loading

0 comments on commit cf74b84

Please sign in to comment.