Skip to content
Snippets Groups Projects
Commit 7b445571 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Change suffixes from f to f90 and add cmake files.

parent 3c3e2d67
No related branches found
No related tags found
No related merge requests found
Showing
with 319 additions and 27 deletions
cmake_minimum_required(VERSION 3.14)
project(Detection_eddies Fortran)
find_path(jumble_INCLUDE_DIR jumble.mod)
find_library(jumble_LIBRARY jumble)
find_path(nr_util_INCLUDE_DIR nr_util.mod)
find_library(nr_util_LIBRARY nr_util)
find_path(netcdf95_INCLUDE_DIR netcdf95.mod)
find_library(netcdf95_LIBRARY netcdf95)
find_path(netcdff_INCLUDE_DIR netcdf.mod)
find_library(netcdff_LIBRARY netcdff)
find_path(contour_531_INCLUDE_DIR contour_531.mod)
find_library(contour_531_LIBRARY contour_531)
find_path(fortrangis_INCLUDE_DIR shapelib.mod)
find_library(fortrangis_LIBRARY fortrangis)
find_library(fortranc_LIBRARY fortranc)
find_library(shapelib_LIBRARY shp)
find_path(shapelib_03_INCLUDE_DIR shapelib_03.mod)
find_library(shapelib_03_LIBRARY shapelib_03)
find_path(GPC_F_INCLUDE_DIR gpc_f.mod)
find_library(GPC_F_LIBRARY gpc_f)
find_library(GPC_LIBRARY GPC)
find_path(geometry_INCLUDE_DIR geometry.mod)
find_library(geometry_LIBRARY geometry)
find_path(numer_rec_95_INCLUDE_DIR numer_rec_95.mod)
find_library(numer_rec_95_LIBRARY numer_rec_95)
find_package(NetCDF REQUIRED)
add_executable(extraction_eddies extraction_eddies.f90 write_eddy.f90
local_extrema.f90 set_max_speed.f90 get_1_outerm.f90 max_speed_contour_ssh.f90
good_contour.f90 spher_polyline_area.f90 mean_speed.f90 inside_4.f90
set_all_outerm.f90 derived_types.f90 init_shapefiles.f90 nearby_extr.f90
get_var.f90)
target_include_directories(extraction_eddies PRIVATE
${contour_531_INCLUDE_DIR} ${fortrangis_INCLUDE_DIR}
${netcdff_INCLUDE_DIR})
target_link_libraries(extraction_eddies ${contour_531_LIBRARY}
${netcdf95_LIBRARY} ${netcdff_LIBRARY} ${NetCDF_LIBRARY}
${numer_rec_95_LIBRARY} ${jumble_LIBRARY} ${nr_util_LIBRARY}
${shapelib_03_LIBRARY} ${fortrangis_LIBRARY} ${fortranc_LIBRARY}
${shapelib_LIBRARY} ${geometry_LIBRARY})
# Tests
add_executable(test_local_extrema local_extrema.f90)
add_executable(test_get_1_outerm good_contour.f90 derived_types.f90
get_1_outerm.f90 spher_polyline_area.f90)
add_executable(test_set_max_speed derived_types.f90 set_max_speed.f90
good_contour.f90 max_speed_contour_ssh.f90 mean_speed.f90
spher_polyline_area.f90 inside_4.f90)
add_executable(test_set_all_outerm derived_types.f90 set_all_outerm.f90
local_extrema.f90 get_1_outerm.f90 good_contour.f90 spher_polyline_area.f90
nearby_extr.f90 get_var.f90)
add_executable(test_weight weight.f90 derived_types.f90)
add_executable(test_spher_polygon_area spher_polygon_area.f90
spher_polyline_area.f90)
add_executable(test_read_eddy derived_types.f90 init_shapefiles.f90
read_eddy.f90 write_eddy.f90 read_field_indices.f90)
add_executable(test_read_snapshot derived_types.f90 init_shapefiles.f90
read_snapshot.f90 write_eddy.f90 read_eddy.f90 read_field_indices.f90)
add_executable(test_successive_overlap derived_types.f90
successive_overlap.f90 read_snapshot.f90 spher_polygon_area.f90
spher_polyline_area.f90 weight.f90 read_eddy.f90 read_field_indices.f90)
add_executable(test_nearby_extr nearby_extr.f90 derived_types.f90)
add_executable(test_max_speed_contour_ssh derived_types.f90
max_speed_contour_ssh.f90 get_var.f90)
add_executable(test_good_contour good_contour.f90)
add_executable(test_inside_4 inside_4.f90)
add_executable(test_mean_speed mean_speed.f90)
add_executable(test_spher_polyline_area spher_polyline_area.f90)
include(Tests/CMakeLists.txt)
include(ConfigureCompilerFlags)
......@@ -2,31 +2,31 @@
# 1. Source files and libraries
src_test_local_extrema = test_local_extrema.f local_extrema.f write_extr_map.f
src_test_local_extrema = test_local_extrema.f90 local_extrema.f90 write_extr_map.f90
src_test_get_1_outerm = good_contour.f test_get_1_outerm.f derived_types.f get_1_outerm.f spher_polyline_area.f
src_test_get_1_outerm = good_contour.f90 test_get_1_outerm.f90 derived_types.f90 get_1_outerm.f90 spher_polyline_area.f90
src_test_set_max_speed = test_set_max_speed.f derived_types.f set_max_speed.f good_contour.f max_speed_contour_ssh.f mean_speed.f spher_polyline_area.f inside_4.f
src_test_set_max_speed = test_set_max_speed.f90 derived_types.f90 set_max_speed.f90 good_contour.f90 max_speed_contour_ssh.f90 mean_speed.f90 spher_polyline_area.f90 inside_4.f90
src_extraction_eddies = extraction_eddies.f write_eddy.f local_extrema.f set_max_speed.f get_1_outerm.f max_speed_contour_ssh.f good_contour.f spher_polyline_area.f mean_speed.f inside_4.f set_all_outerm.f derived_types.f init_shapefiles.f nearby_extr.f get_var.f
src_extraction_eddies = extraction_eddies.f90 write_eddy.f90 local_extrema.f90 set_max_speed.f90 get_1_outerm.f90 max_speed_contour_ssh.f90 good_contour.f90 spher_polyline_area.f90 mean_speed.f90 inside_4.f90 set_all_outerm.f90 derived_types.f90 init_shapefiles.f90 nearby_extr.f90 get_var.f90
src_test_set_all_outerm = test_set_all_outerm.f derived_types.f set_all_outerm.f local_extrema.f get_1_outerm.f good_contour.f spher_polyline_area.f nearby_extr.f get_var.f
src_test_set_all_outerm = test_set_all_outerm.f90 derived_types.f90 set_all_outerm.f90 local_extrema.f90 get_1_outerm.f90 good_contour.f90 spher_polyline_area.f90 nearby_extr.f90 get_var.f90
src_test_weight = test_weight.f weight.f derived_types.f
src_test_weight = test_weight.f90 weight.f90 derived_types.f90
src_test_spher_polygon_area = spher_polygon_area.f test_spher_polygon_area.f spher_polyline_area.f
src_test_spher_polygon_area = spher_polygon_area.f90 test_spher_polygon_area.f90 spher_polyline_area.f90
src_test_read_eddy = test_read_eddy.f derived_types.f init_shapefiles.f read_eddy.f write_eddy.f read_field_indices.f
src_test_read_eddy = test_read_eddy.f90 derived_types.f90 init_shapefiles.f90 read_eddy.f90 write_eddy.f90 read_field_indices.f90
src_test_read_snapshot = test_read_snapshot.f derived_types.f init_shapefiles.f read_snapshot.f write_eddy.f read_eddy.f read_field_indices.f write_extr_map.f
src_test_read_snapshot = test_read_snapshot.f90 derived_types.f90 init_shapefiles.f90 read_snapshot.f90 write_eddy.f90 read_eddy.f90 read_field_indices.f90 write_extr_map.f90
src_test_successive_overlap = test_successive_overlap.f derived_types.f successive_overlap.f read_snapshot.f spher_polygon_area.f spher_polyline_area.f weight.f read_eddy.f read_field_indices.f
src_test_successive_overlap = test_successive_overlap.f90 derived_types.f90 successive_overlap.f90 read_snapshot.f90 spher_polygon_area.f90 spher_polyline_area.f90 weight.f90 read_eddy.f90 read_field_indices.f90
src_test_nearby_extr = test_nearby_extr.f nearby_extr.f derived_types.f
src_test_nearby_extr = test_nearby_extr.f90 nearby_extr.f90 derived_types.f90
src_test_max_speed_contour_ssh = test_max_speed_contour_ssh.f max_speed_contour_ssh.f get_var.f
src_test_max_speed_contour_ssh = test_max_speed_contour_ssh.f90 max_speed_contour_ssh.f90 get_var.f90
sources := $(sort ${src_test_local_extrema} ${src_test_get_1_outerm} ${src_test_set_max_speed} ${src_extraction_eddies} ${src_test_set_all_outerm} ${src_test_weight} ${src_test_spher_polygon_area} ${src_test_read_eddy} ${src_test_read_snapshot} ${src_test_successive_overlap} ${src_test_nearby_extr} ${src_test_max_speed_contour_ssh}) test_good_contour.f test_inside_4.f test_mean_speed.f test_spher_polyline_area.f
sources := $(sort ${src_test_local_extrema} ${src_test_get_1_outerm} ${src_test_set_max_speed} ${src_extraction_eddies} ${src_test_set_all_outerm} ${src_test_weight} ${src_test_spher_polygon_area} ${src_test_read_eddy} ${src_test_read_snapshot} ${src_test_successive_overlap} ${src_test_nearby_extr} ${src_test_max_speed_contour_ssh}) test_good_contour.f90 test_inside_4.f90 test_mean_speed.f90 test_spher_polyline_area.f90
lib_list = GPC_F contour_531 numer_rec_95 GPC shapelib_03 netcdf95 geometry jumble netcdff fortrangis shp fortranc nr_util
......@@ -36,20 +36,20 @@ VPATH += ${makefile_dir}/Tests
# 2. Objects and executable files
obj_test_local_extrema := $(src_test_local_extrema:.f=.o)
obj_test_get_1_outerm := $(src_test_get_1_outerm:.f=.o)
obj_test_set_max_speed := $(src_test_set_max_speed:.f=.o)
obj_extraction_eddies := $(src_extraction_eddies:.f=.o)
obj_test_set_all_outerm := $(src_test_set_all_outerm:.f=.o)
obj_test_weight := $(src_test_weight:.f=.o)
obj_test_spher_polygon_area := $(src_test_spher_polygon_area:.f=.o)
obj_test_read_eddy := $(src_test_read_eddy:.f=.o)
obj_test_read_snapshot := $(src_test_read_snapshot:.f=.o)
obj_test_successive_overlap := $(src_test_successive_overlap:.f=.o)
obj_test_nearby_extr := $(src_test_nearby_extr:.f=.o)
obj_test_max_speed_contour_ssh := $(src_test_max_speed_contour_ssh:.f=.o)
objects := $(sources:.f=.o)
obj_test_local_extrema := $(src_test_local_extrema:.f90=.o)
obj_test_get_1_outerm := $(src_test_get_1_outerm:.f90=.o)
obj_test_set_max_speed := $(src_test_set_max_speed:.f90=.o)
obj_extraction_eddies := $(src_extraction_eddies:.f90=.o)
obj_test_set_all_outerm := $(src_test_set_all_outerm:.f90=.o)
obj_test_weight := $(src_test_weight:.f90=.o)
obj_test_spher_polygon_area := $(src_test_spher_polygon_area:.f90=.o)
obj_test_read_eddy := $(src_test_read_eddy:.f90=.o)
obj_test_read_snapshot := $(src_test_read_snapshot:.f90=.o)
obj_test_successive_overlap := $(src_test_successive_overlap:.f90=.o)
obj_test_nearby_extr := $(src_test_nearby_extr:.f90=.o)
obj_test_max_speed_contour_ssh := $(src_test_max_speed_contour_ssh:.f90=.o)
objects := $(sources:.f90=.o)
execut = test_good_contour test_inside_4 test_get_1_outerm test_local_extrema test_max_speed_contour_ssh test_mean_speed test_set_max_speed extraction_eddies test_set_all_outerm test_weight test_spher_polyline_area test_spher_polygon_area test_read_eddy test_read_snapshot test_successive_overlap test_nearby_extr
......
# test_max_speed_contour
target_sources(test_max_speed_contour_ssh PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_max_speed_contour_ssh.f90)
target_include_directories(test_max_speed_contour_ssh PRIVATE
${netcdf95_INCLUDE_DIR} ${netcdff_INCLUDE_DIR} ${contour_531_INCLUDE_DIR}
${jumble_INCLUDE_DIR} ${nr_util_INCLUDE_DIR})
target_link_libraries(test_max_speed_contour_ssh ${netcdf95_LIBRARY}
${netcdff_LIBRARY} ${contour_531_LIBRARY} ${jumble_LIBRARY}
${nr_util_LIBRARY} ${NetCDF_LIBRARY})
# test_nearby_extr
target_sources(test_nearby_extr PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_nearby_extr.f90)
target_include_directories(test_nearby_extr PRIVATE
${contour_531_INCLUDE_DIR} ${netcdff_INCLUDE_DIR}
${fortrangis_INCLUDE_DIR} ${netcdf95_INCLUDE_DIR}
${shapelib_INCLUDE_DIR} ${shapelib_03_INCLUDE_DIR})
target_link_libraries(test_nearby_extr ${contour_531_LIBRARY}
${fortrangis_LIBRARY} ${fortranc_LIBRARY} ${shapelib_LIBRARY}
${netcdf95_LIBRARY} ${netcdff_LIBRARY} ${NetCDF_LIBRARY}
${shapelib_03_LIBRARY})
# test_successive_overlap
target_sources(test_successive_overlap PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_successive_overlap.f90)
target_include_directories(test_successive_overlap PRIVATE
${contour_531_INCLUDE_DIR} ${fortrangis_INCLUDE_DIR}
${GPC_F_INCLUDE_DIR} ${nr_util_INCLUDE_DIR} ${geometry_INCLUDE_DIR}
${jumble_INCLUDE_DIR})
target_link_libraries(test_successive_overlap ${contour_531_LIBRARY}
${fortrangis_LIBRARY} ${fortranc_LIBRARY} ${shapelib_LIBRARY}
${GPC_F_LIBRARY} ${GPC_LIBRARY} ${shapelib_03_LIBRARY}
${jumble_LIBRARY} ${nr_util_LIBRARY} ${geometry_LIBRARY})
# test_read_snapshot
target_sources(test_read_snapshot PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_read_snapshot.f90
${CMAKE_CURRENT_LIST_DIR}/write_extr_map.f90)
target_include_directories(test_read_snapshot PRIVATE
${netcdf95_INCLUDE_DIR} ${netcdff_INCLUDE_DIR}
${fortrangis_INCLUDE_DIR} ${contour_531_INCLUDE_DIR})
target_link_libraries(test_read_snapshot ${contour_531_LIBRARY}
${shapelib_03_LIBRARY} ${nr_util_LIBRARY} ${fortrangis_LIBRARY}
${fortranc_LIBRARY} ${shapelib_LIBRARY} ${GPC_F_LIBRARY}
${netcdf95_LIBRARY} ${netcdff_LIBRARY} ${NetCDF_LIBRARY})
# test_spher_polygon_area
target_sources(test_spher_polygon_area PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_spher_polygon_area.f90)
target_include_directories(test_spher_polygon_area PRIVATE
${contour_531_INCLUDE_DIR} ${fortrangis_INCLUDE_DIR})
target_link_libraries(test_spher_polygon_area ${contour_531_LIBRARY}
${shapelib_03_LIBRARY} ${fortrangis_LIBRARY} ${fortranc_LIBRARY}
${shapelib_LIBRARY} ${geometry_LIBRARY} ${jumble_LIBRARY}
${GPC_F_LIBRARY} ${GPC_LIBRARY} ${netcdff_LIBRARY} ${NetCDF_LIBRARY})
# test_local_extrema
target_sources(test_local_extrema PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_local_extrema.f90
${CMAKE_CURRENT_LIST_DIR}/write_extr_map.f90)
target_include_directories(test_local_extrema PRIVATE
${netcdf95_INCLUDE_DIR} ${netcdff_INCLUDE_DIR})
target_link_libraries(test_local_extrema ${jumble_LIBRARY}
${nr_util_LIBRARY} ${netcdf95_LIBRARY} ${netcdff_LIBRARY}
${NetCDF_LIBRARY})
# test_set_max_speed
target_sources(test_set_max_speed PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_set_max_speed.f90)
target_include_directories(test_set_max_speed PRIVATE
${contour_531_INCLUDE_DIR} ${netcdff_INCLUDE_DIR} ${fortrangis_INCLUDE_DIR})
target_link_libraries(test_set_max_speed ${contour_531_LIBRARY}
${geometry_LIBRARY} ${numer_rec_95_LIBRARY} ${jumble_LIBRARY}
${nr_util_LIBRARY} ${netcdf95_LIBRARY} ${netcdff_LIBRARY}
${NetCDF_LIBRARY} ${shapelib_03_LIBRARY} ${fortrangis_LIBRARY}
${fortranc_LIBRARY} ${shapelib_LIBRARY})
# test_weight
target_sources(test_weight PRIVATE ${CMAKE_CURRENT_LIST_DIR}/test_weight.f90)
target_include_directories(test_weight PRIVATE ${contour_531_INCLUDE_DIR})
target_link_libraries(test_weight ${contour_531_LIBRARY})
# test_read_eddy
target_sources(test_read_eddy PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_read_eddy.f90)
target_include_directories(test_read_eddy PRIVATE
${contour_531_INCLUDE_DIR} ${fortrangis_INCLUDE_DIR})
target_link_libraries(test_read_eddy ${contour_531_LIBRARY}
${shapelib_03_LIBRARY} ${fortrangis_LIBRARY} ${fortranc_LIBRARY}
${shapelib_LIBRARY} ${GPC_F_LIBRARY} ${GPC_LIBRARY})
# test_get_1_outerm
target_sources(test_get_1_outerm PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_get_1_outerm.f90)
target_include_directories(test_get_1_outerm PRIVATE
${contour_531_INCLUDE_DIR} ${netcdff_INCLUDE_DIR} ${fortrangis_INCLUDE_DIR})
target_link_libraries(test_get_1_outerm ${contour_531_LIBRARY}
${geometry_LIBRARY} ${jumble_LIBRARY} ${nr_util_LIBRARY}
${netcdf95_LIBRARY} ${netcdff_LIBRARY} ${NetCDF_LIBRARY}
${shapelib_03_LIBRARY} ${fortrangis_LIBRARY} ${fortranc_LIBRARY}
${shapelib_LIBRARY})
# test_set_all_outerm
target_sources(test_set_all_outerm PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_set_all_outerm.f90)
target_include_directories(test_set_all_outerm PRIVATE
${contour_531_INCLUDE_DIR} ${netcdff_INCLUDE_DIR} ${fortrangis_INCLUDE_DIR})
target_link_libraries(test_set_all_outerm ${contour_531_LIBRARY}
${numer_rec_95_LIBRARY} ${jumble_LIBRARY} ${nr_util_LIBRARY}
${geometry_LIBRARY} ${netcdf95_LIBRARY} ${netcdff_LIBRARY}
${NetCDF_LIBRARY} ${shapelib_03_LIBRARY} ${fortrangis_LIBRARY}
${fortranc_LIBRARY} ${shapelib_LIBRARY})
# test_good_contour
target_sources(test_good_contour PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_good_contour.f90)
target_include_directories(test_good_contour PRIVATE
${contour_531_INCLUDE_DIR} ${netcdff_INCLUDE_DIR} ${fortrangis_INCLUDE_DIR})
target_link_libraries(test_good_contour ${contour_531_LIBRARY}
${geometry_LIBRARY} ${jumble_LIBRARY} ${nr_util_LIBRARY}
${netcdf95_LIBRARY} ${netcdff_LIBRARY} ${NetCDF_LIBRARY}
${shapelib_03_LIBRARY} ${fortrangis_LIBRARY} ${fortranc_LIBRARY}
${shapelib_LIBRARY})
# test_inside_4
target_sources(test_inside_4 PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_inside_4.f90)
target_include_directories(test_inside_4 PRIVATE
${geometry_INCLUDE_DIR} ${fortrangis_INCLUDE_DIR})
target_link_libraries(test_inside_4 ${geometry_LIBRARY}
${jumble_LIBRARY} ${nr_util_LIBRARY} ${shapelib_03_LIBRARY}
${fortrangis_LIBRARY} ${fortranc_LIBRARY} ${shapelib_LIBRARY})
# test_mean_speed
target_sources(test_mean_speed PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_mean_speed.f90)
target_include_directories(test_mean_speed PRIVATE
${contour_531_INCLUDE_DIR} ${netcdff_INCLUDE_DIR} ${fortrangis_INCLUDE_DIR})
target_link_libraries(test_mean_speed ${numer_rec_95_LIBRARY} ${nr_util_LIBRARY}
${netcdf95_LIBRARY} ${netcdff_LIBRARY} ${NetCDF_LIBRARY}
${shapelib_03_LIBRARY} ${fortrangis_LIBRARY} ${fortranc_LIBRARY}
${shapelib_LIBRARY})
# test_spher_polyline_area
target_sources(test_spher_polyline_area PRIVATE
${CMAKE_CURRENT_LIST_DIR}/test_spher_polyline_area.f90)
target_include_directories(test_spher_polyline_area PRIVATE
${contour_531_INCLUDE_DIR})
target_link_libraries(test_spher_polyline_area ${geometry_LIBRARY})
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment