git compatible way of version handling for Fortran and Python

This commit is contained in:
Martin Diehl 2016-01-27 16:48:27 +00:00
parent 6e4239bb7c
commit f2c7eea161
9 changed files with 33 additions and 28 deletions

1
VERSION Normal file
View File

@ -0,0 +1 @@
undefined

View File

@ -96,9 +96,7 @@ subroutine CPFEM_initAll(el,ip)
!$OMP CRITICAL (init)
if (.not. CPFEM_init_done) then
#if defined(Spectral) || defined(FEM)
call DAMASK_interface_init ! Spectral and FEM interface to commandline
#endif
call prec_init
call IO_init
#ifdef FEM
@ -115,9 +113,6 @@ subroutine CPFEM_initAll(el,ip)
call crystallite_init
call homogenization_init
call CPFEM_init
#if defined(Marc4DAMASK) || defined(Abaqus)
call DAMASK_interface_init ! Spectral solver and FEM init is already done
#endif
CPFEM_init_done = .true.
endif
!$OMP END CRITICAL (init)

View File

@ -34,10 +34,11 @@ contains
!--------------------------------------------------------------------------------------------------
!> @brief just reporting
!--------------------------------------------------------------------------------------------------
subroutine DAMASK_interface_init()
subroutine DAMASK_interface_init
write(6,'(/,a)') ' <<<+- DAMASK_abaqus init -+>>>'
#include "compilation_info.f90"
write(6,'(/,a)') ' <<<+- DAMASK_abaqus_exp -+>>>'
write(6,'(/,a)') ' <<<+- DAMASK_interface init -+>>>'
#include "compilation_info.f90"
end subroutine DAMASK_interface_init

View File

@ -34,9 +34,10 @@ contains
!--------------------------------------------------------------------------------------------------
!> @brief just reporting
!--------------------------------------------------------------------------------------------------
subroutine DAMASK_interface_init()
subroutine DAMASK_interface_init
write(6,'(/,a)') ' <<<+- DAMASK_abaqus init -+>>>'
write(6,'(/,a)') ' <<<+- DAMASK_abaqus_std -+>>>'
write(6,'(/,a)') ' <<<+- DAMASK_interface init -+>>>'
#include "compilation_info.f90"
end subroutine DAMASK_interface_init

View File

@ -51,11 +51,9 @@ contains
subroutine DAMASK_interface_init
implicit none
!$OMP CRITICAL (write2out)
write(6,'(/,a)') ' <<<+- DAMASK_marc init -+>>>'
#include "compilation_info.f90"
!$OMP END CRITICAL (write2out)
write(6,'(/,a)') ' <<<+- DAMASK_Marc -+>>>'
write(6,'(/,a)') ' <<<+- DAMASK_interface init -+>>>'
#include "compilation_info.f90"
end subroutine DAMASK_interface_init

View File

@ -8,7 +8,7 @@
!> @details doing cutbacking, forwarding in case of restart, reporting statistics, writing
!> results
!--------------------------------------------------------------------------------------------------
program DAMASK_spectral_Driver
program DAMASK_spectral
use, intrinsic :: &
iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran >4.6 at the moment)
use prec, only: &
@ -157,7 +157,7 @@ program DAMASK_spectral_Driver
! init DAMASK (all modules)
call CPFEM_initAll(el = 1_pInt, ip = 1_pInt)
mainProcess: if (worldrank == 0) then
write(6,'(/,a)') ' <<<+- DAMASK_spectral_driver init -+>>>'
write(6,'(/,a)') ' <<<+- DAMASK_spectral init -+>>>'
write(6,'(a15,a)') ' Current time: ',IO_timeStamp()
#include "compilation_info.f90"
endif mainProcess
@ -707,7 +707,7 @@ program DAMASK_spectral_Driver
if (notConvergedCounter > 0_pInt) call quit(3_pInt) ! error if some are not converged
call quit(0_pInt) ! no complains ;)
end program DAMASK_spectral_Driver
end program DAMASK_spectral
!--------------------------------------------------------------------------------------------------

View File

@ -17,6 +17,8 @@ SHELL = /bin/sh
# STANDARD_CHECK = checking for Fortran 2008, compiler dependend
########################################################################################
# including PETSc files. PETSC_ARCH is loaded from these files.
DAMASKVERSION :="$(shell cat ../VERSION)"
include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules
@ -85,7 +87,8 @@ OPTIMIZATION_AGGRESSIVE_gfortran :=-O3 -ffast-math -funroll-loops -ftree-vectori
LINK_OPTIONS_ifort :=-shared-intel
COMPILE_OPTIONS_ifort :=-fpp\
COMPILE_OPTIONS_ifort :=-DDAMASKVERSION=\"${DAMASKVERSION}\"\
-fpp\
-ftz\
-assume byterecl,fpe_summary\
-diag-disable 5268\
@ -162,7 +165,8 @@ DEBUG_OPTIONS_ifort :=-g\
# arg_temp_created: will cause a lot of warnings because we create a bunch of temporary arrays (performance?)
# stack:
LINK_OPTIONS_gfortran :=-Wl,-undefined,dynamic_lookup
COMPILE_OPTIONS_gfortran :=-xf95-cpp-input\
COMPILE_OPTIONS_gfortran :=-DDAMASKVERSION=\"${DAMASKVERSION}\"\
-xf95-cpp-input\
-ffree-line-length-132\
-fimplicit-none\
-fmodule-private\

View File

@ -89,7 +89,16 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn)
call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,ierr);CHKERRQ(ierr)
#endif
mainProcess: if (worldrank == 0) then
write(6,'(/,a)') ' <<<+- DAMASK_spectral_interface init -+>>>'
call date_and_time(values = dateAndTime)
write(6,'(/,a)') ' <<<+- DAMASK_spectral -+>>>'
write(6,'(/,a)') ' Version: '//DAMASKVERSION
write(6,'(a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',&
dateAndTime(2),'/',&
dateAndTime(1)
write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':',&
dateAndTime(6),':',&
dateAndTime(7)
write(6,'(/,a)') ' <<<+- DAMASK_interface init -+>>>'
#include "compilation_info.f90"
endif mainProcess
@ -187,14 +196,7 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn)
call get_environment_variable('HOSTNAME',hostName)
call get_environment_variable('USER',userName)
call date_and_time(values = dateAndTime)
mainProcess3: if (worldrank == 0) then
write(6,'(a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',&
dateAndTime(2),'/',&
dateAndTime(1)
write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':',&
dateAndTime(6),':',&
dateAndTime(7)
write(6,'(a,a)') ' Host name: ', trim(hostName)
write(6,'(a,a)') ' User name: ', trim(userName)
write(6,'(a,a)') ' Path separator: ', getPathSep()

View File

@ -3,6 +3,9 @@
# $Id$
import sys, os
with open(os.path.join(os.path.dirname(__file__),'../../VERSION')) as f:
version = f.readline()[:-1]
from .environment import Environment # only one class
from .asciitable import ASCIItable # only one class
from .config import Material # will be extended to debug and numerics