Skip to content

Commit

Permalink
Merge pull request #571 from GEOS-ESM/feature/rreichle/mk_restarts_cl…
Browse files Browse the repository at this point in the history
…eanup

Cleanup of Catch[CN]-related restart utilities in ./GEOSsurface_GridComp/Utils/mk_restarts
  • Loading branch information
sdrabenh authored Jul 20, 2022
2 parents d725913 + db30e9a commit 71e1e65
Show file tree
Hide file tree
Showing 21 changed files with 2,806 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ install( FILES ${resource_files}
)

set (srcs
getids.F90
StieglitzSnow.F90
SurfParams.F90)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if(NOT FORTRAN_COMPILER_SUPPORTS_FINDLOC)
list(APPEND srcs findloc.F90)
endif ()

esma_add_library(${this} SRCS ${srcs} DEPENDENCIES MAPL GEOS_LandShared esmf NetCDF::NetCDF_Fortran OpenMP::OpenMP_Fortran OpenMP::OpenMP_C)
esma_add_library(${this} SRCS ${srcs} DEPENDENCIES MAPL GEOS_SurfaceShared GEOS_LandShared esmf NetCDF::NetCDF_Fortran OpenMP::OpenMP_Fortran OpenMP::OpenMP_C)

if(NOT FORTRAN_COMPILER_SUPPORTS_FINDLOC)
target_compile_definitions(${this} PRIVATE USE_EXTERNAL_FINDLOC)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
esma_set_this ()

set(srcs
getids.F90
CatchmentRst.F90
CatchmentCNRst.F90
)

set (exe_srcs
Expand All @@ -16,18 +17,28 @@ set (exe_srcs
mk_LakeLandiceSaltRestarts.F90
mk_RouteRestarts.F90
mk_GEOSldasRestarts.F90
mk_catchANDcnRestarts.F90
)

esma_add_library (${this}
SRCS ${srcs}
DEPENDENCIES MAPL esmf NetCDF::NetCDF_Fortran)
DEPENDENCIES MAPL GEOS_SurfaceShared GEOS_LandShared esmf NetCDF::NetCDF_Fortran)

foreach (src ${exe_srcs})
string (REGEX REPLACE ".F90" "" exe ${src})
string (REGEX REPLACE ".F90" ".x" exe ${src})
ecbuild_add_executable (
TARGET ${exe}
SOURCES ${src}
LIBS MAPL GFTL_SHARED::gftl-shared GEOS_SurfaceShared GEOSroute_GridComp GEOS_LandShared ${this})
endforeach ()

install(PROGRAMS mk_Restarts DESTINATION bin)
foreach (src ${exe_srcs})
string (REGEX REPLACE ".F90" ".x" exe ${src})
string (REGEX REPLACE ".F90" "" lname ${src})
install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${CMAKE_INSTALL_PREFIX}/bin/${exe} \
${CMAKE_INSTALL_PREFIX}/bin/${lname} \
)")
endforeach ()
Loading

0 comments on commit 71e1e65

Please sign in to comment.