mirror of
https://github.com/JHUAPL/kaiju.git
synced 2026-01-09 15:17:56 -05:00
Attempt to make ifort 17 work
This commit is contained in:
@@ -25,9 +25,12 @@ endif()
|
||||
#-------------
|
||||
#Set minimum compiler versions
|
||||
if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
|
||||
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
|
||||
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 17.0)
|
||||
message("Fortran compiler too old! What, were you gonna use punch cards?")
|
||||
message(FATAL_ERROR "ifort > 18.0 required")
|
||||
message(FATAL_ERROR "ifort > 17.0 required")
|
||||
elseif( (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0) AND (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0) )
|
||||
message(WARNING "Compiler has incomplete F2008 features, Git hash/compiler information won't be saved to H5 files")
|
||||
add_compile_definitions(__INTEL_COMPILER_OLD)
|
||||
endif()
|
||||
elseif(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
|
||||
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0)
|
||||
|
||||
@@ -42,10 +42,13 @@ contains
|
||||
call ClearIO(IOVars)
|
||||
call AddOutVar(IOVars,"GITHASH",gStr)
|
||||
call AddOutVar(IOVars,"GITBRANCH",bStr)
|
||||
|
||||
#ifdef __INTEL_COMPILER_OLD
|
||||
call AddOutVar(IOVars,"COMPILER",gStr)
|
||||
call AddOutVar(IOVars,"COMPILEROPTS",gStr)
|
||||
#else
|
||||
call AddOutVar(IOVars,"COMPILER",compiler_version())
|
||||
call AddOutVar(IOVars,"COMPILEROPTS",compiler_options())
|
||||
|
||||
#endif
|
||||
call AddOutVar(IOVars,"DATETIME",dtStr)
|
||||
call WriteVars(IOVars,.true.,fIn)
|
||||
|
||||
|
||||
@@ -63,7 +63,11 @@ module strings
|
||||
write(*,*) 'Kaiju configuration'
|
||||
write(*,'(2a)') 'Git branch = ', trim(bStr)
|
||||
write(*,'(2a)') 'Git hash = ', trim(gStr)
|
||||
#ifdef __INTEL_COMPILER_OLD
|
||||
write(*,'(2a)') 'Compiler = ', trim(gStr)
|
||||
#else
|
||||
write(*,'(2a)') 'Compiler = ', compiler_version()
|
||||
#endif
|
||||
write(*,'(2a)') 'Run starting on: ', trim(dtStr)
|
||||
|
||||
!write(*,'(2a)') 'Compiler flags = ', compiler_options()
|
||||
@@ -81,10 +85,13 @@ module strings
|
||||
|
||||
nOff = 16
|
||||
nH = 7
|
||||
#ifdef __INTEL_COMPILER_OLD
|
||||
gStr = "XXXXXXX" !Avoid unavailable compiler_options
|
||||
#else
|
||||
cOpts = compiler_options()
|
||||
n = index(cOpts,"-DGITCOMMITHASH=")
|
||||
gStr = cOpts(n+nOff:n+nOff+nH)
|
||||
|
||||
#endif
|
||||
end subroutine GitHash
|
||||
|
||||
!Create string with git hash if possible
|
||||
@@ -95,13 +102,16 @@ module strings
|
||||
integer :: n,nOff
|
||||
|
||||
nOff = 12
|
||||
#ifdef __INTEL_COMPILER_OLD
|
||||
cOpts = compiler_options()
|
||||
gStr = "XXXXXXX" !Avoid unavailable compiler_options
|
||||
#else
|
||||
n = index(cOpts,"-DGITBRANCH=")
|
||||
!Don't know length of branch name, so need to find next space
|
||||
gStr = cOpts(n+nOff:)
|
||||
n = index(gStr," ")
|
||||
gStr = gStr(1:n-1)
|
||||
|
||||
#endif
|
||||
end subroutine GitBranch
|
||||
|
||||
|
||||
|
||||
@@ -675,6 +675,8 @@ module msphutils
|
||||
B = State%Bxyz(i,j,k,:)
|
||||
call Mom2Rel(Model,pW(DEN),B,Lam)
|
||||
Mxyz = matmul(Lam,pCon(MOMX:MOMZ)) !semi-relativistic momentum
|
||||
else
|
||||
Mxyz = pCon(MOMX:MOMZ) !Classical momentum
|
||||
endif
|
||||
|
||||
!Get timescale, taking directly from Gas0
|
||||
@@ -699,7 +701,15 @@ module msphutils
|
||||
call Rel2Mom(Model,pW(DEN),B,Laminv)
|
||||
Vxyz = matmul(Laminv,Mxyz)/max(pW(DEN),dFloor)
|
||||
pW(VELX:VELZ) = Vxyz
|
||||
endif !Otherwise leave primitive state (VELX:VELZ) unchanged
|
||||
else
|
||||
Vxyz = Mxyz/max(pW(DEN),dFloor) !Conserve classical momentum
|
||||
!Don't allow mass ingestion to speed things up
|
||||
if ( norm2(Vxyz) <= norm2(pW(VELX:VELZ)) ) then
|
||||
!Conserve momentum if it doesn't increase speed
|
||||
pW(VELX:VELZ) = Vxyz
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
!Now put back
|
||||
call CellP2C(Model,pW,pCon)
|
||||
|
||||
Reference in New Issue
Block a user