Skip to content

Commit

Permalink
Merge branch 'master' into UpdateTests
Browse files Browse the repository at this point in the history
  • Loading branch information
rfj82982 committed Nov 21, 2024
2 parents 9420600 + 6108535 commit 69fb139
Show file tree
Hide file tree
Showing 32 changed files with 863 additions and 723 deletions.
59 changes: 29 additions & 30 deletions cmake/X3D_Compilers.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,40 @@

# Compilers CMakeLists

set(Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER_ID} )
message(STATUS "COMP ID ${Fortran_COMPILER_NAME}")
message(STATUS "Fortran compiler name ${Fortran_COMPILER_NAME}")
message(STATUS "Fortran compiler version ${CMAKE_Fortran_COMPILER_VERSION}")

set(CMAKE_Fortran_PREPROCESS ON)
if (CMAKE_BUILD_TYPE MATCHES "DEBUG")
add_definitions("-DDEBUG -DDEBG")
endif (CMAKE_BUILD_TYPE MATCHES "DEBUG")

if (CMAKE_BUILD_TYPE MATCHES "DEV")
message(FATAL_ERROR "The code is not ready for DEV builds")
endif (CMAKE_BUILD_TYPE MATCHES "DEV")

if (ENABLE_INPLACE)
add_definitions("-DOVERWRITE")
endif ()

