ugly hack for Abaqus in prec, it seems that it links against old (10.1) ifort where IEEE_arithmetic is not avaialbe.

Took the chance and cleaned the env file and used #ifdef# statement in the wrappers because in fixed format Fortran some lines of code might be interpretated as comments.
This should not happen, but it happens for Abaqus exp
This commit is contained in:
Martin Diehl 2015-04-15 18:10:56 +00:00
parent caf6611485
commit eb3173c6cc
5 changed files with 26 additions and 26 deletions

View File

@ -173,11 +173,14 @@ subroutine vumat(nBlock, nDir, nshr, nStateV, nFieldV, nProps, lAnneal, &
real(pReal), dimension(6,6) :: ddsdde real(pReal), dimension(6,6) :: ddsdde
real(pReal) :: temp, timeInc, stresspower real(pReal) :: temp, timeInc, stresspower
integer(pInt) :: computationMode, n, i, cp_en integer(pInt) :: computationMode, n, i, cp_en
!$ integer :: defaultNumThreadsInt !< default value set by Abaqus
!$ include "omp_lib.h"
!$ defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc #ifdef _OPENMP
!$ call omp_set_num_threads(DAMASK_NumThreadsInt) ! set number of threads for parallel execution set by DAMASK_NUM_THREADS integer :: defaultNumThreadsInt !< default value set by Abaqus
include "omp_lib.h"
defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc
call omp_set_num_threads(DAMASK_NumThreadsInt) ! set number of threads for parallel execution set by DAMASK_NUM_THREADS
#endif
computationMode = CPFEM_CALCRESULTS ! always calculate computationMode = CPFEM_CALCRESULTS ! always calculate
do n = 1,nblock(1) ! loop over vector of IPs do n = 1,nblock(1) ! loop over vector of IPs
@ -265,7 +268,7 @@ subroutine vumat(nBlock, nDir, nshr, nStateV, nFieldV, nProps, lAnneal, &
enerInelasNew(n) = enerInternNew(n) ! Dissipated inelastic energy per unit mass(Temporary output) enerInelasNew(n) = enerInternNew(n) ! Dissipated inelastic energy per unit mass(Temporary output)
enddo enddo
!$ call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value !$ call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value
end subroutine vumat end subroutine vumat

View File

@ -181,16 +181,18 @@ subroutine UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,&
real(pReal), dimension(6,6) :: ddsdde_h real(pReal), dimension(6,6) :: ddsdde_h
integer(pInt) :: computationMode, i, cp_en integer(pInt) :: computationMode, i, cp_en
logical :: cutBack logical :: cutBack
!$ integer :: defaultNumThreadsInt !< default value set by Abaqus
!$ include "omp_lib.h" #ifdef _OPENMP
integer :: defaultNumThreadsInt !< default value set by Abaqus
include "omp_lib.h"
defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc
call omp_set_num_threads(DAMASK_NumThreadsInt) ! set number of threads for parallel execution set by DAMASK_NUM_THREADS
#endif
temperature = temp ! temp is intent(in) temperature = temp ! temp is intent(in)
DDSDDT = 0.0_pReal DDSDDT = 0.0_pReal
DRPLDE = 0.0_pReal DRPLDE = 0.0_pReal
!$ defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc
!$ call omp_set_num_threads(DAMASK_NumThreadsInt) ! set number of threads for parallel execution set by DAMASK_NUM_THREADS
if (iand(debug_level(debug_abaqus),debug_levelBasic) /= 0 .and. noel == 1 .and. npt == 1) then if (iand(debug_level(debug_abaqus),debug_levelBasic) /= 0 .and. noel == 1 .and. npt == 1) then
write(6,*) 'el',noel,'ip',npt write(6,*) 'el',noel,'ip',npt
write(6,*) 'got kInc as',kInc write(6,*) 'got kInc as',kInc
@ -310,7 +312,7 @@ subroutine UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,&
statev = materialpoint_results(1:min(nstatv,materialpoint_sizeResults),npt,mesh_FEasCP('elem', noel)) statev = materialpoint_results(1:min(nstatv,materialpoint_sizeResults),npt,mesh_FEasCP('elem', noel))
if ( terminallyIll ) pnewdt = 0.5_pReal ! force cutback directly ? if ( terminallyIll ) pnewdt = 0.5_pReal ! force cutback directly ?
!$ call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value !$ call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value
end subroutine UMAT end subroutine UMAT

View File

@ -12,8 +12,12 @@
!! for details on NaN see https://software.intel.com/en-us/forums/topic/294680 !! for details on NaN see https://software.intel.com/en-us/forums/topic/294680
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module prec module prec
#if defined(Abaqus)
use ifport ! needed as a hack for Abaqus because version 6.12-2 is linked partly against Intel Fortran Compiler 10.1. allows to use non IEEE is NaN
#endif
#ifdef __INTEL_COMPILER #ifdef __INTEL_COMPILER
use, intrinsic :: & ! unfortunately not in commonly used gfortran versions use, intrinsic :: & ! unfortunately not avialable in commonly used gfortran versions
IEEE_arithmetic IEEE_arithmetic
#endif #endif
@ -171,10 +175,10 @@ logical elemental function prec_isNaN(a)
implicit none implicit none
real(pReal), intent(in) :: a real(pReal), intent(in) :: a
#ifndef __GFORTRAN__ #if defined(__GFORTRAN__) || defined(Abaqus)
prec_isNaN = IEEE_is_NaN(a)
#else
prec_isNaN = isNaN(a) prec_isNaN = isNaN(a)
#else
prec_isNaN = IEEE_is_NaN(a)
#endif #endif
end function prec_isNaN end function prec_isNaN

View File

@ -29,18 +29,12 @@ fortCmd = "ifort"
# -assume byterecl count record length in bytes # -assume byterecl count record length in bytes
# -real-size 64 -DFLOAT=8 assume size of real to be 8 bytes, matches our definition of pReal # -real-size 64 -DFLOAT=8 assume size of real to be 8 bytes, matches our definition of pReal
# -integer-size 32 -DINT=4 assume size of integer to be 4 bytes, matches our definition of pInt # -integer-size 32 -DINT=4 assume size of integer to be 4 bytes, matches our definition of pInt
# -L/usr/lib64 -L/usr/lib search path for lapack libraries
# -Wl,-rpath=/usr/lib64,-rpath=/usr/lib run path for lapack libraries
# -llapack link against lapack
compile_fortran = (fortCmd + " -c -fPIC -auto -shared-intel " + compile_fortran = (fortCmd + " -c -fPIC -auto -shared-intel " +
"-I%I -I../lib -free -O1 -fpp -openmp " + "-I%I -I../lib -free -O1 -fpp -openmp " +
"-ftz -diag-disable 5268 " + "-ftz -diag-disable 5268 " +
"-implicitnone -assume byterecl " + "-implicitnone -assume byterecl " +
"-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4 " + "-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4")
"-L/usr/lib64 -L/usr/lib " +
"-Wl,-rpath=/usr/lib64,-rpath=/usr/lib " +
"-llapack")
# Abaqus/CAE will generate an input file without parts and assemblies. # Abaqus/CAE will generate an input file without parts and assemblies.
cae_no_parts_input_file=ON cae_no_parts_input_file=ON

View File

@ -37,10 +37,7 @@ compile_fortran = (fortCmd + " -c -fPIC -auto -shared-intel " +
"-I%I -I../lib -free -O1 -fpp " + "-I%I -I../lib -free -O1 -fpp " +
"-ftz -diag-disable 5268 " + "-ftz -diag-disable 5268 " +
"-implicitnone -assume byterecl " + "-implicitnone -assume byterecl " +
"-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4 " + "-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4")
"-L/usr/lib64 -L/usr/lib " +
"-Wl,-rpath=/usr/lib64,-rpath=/usr/lib " +
"-llapack")
# Abaqus/CAE will generate an input file without parts and assemblies. # Abaqus/CAE will generate an input file without parts and assemblies.
cae_no_parts_input_file=ON cae_no_parts_input_file=ON