Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format the fortran code with fprettify. #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@
*.exe
*.out
*.app

# CMake Build Directory
build
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
project(UCNS3D Fortran)

# FFLAGS depend on the compiler
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)

if (Fortran_COMPILER_NAME MATCHES "gfortran*")
# gfortran
set(CMAKE_Fortran_FLAGS "-fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -fbackslash -fopenmp -finit-local-zero -fimplicit-none -flto -fcray-pointer -Wno-lto-type-mismatch")
set(CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3 -march=native")
set(CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g")
elseif (Fortran_COMPILER_NAME MATCHES "ifort*")
# ifort (untested)
set (CMAKE_Fortran_FLAGS_RELEASE "-f77rtl -O3")
set (CMAKE_Fortran_FLAGS_DEBUG "-f77rtl -O0 -g")
else (Fortran_COMPILER_NAME MATCHES "gfortran.*")
message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER})
message ("Fortran compiler: " ${Fortran_COMPILER_NAME})
message ("No optimized Fortran compiler flags are known, we just try -O2...")
set (CMAKE_Fortran_FLAGS_RELEASE "-O2")
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g")
endif (Fortran_COMPILER_NAME MATCHES "gfortran*")

#
find_package(MPI REQUIRED COMPONENTS Fortran)
set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER})

add_subdirectory(CODE)
43 changes: 43 additions & 0 deletions CODE/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
set(SRCS
basis.f90
bc_p.f90
communications.f90
declarations.f90
der_r.f90
flow_operations.f90
flux_p.f90
flux_pv.f90
gradients.f90
grid_p.f90
grid_t.f90
implicit_fluxes.f90
implicit_time.f90
init_p.f90
io.f90
local_pt.f90
main.f90
matrix.f90
memory.f90
mood.f90
mpi_p.f90
parameters.f90
parts.f90
prestore.f90
profile.f90
reconstruct_p.f90
riemann.f90
source.f90
svd.f90
time_p.f90
translate.f90
)

find_library(BLIS_LIBRARY NAMES libblis.a)
find_library(ParMetis_LIBRARY NAMES libparmetis.a)
find_library(Metis_LIBRARY NAMES libmetis.so)

add_executable(ucns3d_p ${SRCS} )

target_link_libraries(ucns3d_p ${BLIS_LIBRARY} ${ParMetis_LIBRARY} ${Metis_LIBRARY}
${CMAKE_CURRENT_SOURCE_DIR}/libtecio.so
)