execute_process(
COMMAND git describe --tag --long --always
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_definitions("-DVERSION=\"${GIT_VERSION}\"")
option(DOUBLE_PRECISION "Build Xcompact with double precision" ON)
if (DOUBLE_PRECISION)
add_definitions("-DDOUBLE_PREC")
endif()

option(SINGLE_PRECISION_OUTPUT "Build XCompact with output in single precision" OFF)
if (SINGLE_PRECISION_OUTPUT)
add_definitions("-DSAVE_SINGLE")
endif()

if (Fortran_COMPILER_NAME MATCHES "GNU")
# gfortran
Expand Down Expand Up @@ -44,36 +73,6 @@ if (NOT FLAGS_SET)
set(FLAGS_SET 1 CACHE INTERNAL "Flags are set")
endif()

if (CMAKE_BUILD_TYPE MATCHES "DEBUG")
add_definitions("-DDEBUG")
endif (CMAKE_BUILD_TYPE MATCHES "DEBUG")

if (CMAKE_BUILD_TYPE MATCHES "DEV")
message(FATAL_ERROR "The code is not ready for DEV builds")
endif (CMAKE_BUILD_TYPE MATCHES "DEV")

if (ENABLE_INPLACE)
add_definitions("-DOVERWRITE")
endif ()

execute_process(
COMMAND git describe --tag --long --always
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_definitions("-DVERSION=\"${GIT_VERSION}\"")
option(DOUBLE_PRECISION "Build Xcompact with double precision" ON)
if (DOUBLE_PRECISION)
add_definitions("-DDOUBLE_PREC")
endif()

option(SINGLE_PRECISION_OUTPUT "Build XCompact with output in single precision" OFF)
if (SINGLE_PRECISION_OUTPUT)
add_definitions("-DSAVE_SINGLE")
endif()


if (IO_BACKEND MATCHES "mpi")
message(STATUS "Using mpi (default) IO backend")
elseif (IO_BACKEND MATCHES "adios2")
Expand Down
2 changes: 1 addition & 1 deletion cmake/compilers/X3D_flags_gnu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else (CMAKE_Fortran_COMPILER_VERSION GREATER_EQUAL "10")
endif (CMAKE_Fortran_COMPILER_VERSION GREATER_EQUAL "10")
# Flags extracted from the Makefile
set(X3D_FFLAGS_RELEASE "-O3 -funroll-loops -floop-optimize -g") #"-O3 -funroll-loops -floop-optimize -march=native")
set(X3D_FFLAGS_DEBUG "-g3 -Og -ffpe-trap=invalid,zero -fcheck=bounds -fimplicit-none") #"-DDEBUG -g3 -Og -ffpe-trap=invalid,zero -fcheck=all -fimplicit-none")
set(X3D_FFLAGS_DEBUG "-g -Og -ffpe-trap=invalid,zero -fcheck=bounds -fimplicit-none") #"-DDEBUG -g3 -Og -ffpe-trap=invalid,zero -fcheck=all -fimplicit-none")
# Dev flag below is new and not working yet
if (FIND_MPICH AND X3D_GNU10)
set(X3D_FFLAGS_DEV "${X3D_FFLAGS_DEBUG} -Wall -Wno-unused-function -Wno-integer-division")
Expand Down
34 changes: 6 additions & 28 deletions examples/Channel/input.i3d
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ isecondder = 5 ! (1->2nd central, 2->4th central, 3->4th compact, 4-> 6th
ipinter = 3 ! interpolation scheme (1: classic, 2: optimized, 3: optimized agressive)

! Time scheme
iimplicit = 2
itimescheme = 3 ! Time integration scheme (1->Euler,2->AB2, 3->AB3, 4->AB4,5->RK3,6->RK4, 7-->CN2+AB3)
iimplicit = 0
itimescheme = 5 ! Time integration scheme (1->Euler,2->AB2, 3->AB3, 4->AB4,5->RK3,6->RK4, 7-->CN2+AB3)

! Dissipation control
nu0nu = 4.0 ! Ratio between hyperviscosity/viscosity at nu
cnu = 0.44 ! Ratio between hypervisvosity at k_m=2/3pi and k_c= pi
nu0nu = 4.0 ! Ratio between hyperviscosity/viscosity at nu
cnu = 0.44 ! Ratio between hypervisvosity at k_m=2/3pi and k_c= pi

/End

Expand All @@ -81,9 +81,8 @@ cnu = 0.44 ! Ratio between hypervisvosity at k_m=2/3pi and k_c= pi
irestart = 0 ! Read initial flow field ?
icheckpoint = 5000 ! Frequency for writing backup file
ioutput = 10000 ! Frequency for visualization
ilist = 25 ! Frequency for writing to screen
ilist = 25 ! Frequency for the output to screen
nvisu = 1 ! Size for visualisation collection
nprobes = 4 ! Number of probes

/End

Expand All @@ -98,27 +97,6 @@ initstat = 40000 ! Time steps after which statistics are collected

/End

!=================
&ProbesParam
!=================

flag_all_digits = T ! By default, only 6 digits, 16 when True
flag_extra_probes = T ! By default, gradients are not monitored
xyzprobes(1,1) = 0.1 ! X position of probe 1
xyzprobes(2,1) = 0.1 ! Y position of probe 1
xyzprobes(3,1) = 0.1 ! Z position of probe 1
xyzprobes(1,2) = 0.1 ! X position of probe 2
xyzprobes(2,2) = 0.2 ! Y position of probe 2
xyzprobes(3,2) = 0.1 ! Z position of probe 2
xyzprobes(1,3) = 0.1 ! X position of probe 3
xyzprobes(2,3) = 0.3 ! Y position of probe 3
xyzprobes(3,3) = 0.1 ! Z position of probe 3
xyzprobes(1,4) = 0.1 ! X position of probe 4
xyzprobes(2,4) = 0.4 ! Y position of probe 4
xyzprobes(3,4) = 0.1 ! Z position of probe 4

/End

!########################
! OPTIONAL PARAMETERS
!#######################
Expand All @@ -142,7 +120,7 @@ nclzSn = 0
&LESModel
!================

iles = 0 ! LES Model (1: Phys Smag, 2: Phys WALE, 3: Phys dyn. Smag, 4: iSVV, 5: dyn SEV)
iles = 0 ! LES Model (1: Phys Smag, 2: Phys WALE, 3: Phys dyn. Smag, 4: iSVV, 5: dyn SEV)
smagcst = 0.14 ! Smagorinsky constant
SmagWallDamp = 0 ! 1: Mason and Thomson Damping function, otherwise OFF
walecst = 0.5 ! WALES Model Coefficient
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ add_executable(xcompact3d
probes.f90
schemes.f90
statistics.f90
stretching.f90
time_integrators.f90
tools.f90
transeq.f90
Expand Down
Loading

0 comments on commit 69fb139

Please sign in to comment.