Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed cmake to allow for NetCDF libraries to be found
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Oct 25, 2022
1 parent fff21ef commit 0f9c026
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 200 deletions.
84 changes: 0 additions & 84 deletions Makefile.Defines

This file was deleted.

90 changes: 0 additions & 90 deletions Makefile.Defines_example

This file was deleted.

2 changes: 0 additions & 2 deletions bin/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion build/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
*
!.gitignore
9 changes: 9 additions & 0 deletions cmake/Modules/FindNETCDF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# - Finds the NetCDF libraries
find_path(NETCDF_INCLUDE_DIR NAMES netcdf.mod HINTS ENV NETCDF_FORTRAN_HOME)
find_library(NETCDF_LIBRARY NAMES netcdf HINTS ENV NETCDF_FORTRAN_HOME)
find_library(NETCDF_FORTRAN_LIBRARY NAMES netcdff HINTS ENV NETCDF_FORTRAN_HOME)

set(NETCDF_FOUND TRUE)
set(NETCDF_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR})
set(NETCDF_LIBRARIES ${NETCDF_LIBRARY} ${NETCDF_FORTRAN_LIBRARY})
mark_as_advanced(NETCDF_LIBRARY NETCDF_FORTRAN_LIBRARY NETCDF_INCLUDE_DIR)
6 changes: 1 addition & 5 deletions cmake/Modules/SetUpNetCDF.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Find NetCDF if not already found
IF(NOT NETCDF_FOUND)
ENABLE_LANGUAGE(C) # Some libraries need a C compiler to find
FIND_PACKAGE(netcdf REQUIRED)
SET(NETCDF_FOUND TRUE CACHE INTERNAL "NETCDF was found" FORCE)
SET(NETCDF_LIBRARIES ${NETCDF_LIBRARIES} CACHE INTERNAL "NETCDF LIBS" FORCE)
#SET(NETCDFFORTRAN_FOUND TRUE CACHE INTERNAL "NETCDF-FORTRAN was found" FORCE)
#SET(NETCDFFORTRAN_LIBRARIES ${NETCDFFORTRAN_LIBRARIES} CACHE INTERNAL "NETCDFFORTRAN LIBS" FORCE)
FIND_PACKAGE(NETCDF REQUIRED)
ENDIF(NOT NETCDF_FOUND)
34 changes: 18 additions & 16 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@
########################################

# Add the source files
SET(FOO_src ${SRC}/discard/discard.f90
SET(FOO_src
${SRC}/modules/encounter_classes.f90
${SRC}/modules/fraggle_classes.f90
${SRC}/modules/helio_classes.f90
${SRC}/modules/lambda_function.f90
${SRC}/modules/rmvs_classes.f90
${SRC}/modules/swiftest_classes.f90
${SRC}/modules/swiftest_globals.f90
${SRC}/modules/swiftest_operators.f90
${SRC}/modules/swiftest.f90
${SRC}/modules/symba_classes.f90
${SRC}/modules/walltime_classes.f90
${SRC}/modules/whm_classes.f90
${SRC}/discard/discard.f90
${SRC}/drift/drift.f90
${SRC}/encounter/encounter_check.f90
${SRC}/encounter/encounter_io.f90
Expand All @@ -25,19 +38,6 @@ SET(FOO_src ${SRC}/discard/discard.f90
${SRC}/helio/helio_util.f90
${SRC}/io/io.f90
${SRC}/kick/kick.f90
${SRC}/main/swiftest_driver.f90
${SRC}/modules/encounter_classes.f90
${SRC}/modules/fraggle_classes.f90
${SRC}/modules/helio_classes.f90
${SRC}/modules/lambda_function.f90
${SRC}/modules/rmvs_classes.f90
${SRC}/modules/swiftest_classes.f90
${SRC}/modules/swiftest_globals.f90
${SRC}/modules/swiftest_operators.f90
${SRC}/modules/swiftest.f90
${SRC}/modules/symba_classes.f90
${SRC}/modules/walltime_classes.f90
${SRC}/modules/whm_classes.f90
${SRC}/netcdf/netcdf.f90
${SRC}/obl/obl.f90
${SRC}/operators/operator_cross.f90
Expand All @@ -61,6 +61,8 @@ SET(FOO_src ${SRC}/discard/discard.f90
${SRC}/symba/symba_setup.f90
${SRC}/symba/symba_step.f90
${SRC}/symba/symba_util.f90
${SRC}/tides/tides_getacch_pl.f90
${SRC}/tides/tides_spin_step.f90
${SRC}/user/user_getacch.f90
${SRC}/util/util_append.f90
${SRC}/util/util_coord.f90
Expand Down Expand Up @@ -89,6 +91,7 @@ SET(FOO_src ${SRC}/discard/discard.f90
${SRC}/whm/whm_setup.f90
${SRC}/whm/whm_step.f90
${SRC}/whm/whm_util.f90
${SRC}/main/swiftest_driver.f90
)

# Define the executable in terms of the source files
Expand All @@ -99,8 +102,7 @@ ADD_EXECUTABLE(${FOOEXE} ${FOO_src})
#####################################################

# Uncomment if you need to link to BLAS and LAPACK
TARGET_LINK_LIBRARIES(${FOOEXE} ${NETCDF_LIBRARIES})
#${NETCDFFORTRAN_LIBRARIES})
TARGET_LINK_LIBRARIES(${FOOEXE} ${NETCDF_LIBRARIES} ${NETCDF_FORTRAN_LIBRARIES})

# Uncomment if you have parallization
IF(USE_OPENMP)
Expand Down
2 changes: 1 addition & 1 deletion src/modules/symba_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ module subroutine symba_step_set_recur_levels_system(self, ireci)
integer(I4B), intent(in) :: ireci !! Input recursion level
end subroutine symba_step_set_recur_levels_system

module recursive subroutine symba_step_recur_system(self, param, t, ireci)
recursive module subroutine symba_step_recur_system(self, param, t, ireci)
use swiftest_classes, only : swiftest_parameters
implicit none
class(symba_nbody_system), intent(inout) :: self !! SyMBA nbody system object
Expand Down
2 changes: 1 addition & 1 deletion src/symba/symba_step.f90
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ module subroutine symba_step_set_recur_levels_system(self, ireci)
end subroutine symba_step_set_recur_levels_system


module recursive subroutine symba_step_recur_system(self, param, t, ireci)
recursive module subroutine symba_step_recur_system(self, param, t, ireci)
!! author: David A. Minton
!!
!! Step interacting planets and active test particles ahead in democratic heliocentric coordinates at the current
Expand Down

0 comments on commit 0f9c026

Please sign in to comment.