better name
This commit is contained in:
parent
6f8f2da2c0
commit
ba0b278aca
|
@ -7,11 +7,11 @@ SHELL = /bin/sh
|
||||||
# OPTIONS = standard (alternative): meaning
|
# OPTIONS = standard (alternative): meaning
|
||||||
#-------------------------------------------------------------
|
#-------------------------------------------------------------
|
||||||
# F90 = ifort (gfortran): compiler type, choose Intel or GNU
|
# F90 = ifort (gfortran): compiler type, choose Intel or GNU
|
||||||
# COMPILERNAME = name of the compiler executable (if not the same as the ype), e.g. using mpich-g90 instead of ifort
|
# FCOMPILERNAME = name of the compiler executable (if not the same as the ype), e.g. using mpich-g90 instead of ifort
|
||||||
# PORTABLE = TRUE (FALSE): decision, if executable is optimized for the machine on which it was built.
|
# PORTABLE = TRUE (FALSE): decision, if executable is optimized for the machine on which it was built.
|
||||||
# OPTIMIZATION = DEFENSIVE (OFF,AGGRESSIVE,ULTRA): Optimization mode: O2, O0, O3 + further options for most files, O3 + further options for all files
|
# OPTIMIZATION = DEFENSIVE (OFF,AGGRESSIVE,ULTRA): Optimization mode: O2, O0, O3 + further options for most files, O3 + further options for all files
|
||||||
# OPENMP = TRUE (FALSE): OpenMP multiprocessor support
|
# OPENMP = TRUE (FALSE): OpenMP multiprocessor support
|
||||||
# PREFIX = arbitrary prefix (before compilername)
|
# PREFIX = arbitrary prefix (before FCOMPILERNAME)
|
||||||
# OPTION = arbitrary option (just before file to compile)
|
# OPTION = arbitrary option (just before file to compile)
|
||||||
# SUFFIX = arbitrary suffix (after file to compile)
|
# SUFFIX = arbitrary suffix (after file to compile)
|
||||||
# STANDARD_CHECK = checking for Fortran 2008, compiler dependend
|
# STANDARD_CHECK = checking for Fortran 2008, compiler dependend
|
||||||
|
@ -24,7 +24,7 @@ include ${PETSC_DIR}/lib/petsc/conf/rules
|
||||||
|
|
||||||
INCLUDE_DIRS := $(PETSC_FC_INCLUDES) -DPETSc -I../lib
|
INCLUDE_DIRS := $(PETSC_FC_INCLUDES) -DPETSc -I../lib
|
||||||
LIBRARIES := $(PETSC_WITH_EXTERNAL_LIB)
|
LIBRARIES := $(PETSC_WITH_EXTERNAL_LIB)
|
||||||
COMPILERNAME ?= $(FC)
|
FCOMPILERNAME ?= $(FC)
|
||||||
CCOMPILERNAME ?= $(CC)
|
CCOMPILERNAME ?= $(CC)
|
||||||
LINKERNAME ?= $(FLINKER)
|
LINKERNAME ?= $(FLINKER)
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ DAMASK_spectral.exe: DAMASK_spectral.o
|
||||||
|
|
||||||
DAMASK_spectral.o: DAMASK_spectral.f90 \
|
DAMASK_spectral.o: DAMASK_spectral.f90 \
|
||||||
$(SPECTRAL_SOLVER_FILES)
|
$(SPECTRAL_SOLVER_FILES)
|
||||||
$(PREFIX) $(COMPILERNAME) $(COMPILE_MAXOPTI) -c DAMASK_spectral.f90 $(SUFFIX)
|
$(PREFIX) $(FCOMPILERNAME) $(COMPILE_MAXOPTI) -c DAMASK_spectral.f90 $(SUFFIX)
|
||||||
|
|
||||||
spectral_mech_AL.o: spectral_mech_AL.f90 \
|
spectral_mech_AL.o: spectral_mech_AL.f90 \
|
||||||
spectral_utilities.o
|
spectral_utilities.o
|
||||||
|
@ -416,7 +416,7 @@ DAMASK_FEM.exe: DAMASK_FEM_driver.o
|
||||||
$(FEM_FILES) $(LIBRARIES) $(SUFFIX)
|
$(FEM_FILES) $(LIBRARIES) $(SUFFIX)
|
||||||
|
|
||||||
DAMASK_FEM_driver.o: DAMASK_FEM_driver.f90 $(FEM_SOLVER_FILES)
|
DAMASK_FEM_driver.o: DAMASK_FEM_driver.f90 $(FEM_SOLVER_FILES)
|
||||||
$(PREFIX) $(COMPILERNAME) $(COMPILE_MAXOPTI) -c ../private/FEM/code/DAMASK_FEM_driver.f90 $(SUFFIX)
|
$(PREFIX) $(FCOMPILERNAME) $(COMPILE_MAXOPTI) -c ../private/FEM/code/DAMASK_FEM_driver.f90 $(SUFFIX)
|
||||||
|
|
||||||
FEM_mech.o: FEM_mech.f90 \
|
FEM_mech.o: FEM_mech.f90 \
|
||||||
FEM_utilities.o
|
FEM_utilities.o
|
||||||
|
@ -441,7 +441,7 @@ FEM_utilities.o: FEM_utilities.f90 \
|
||||||
|
|
||||||
FEZoo.o: $(wildcard FEZoo.f90) \
|
FEZoo.o: $(wildcard FEZoo.f90) \
|
||||||
IO.o
|
IO.o
|
||||||
$(IGNORE) $(PREFIX) $(COMPILERNAME) $(COMPILE) -c ../private/FEM/code/FEZoo.f90 $(SUFFIX)
|
$(IGNORE) $(PREFIX) $(FCOMPILERNAME) $(COMPILE) -c ../private/FEM/code/FEZoo.f90 $(SUFFIX)
|
||||||
touch FEZoo.o
|
touch FEZoo.o
|
||||||
|
|
||||||
CPFEM.o: CPFEM.f90 \
|
CPFEM.o: CPFEM.f90 \
|
||||||
|
@ -585,7 +585,7 @@ plastic_none.o: plastic_none.f90 \
|
||||||
ifeq "$(F90)" "gfortran"
|
ifeq "$(F90)" "gfortran"
|
||||||
lattice.o: lattice.f90 \
|
lattice.o: lattice.f90 \
|
||||||
material.o
|
material.o
|
||||||
$(PREFIX) $(COMPILERNAME) $(COMPILE) -ffree-line-length-240 -c lattice.f90 $(SUFFIX)
|
$(PREFIX) $(FCOMPILERNAME) $(COMPILE) -ffree-line-length-240 -c lattice.f90 $(SUFFIX)
|
||||||
# long lines for interaction matrix
|
# long lines for interaction matrix
|
||||||
else
|
else
|
||||||
lattice.o: lattice.f90 \
|
lattice.o: lattice.f90 \
|
||||||
|
@ -600,7 +600,7 @@ mesh.o: mesh.f90 \
|
||||||
FEsolving.o \
|
FEsolving.o \
|
||||||
math.o \
|
math.o \
|
||||||
FEZoo.o
|
FEZoo.o
|
||||||
$(PREFIX) $(COMPILERNAME) $(COMPILE) -c $(MESHNAME) -o mesh.o $(SUFFIX)
|
$(PREFIX) $(FCOMPILERNAME) $(COMPILE) -c $(MESHNAME) -o mesh.o $(SUFFIX)
|
||||||
|
|
||||||
FEsolving.o: FEsolving.f90 \
|
FEsolving.o: FEsolving.f90 \
|
||||||
debug.o
|
debug.o
|
||||||
|
@ -623,12 +623,12 @@ IO.o: IO.f90 \
|
||||||
DAMASK_interface.o: spectral_interface.f90 \
|
DAMASK_interface.o: spectral_interface.f90 \
|
||||||
$(wildcard DAMASK_FEM_interface.f90) \
|
$(wildcard DAMASK_FEM_interface.f90) \
|
||||||
prec.o
|
prec.o
|
||||||
$(PREFIX) $(COMPILERNAME) $(COMPILE) -c $(INTERFACENAME) -o DAMASK_interface.o $(SUFFIX)
|
$(PREFIX) $(FCOMPILERNAME) $(COMPILE) -c $(INTERFACENAME) -o DAMASK_interface.o $(SUFFIX)
|
||||||
|
|
||||||
ifeq "$(F90)" "gfortran"
|
ifeq "$(F90)" "gfortran"
|
||||||
prec.o: prec.f90 \
|
prec.o: prec.f90 \
|
||||||
system_routines.o
|
system_routines.o
|
||||||
$(PREFIX) $(COMPILERNAME) $(COMPILE) -c prec.f90 -fno-range-check -fall-intrinsics -fno-fast-math $(SUFFIX)
|
$(PREFIX) $(FCOMPILERNAME) $(COMPILE) -c prec.f90 -fno-range-check -fall-intrinsics -fno-fast-math $(SUFFIX)
|
||||||
# fno-range-check: Disable range checking on results of simplification of constant expressions during compilation
|
# fno-range-check: Disable range checking on results of simplification of constant expressions during compilation
|
||||||
# --> allows the definition of DAMASK_NaN
|
# --> allows the definition of DAMASK_NaN
|
||||||
#-fall-intrinsics: all intrinsic procedures (including the GNU-specific extensions) are accepted. -Wintrinsics-std will be ignored
|
#-fall-intrinsics: all intrinsic procedures (including the GNU-specific extensions) are accepted. -Wintrinsics-std will be ignored
|
||||||
|
@ -649,7 +649,7 @@ C_routines.o: C_routines.c
|
||||||
|
|
||||||
|
|
||||||
%.o : %.f90
|
%.o : %.f90
|
||||||
$(PREFIX) $(COMPILERNAME) $(COMPILE) -c $< $(SUFFIX)
|
$(PREFIX) $(FCOMPILERNAME) $(COMPILE) -c $< $(SUFFIX)
|
||||||
|
|
||||||
%.o : %.c
|
%.o : %.c
|
||||||
$(CCOMPILERNAME) -c $<
|
$(CCOMPILERNAME) -c $<
|
||||||
|
@ -679,6 +679,6 @@ cleanDAMASK:
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
help:
|
help:
|
||||||
F90="$(F90)"
|
F90="$(F90)"
|
||||||
COMPILERNAME="$(COMPILERNAME)"
|
FCOMPILERNAME="$(FCOMPILERNAME)"
|
||||||
COMPILEROUT="$(COMPILEROUT)"
|
COMPILEROUT="$(COMPILEROUT)"
|
||||||
|
|
||||||
|
|
|
@ -220,7 +220,7 @@ end subroutine DAMASK_interface_init
|
||||||
character(len=1024) function storeWorkingDirectory(workingDirectoryArg,geometryArg)
|
character(len=1024) function storeWorkingDirectory(workingDirectoryArg,geometryArg)
|
||||||
use system_routines, only: &
|
use system_routines, only: &
|
||||||
isDirectory, &
|
isDirectory, &
|
||||||
getCWD2
|
getCWD
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
character(len=*), intent(in) :: workingDirectoryArg !< working directory argument
|
character(len=*), intent(in) :: workingDirectoryArg !< working directory argument
|
||||||
|
@ -237,7 +237,7 @@ character(len=1024) function storeWorkingDirectory(workingDirectoryArg,geometryA
|
||||||
if (workingDirectoryArg(1:1) == pathSep) then ! absolute path given as command line argument
|
if (workingDirectoryArg(1:1) == pathSep) then ! absolute path given as command line argument
|
||||||
storeWorkingDirectory = workingDirectoryArg
|
storeWorkingDirectory = workingDirectoryArg
|
||||||
else
|
else
|
||||||
error = getCWD2(cwd) ! relative path given as command line argument
|
error = getCWD(cwd) ! relative path given as command line argument
|
||||||
storeWorkingDirectory = trim(cwd)//pathSep//workingDirectoryArg
|
storeWorkingDirectory = trim(cwd)//pathSep//workingDirectoryArg
|
||||||
endif
|
endif
|
||||||
if (storeWorkingDirectory(len(trim(storeWorkingDirectory)):len(trim(storeWorkingDirectory)))/= pathSep) &
|
if (storeWorkingDirectory(len(trim(storeWorkingDirectory)):len(trim(storeWorkingDirectory)))/= pathSep) &
|
||||||
|
@ -250,7 +250,7 @@ character(len=1024) function storeWorkingDirectory(workingDirectoryArg,geometryA
|
||||||
if (geometryArg(1:1) == pathSep) then ! absolute path given as command line argument
|
if (geometryArg(1:1) == pathSep) then ! absolute path given as command line argument
|
||||||
storeWorkingDirectory = geometryArg(1:scan(geometryArg,pathSep,back=.true.))
|
storeWorkingDirectory = geometryArg(1:scan(geometryArg,pathSep,back=.true.))
|
||||||
else
|
else
|
||||||
error = getCWD2(cwd) ! relative path given as command line argument
|
error = getCWD(cwd) ! relative path given as command line argument
|
||||||
storeWorkingDirectory = trim(cwd)//pathSep//&
|
storeWorkingDirectory = trim(cwd)//pathSep//&
|
||||||
geometryArg(1:scan(geometryArg,pathSep,back=.true.))
|
geometryArg(1:scan(geometryArg,pathSep,back=.true.))
|
||||||
endif
|
endif
|
||||||
|
@ -303,7 +303,7 @@ end function getSolverJobName
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
character(len=1024) function getGeometryFile(geometryParameter)
|
character(len=1024) function getGeometryFile(geometryParameter)
|
||||||
use system_routines, only: &
|
use system_routines, only: &
|
||||||
getCWD2
|
getCWD
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
character(len=1024), intent(in) :: &
|
character(len=1024), intent(in) :: &
|
||||||
|
@ -321,7 +321,7 @@ character(len=1024) function getGeometryFile(geometryParameter)
|
||||||
|
|
||||||
if (posExt <= posSep) getGeometryFile = trim(getGeometryFile)//('.geom') ! no extension present
|
if (posExt <= posSep) getGeometryFile = trim(getGeometryFile)//('.geom') ! no extension present
|
||||||
if (scan(getGeometryFile,pathSep) /= 1) then ! relative path given as command line argument
|
if (scan(getGeometryFile,pathSep) /= 1) then ! relative path given as command line argument
|
||||||
error = getCWD2(cwd)
|
error = getCWD(cwd)
|
||||||
getGeometryFile = rectifyPath(trim(cwd)//pathSep//getGeometryFile)
|
getGeometryFile = rectifyPath(trim(cwd)//pathSep//getGeometryFile)
|
||||||
else
|
else
|
||||||
getGeometryFile = rectifyPath(getGeometryFile)
|
getGeometryFile = rectifyPath(getGeometryFile)
|
||||||
|
@ -337,7 +337,7 @@ end function getGeometryFile
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
character(len=1024) function getLoadCaseFile(loadCaseParameter)
|
character(len=1024) function getLoadCaseFile(loadCaseParameter)
|
||||||
use system_routines, only: &
|
use system_routines, only: &
|
||||||
getCWD2
|
getCWD
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
character(len=1024), intent(in) :: &
|
character(len=1024), intent(in) :: &
|
||||||
|
@ -355,7 +355,7 @@ character(len=1024) function getLoadCaseFile(loadCaseParameter)
|
||||||
|
|
||||||
if (posExt <= posSep) getLoadCaseFile = trim(getLoadCaseFile)//('.load') ! no extension present
|
if (posExt <= posSep) getLoadCaseFile = trim(getLoadCaseFile)//('.load') ! no extension present
|
||||||
if (scan(getLoadCaseFile,pathSep) /= 1) then ! relative path given as command line argument
|
if (scan(getLoadCaseFile,pathSep) /= 1) then ! relative path given as command line argument
|
||||||
error = getCWD2(cwd)
|
error = getCWD(cwd)
|
||||||
getLoadCaseFile = rectifyPath(trim(cwd)//pathSep//getLoadCaseFile)
|
getLoadCaseFile = rectifyPath(trim(cwd)//pathSep//getLoadCaseFile)
|
||||||
else
|
else
|
||||||
getLoadCaseFile = rectifyPath(getLoadCaseFile)
|
getLoadCaseFile = rectifyPath(getLoadCaseFile)
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
|
||||||
|
!> @brief provides wrappers to C routines
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
module system_routines
|
module system_routines
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
|
@ -5,7 +9,7 @@ module system_routines
|
||||||
|
|
||||||
public :: &
|
public :: &
|
||||||
isDirectory, &
|
isDirectory, &
|
||||||
getCWD2
|
getCWD
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
@ -31,35 +35,41 @@ end interface
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
logical function isDirectory(path)
|
!--------------------------------------------------------------------------------------------------
|
||||||
use, intrinsic :: ISO_C_Binding, only: &
|
!> @brief figures out if a given path is a directory (and not an ordinary file)
|
||||||
C_INT
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
logical function isDirectory(path)
|
||||||
|
use, intrinsic :: ISO_C_Binding, only: &
|
||||||
|
C_INT
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
character(len=*), intent(in) :: path
|
character(len=*), intent(in) :: path
|
||||||
|
|
||||||
isDirectory=merge(.True.,.False.,isDirectory_C(trim(path)) /= 0_C_INT)
|
isDirectory=merge(.True.,.False.,isDirectory_C(trim(path)) /= 0_C_INT)
|
||||||
|
|
||||||
end function isDirectory
|
end function isDirectory
|
||||||
|
|
||||||
|
|
||||||
logical function getCWD2(str)
|
!--------------------------------------------------------------------------------------------------
|
||||||
use, intrinsic :: ISO_C_Binding, only: &
|
!> @brief gets the current working directory
|
||||||
C_INT, &
|
!--------------------------------------------------------------------------------------------------
|
||||||
C_CHAR, &
|
logical function getCWD(str)
|
||||||
C_NULL_CHAR
|
use, intrinsic :: ISO_C_Binding, only: &
|
||||||
|
C_INT, &
|
||||||
|
C_CHAR, &
|
||||||
|
C_NULL_CHAR
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
character(len=*), intent(out) :: str
|
character(len=*), intent(out) :: str
|
||||||
character(len=1024) :: strFixedLength
|
character(len=1024) :: strFixedLength
|
||||||
integer(C_INT) :: stat
|
integer(C_INT) :: stat
|
||||||
|
|
||||||
str = repeat(C_NULL_CHAR,1024)
|
|
||||||
call getCurrentWorkDir_C(strFixedLength,stat)
|
|
||||||
str = strFixedLength(1:scan(strFixedLength,C_NULL_CHAR,.True.)-1)
|
|
||||||
getCWD2=merge(.True.,.False.,stat /= 0_C_INT)
|
|
||||||
|
|
||||||
end function getCWD2
|
str = repeat(C_NULL_CHAR,1024)
|
||||||
|
call getCurrentWorkDir_C(strFixedLength,stat)
|
||||||
|
str = strFixedLength(1:scan(strFixedLength,C_NULL_CHAR,.True.)-1)
|
||||||
|
getCWD=merge(.True.,.False.,stat /= 0_C_INT)
|
||||||
|
|
||||||
|
end function getCWD
|
||||||
|
|
||||||
end module system_routines
|
end module system_routines
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue