Skip to content

Commit

Permalink
Move parameters from driver.F90 to namelist (#2)
Browse files Browse the repository at this point in the history
Add support for defining most parameter-specific values and activate/deactivate switches from driver.F90 to a namelist file named input.nml. Only a few rarely-changed parameter-specific values belonging to the "Declarations of local variables (INPUTS)" section have been left in but can be added to the namelist and removed from driver.F90 at a later stage.
  • Loading branch information
dmey authored Apr 23, 2019
1 parent 1809573 commit 4a05bc4
Show file tree
Hide file tree
Showing 5 changed files with 507 additions and 430 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# General
.vscode/

# Build
build/

Expand Down Expand Up @@ -36,6 +39,3 @@ build/
*.exe
*.out
*.app

# TEB test output files
tests/CAPITOUL/output/*.txt
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
cmake_minimum_required(VERSION 3.1)
project(TEB Fortran)

if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Debug")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (default Debug)" FORCE)
endif()

if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
# -fimplicit-none
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall -fdefault-real-8")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -ffpe-trap=invalid,zero,overflow,underflow -fcheck=all")
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
# -implicitnone
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -traceback -fpe-all0 -check all")
else()
message(FATAL_ERROR "Only gfortran and ifort compilers supported")
endif()

set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)

set(src_driver
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ cd test/CAPITOUL
../../build/driver
```

The output files are written to `tests/CAPITOUL/output`. You can compare them with the reference outputs in `tests/CAPITOUL/ref_output`.
The output files are written to `tests/CAPITOUL/output`. You can compare them with the reference outputs in `tests/CAPITOUL/ref_output`. You can modify parameter-specific values or activate/deactivate part of TEB from the `input.nml` file.
Loading

0 comments on commit 4a05bc4

Please sign in to comment.