From 80583fefb5f23d9e2773f41d5ca2fb96a1fe79bd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 31 Jan 2012 14:54:49 +0000 Subject: [PATCH] added compilation_info.f90, to store compilation date,time and compiler info in each file added #include statement at each init() routine --- code/CPFEM.f90 | 2 +- code/DAMASK_marc.f90 | 2 +- code/DAMASK_spectral.f90 | 20 +++++++++++--------- code/DAMASK_spectral_interface.f90 | 4 +++- code/FEsolving.f90 | 2 +- code/IO.f90 | 2 +- code/compilation_info.f90 | 16 ++++++++++++++++ code/constitutive.f90 | 2 +- code/constitutive_dislotwin.f90 | 2 +- code/constitutive_j2.f90 | 2 +- code/constitutive_nonlocal.f90 | 2 +- code/constitutive_phenopowerlaw.f90 | 2 +- code/constitutive_titanmod.f90 | 2 +- code/crystallite.f90 | 2 +- code/debug.f90 | 2 +- code/homogenization.f90 | 2 +- code/homogenization_RGC.f90 | 2 +- code/homogenization_isostrain.f90 | 2 +- code/lattice.f90 | 2 +- code/material.f90 | 2 +- code/math.f90 | 2 +- code/mesh.f90 | 2 +- code/numerics.f90 | 2 +- code/prec.f90 | 6 +++--- code/prec_single.f90 | 15 ++++++++++----- 25 files changed, 63 insertions(+), 38 deletions(-) create mode 100644 code/compilation_info.f90 diff --git a/code/CPFEM.f90 b/code/CPFEM.f90 index 3db788dee..90f7c7319 100644 --- a/code/CPFEM.f90 +++ b/code/CPFEM.f90 @@ -205,7 +205,7 @@ subroutine CPFEM_init() write(6,*) write(6,*) '<<<+- cpfem init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" if (debug_verbosity > 0) then write(6,'(a32,x,6(i8,x))') 'CPFEM_cs: ', shape(CPFEM_cs) write(6,'(a32,x,6(i8,x))') 'CPFEM_dcsdE: ', shape(CPFEM_dcsdE) diff --git a/code/DAMASK_marc.f90 b/code/DAMASK_marc.f90 index 65d3d249c..fe5978cfc 100644 --- a/code/DAMASK_marc.f90 +++ b/code/DAMASK_marc.f90 @@ -73,7 +73,7 @@ subroutine DAMASK_interface_init() write(6,*) write(6,*) '<<<+- DAMASK_marc init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) return end subroutine diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index 997601f9e..cf42c3e8e 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -197,7 +197,7 @@ program DAMASK_spectral print '(a)', '' print '(a)', ' <<<+- DAMASK_spectral init -+>>>' print '(a)', ' $Id$' - print '(a)', '' +#include "compilation_info.f90" print '(a,a)', ' Working Directory: ',trim(getSolverWorkingDirectoryName()) print '(a,a)', ' Solver Job Name: ',trim(getSolverJobName()) print '(a)', '' @@ -373,7 +373,8 @@ program DAMASK_spectral res1_red = res(1)/2_pInt + 1_pInt ! size of complex array in first dimension (c2r, r2c) Npoints = res(1)*res(2)*res(3) wgt = 1.0_pReal/real(Npoints, pReal) - cutting_freq = nint((/cut_off_value,cut_off_value,cut_off_value/)/res,pInt) ! for cut_off_value=0.0 just the highest freq. is removed + if (cut_off_value <0.0_pReal .or. cut_off_value >0.9_pReal) stop + cutting_freq = nint(real(res,pReal)*cut_off_value,pInt) ! for cut_off_value=0.0 just the highest freq. is removed !-------------------------------------------------------------------------------------------------- ! output of geometry @@ -388,7 +389,7 @@ program DAMASK_spectral print '(a,3(i12 ))','resolution a b c:', res print '(a,3(f12.5))','dimension x y z:', geomdim print '(a,i5)','homogenization: ',homog - if(cut_off_value/=0.0_pReal) print '(a,3(i4),a)', 'cutting away ', cutting_freq, 'frequencies' + if(cut_off_value/=0.0_pReal) print '(a,3(i12),a)', 'cutting away ', cutting_freq, ' frequencies' print '(a)', '#############################################################' print '(a,a)', 'loadcase file: ',trim(getLoadcaseName()) @@ -787,12 +788,13 @@ program DAMASK_spectral ! report begin of new iteration print '(a)', '' print '(a)', '=============================================================' - print '(5(a,i6.6))', 'Loadcase ',loadcase,' Increment ',inc,'/',bc(loadcase)%incs,' @ Iteration ',iter,'/',itmax + print '(5(a,i6.6))', 'Loadcase ',loadcase,' Increment ',inc,'/',bc(loadcase)%incs,& + ' @ Iteration ',iter,'/',itmax do n = 1_pInt,3_pInt; do m = 1_pInt,3_pInt defgrad_av_lab(m,n) = sum(defgrad(1:res(1),1:res(2),1:res(3),m,n)) * wgt enddo; enddo print '(a,/,3(3(f12.7,x)/)$)', 'deformation gradient:',& - math_transpose33(math_rotate_forward33(defgrad_av_lab,bc(loadcase)%rotation)) + math_transpose33(math_rotate_forward33(defgrad_av_lab,bc(loadcase)%rotation)) print '(a)', '' print '(a)', '... update stress field P(F) ................................' @@ -900,7 +902,7 @@ program DAMASK_spectral xi(1:3,res1_red,j,k))*differentationFactor)**2.0_pReal) enddo; enddo err_div_RMS = sqrt(err_div_RMS)*wgt ! RMS in real space calculated with Parsevals theorem from Fourier space - err_div = err_div_RMS/p_hat_avg/wgt * correctionFactor ! criterion to stop iterations + err_div = err_div_RMS/p_hat_avg/sqrt(wgt) * correctionFactor ! criterion to stop iterations !-------------------------------------------------------------------------------------------------- ! calculate additional divergence criteria and report @@ -966,7 +968,7 @@ program DAMASK_spectral enddo; enddo tensorField_complex(i,j,k,1:3,1:3) = temp33_Complex enddo; enddo; enddo - else ! use precalculated gamma-operator + else ! use precalculated gamma-operator do k = 1_pInt, res(3); do j = 1_pInt, res(2); do i = 1_pInt, res1_red do m = 1_pInt,3_pInt; do n = 1_pInt,3_pInt temp33_Complex(m,n) = sum(gamma_hat(i,j,k, m,n, 1:3,1:3) * tensorField_complex(i,j,k,1:3,1:3)) @@ -974,7 +976,7 @@ program DAMASK_spectral tensorField_complex(i,j,k,1:3,1:3) = temp33_Complex enddo; enddo; enddo endif - tensorField_complex(1,1,1,1:3,1:3) = defgrad_av_lab ! assign zero frequency (real part) with average displacement gradient + tensorField_complex(1,1,1,1:3,1:3) = defgrad_av_lab !* sqrt(real(Npoints,pReal)) ! assign average deformation gradient to zero frequency (real part) if (debugFFTW) then do k = 1_pInt, res(3); do j = 1_pInt, res(2); do i = 1_pInt, res1_red @@ -984,7 +986,7 @@ program DAMASK_spectral !-------------------------------------------------------------------------------------------------- ! doing the inverse FT - call fftw_execute_dft_c2r(plan_correction,tensorField_complex,tensorField_real) ! back transform of fluct deformation gradient + call fftw_execute_dft_c2r(plan_correction,tensorField_complex,tensorField_real) ! back transform of fluct deformation gradient !-------------------------------------------------------------------------------------------------- ! comparing 1 and 3x3 inverse FT results diff --git a/code/DAMASK_spectral_interface.f90 b/code/DAMASK_spectral_interface.f90 index f289c6366..5c516e522 100644 --- a/code/DAMASK_spectral_interface.f90 +++ b/code/DAMASK_spectral_interface.f90 @@ -48,6 +48,8 @@ subroutine DAMASK_interface_init() enddo if(index(commandLine,' -h ',.true.)>0_pInt .or. index(commandLine,' --help ',.true.)>0_pInt) then ! search for ' -h ' or '--help' + write(6,*) '$Id$' +#include "compilation_info.f90" print '(a)', '#############################################################' print '(a)', 'DAMASK spectral:' print '(a)', 'The spectral method boundary value problem solver for' @@ -129,7 +131,7 @@ subroutine DAMASK_interface_init() write(6,*) write(6,*) '<<<+- DAMASK_spectral_interface init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" write(6,'(a,2(i2.2,a),i4.4)'), ' Date: ',date_and_time_values(3),'/',& date_and_time_values(2),'/',& date_and_time_values(1) diff --git a/code/FEsolving.f90 b/code/FEsolving.f90 index 4c60eafe3..d2c272cae 100644 --- a/code/FEsolving.f90 +++ b/code/FEsolving.f90 @@ -149,7 +149,7 @@ write(6,*) write(6,*) '<<<+- FEsolving init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" if (debug_verbosity > 0) then write(6,*) 'restart writing: ', restartWrite write(6,*) 'restart reading: ', restartRead diff --git a/code/IO.f90 b/code/IO.f90 index 3c563545d..f43d3befe 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -54,7 +54,7 @@ subroutine IO_init () write(6,*) write(6,*) '<<<+- IO init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" call flush(6) !$OMP END CRITICAL (write2out) diff --git a/code/compilation_info.f90 b/code/compilation_info.f90 new file mode 100644 index 000000000..5d9e007ce --- /dev/null +++ b/code/compilation_info.f90 @@ -0,0 +1,16 @@ +!$Id$ +#ifdef __GFORTRAN__ +#if __GNUC__<=4 && __GNUC_MINOR__<=5 + write(6,'(3(a,i2.2))') ' Compiled with GNU fortran version ', __GNUC__,'.',__GNUC_MINOR__,& + '.',__GNUC_PATCHLEVEL__ +#else + write(6,*) 'Compiled with ', compiler_version() !not supported by GFORTRAN 4.5 and ifort 12 + write(6,*) 'With options ', compiler_options() +#endif +#endif +#ifdef __INTEL_COMPILER + write(6,'(a,i4.4,a,i8.8)'), ' Compiled with Intel fortran version ', __INTEL_COMPILER,& + ', build date ', __INTEL_COMPILER_BUILD_DATE +#endif +write(6,*) 'Compiled on ', __DATE__,' at ',__TIME__ +write(6,*) diff --git a/code/constitutive.f90 b/code/constitutive.f90 index 6976bc6ee..9764ad215 100644 --- a/code/constitutive.f90 +++ b/code/constitutive.f90 @@ -341,7 +341,7 @@ constitutive_maxSizePostResults = maxval(constitutive_sizePostResults) write(6,*) write(6,*) '<<<+- constitutive init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" if (debug_verbosity > 0) then write(6,'(a32,x,7(i8,x))') 'constitutive_state0: ', shape(constitutive_state0) write(6,'(a32,x,7(i8,x))') 'constitutive_partionedState0: ', shape(constitutive_partionedState0) diff --git a/code/constitutive_dislotwin.f90 b/code/constitutive_dislotwin.f90 index 4a88346ce..ee84af527 100644 --- a/code/constitutive_dislotwin.f90 +++ b/code/constitutive_dislotwin.f90 @@ -152,7 +152,7 @@ character(len=1024) line write(6,*) write(6,*) '<<<+- constitutive_',trim(constitutive_dislotwin_label),' init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) maxNinstance = count(phase_constitution == constitutive_dislotwin_label) diff --git a/code/constitutive_j2.f90 b/code/constitutive_j2.f90 index 63d801079..35e829b35 100644 --- a/code/constitutive_j2.f90 +++ b/code/constitutive_j2.f90 @@ -99,7 +99,7 @@ subroutine constitutive_j2_init(file) write(6,*) write(6,*) '<<<+- constitutive_',trim(constitutive_j2_label),' init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) maxNinstance = count(phase_constitution == constitutive_j2_label) diff --git a/code/constitutive_nonlocal.f90 b/code/constitutive_nonlocal.f90 index c76bd450b..418b36854 100644 --- a/code/constitutive_nonlocal.f90 +++ b/code/constitutive_nonlocal.f90 @@ -208,7 +208,7 @@ character(len=1024) line write(6,*) write(6,*) '<<<+- constitutive_',trim(constitutive_nonlocal_label),' init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) maxNinstance = count(phase_constitution == constitutive_nonlocal_label) diff --git a/code/constitutive_phenopowerlaw.f90 b/code/constitutive_phenopowerlaw.f90 index 2f834f692..75e5609e3 100644 --- a/code/constitutive_phenopowerlaw.f90 +++ b/code/constitutive_phenopowerlaw.f90 @@ -174,7 +174,7 @@ subroutine constitutive_phenopowerlaw_init(file) write(6,*) write(6,*) '<<<+- constitutive_',trim(constitutive_phenopowerlaw_label),' init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) maxNinstance = count(phase_constitution == constitutive_phenopowerlaw_label) diff --git a/code/constitutive_titanmod.f90 b/code/constitutive_titanmod.f90 index 6be59094f..6330d24cb 100644 --- a/code/constitutive_titanmod.f90 +++ b/code/constitutive_titanmod.f90 @@ -221,7 +221,7 @@ character(len=1024) line write(6,*) write(6,*) '<<<+- constitutive_',trim(constitutive_titanmod_label),' init -+>>>' write(6,*) '$Id$' -write(6,*) +#include "compilation_info.f90" maxNinstance = count(phase_constitution == constitutive_titanmod_label) if (maxNinstance == 0) return diff --git a/code/crystallite.f90 b/code/crystallite.f90 index 749a5a9a7..3a476299b 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -174,7 +174,7 @@ character(len=1024) line write(6,*) write(6,*) '<<<+- crystallite init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) diff --git a/code/debug.f90 b/code/debug.f90 index 1401fd791..ca4eb6319 100644 --- a/code/debug.f90 +++ b/code/debug.f90 @@ -96,7 +96,7 @@ subroutine debug_init() write(6,*) write(6,*) '<<<+- debug init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) allocate(debug_StressLoopDistribution(nStress,2)) ; debug_StressLoopDistribution = 0_pInt diff --git a/code/homogenization.f90 b/code/homogenization.f90 index 1a722005d..ec7d86b26 100644 --- a/code/homogenization.f90 +++ b/code/homogenization.f90 @@ -207,7 +207,7 @@ allocate(materialpoint_results(materialpoint_sizeResults,mesh_maxNips,mesh_NcpEl write(6,*) write(6,*) '<<<+- homogenization init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" if (debug_verbosity > 0) then write(6,'(a32,x,7(i8,x))') 'homogenization_state0: ', shape(homogenization_state0) write(6,'(a32,x,7(i8,x))') 'homogenization_subState0: ', shape(homogenization_subState0) diff --git a/code/homogenization_RGC.f90 b/code/homogenization_RGC.f90 index 374a34bcb..3acc05a3f 100644 --- a/code/homogenization_RGC.f90 +++ b/code/homogenization_RGC.f90 @@ -83,7 +83,7 @@ subroutine homogenization_RGC_init(& write(6,*) write(6,*) '<<<+- homogenization_',trim(homogenization_RGC_label),' init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) maxNinstance = count(homogenization_type == homogenization_RGC_label) diff --git a/code/homogenization_isostrain.f90 b/code/homogenization_isostrain.f90 index 76d7d4628..ef04cb1a4 100644 --- a/code/homogenization_isostrain.f90 +++ b/code/homogenization_isostrain.f90 @@ -77,7 +77,7 @@ subroutine homogenization_isostrain_init(& write(6,*) write(6,*) '<<<+- homogenization_',trim(homogenization_isostrain_label),' init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) maxNinstance = count(homogenization_type == homogenization_isostrain_label) diff --git a/code/lattice.f90 b/code/lattice.f90 index 88861a87c..80fe28bf1 100644 --- a/code/lattice.f90 +++ b/code/lattice.f90 @@ -739,7 +739,7 @@ subroutine lattice_init() write(6,*) write(6,*) '<<<+- lattice init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) if (.not. IO_open_jobFile(fileunit,material_localFileExt)) then ! no local material configuration present... diff --git a/code/material.f90 b/code/material.f90 index a4b5dc03d..f4a5e39e0 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -119,7 +119,7 @@ subroutine material_init() write(6,*) write(6,*) '<<<+- material init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) if (.not. IO_open_jobFile(fileunit,material_localFileExt)) then ! no local material configuration present... diff --git a/code/math.f90 b/code/math.f90 index 36bf948d6..0fda22c90 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -156,7 +156,7 @@ real(pReal), dimension(4,36), parameter :: math_symOperations = & write(6,*) write(6,*) '<<<+- math init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) call random_seed(size=randSize) diff --git a/code/mesh.f90 b/code/mesh.f90 index 407857841..bff65c5bd 100644 --- a/code/mesh.f90 +++ b/code/mesh.f90 @@ -276,7 +276,7 @@ write(6,*) write(6,*) '<<<+- mesh init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) call mesh_build_FEdata() ! --- get properties of the different types of elements diff --git a/code/numerics.f90 b/code/numerics.f90 index f513f068b..499daa4e6 100644 --- a/code/numerics.f90 +++ b/code/numerics.f90 @@ -122,7 +122,7 @@ subroutine numerics_init() write(6,*) write(6,*) '<<<+- numerics init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" !$OMP END CRITICAL (write2out) !$ call GET_ENVIRONMENT_VARIABLE(NAME='DAMASK_NUM_THREADS',VALUE=DAMASK_NumThreadsString,STATUS=gotDAMASK_NUM_THREADS) ! get environment variable DAMASK_NUM_THREADS... diff --git a/code/prec.f90 b/code/prec.f90 index b8430dac7..94d8c42ee 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -21,6 +21,7 @@ !############################################################## MODULE prec !############################################################## +use iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) implicit none @@ -32,9 +33,8 @@ real(pReal), parameter :: tol_math_check = 1.0e-8_pReal real(pReal), parameter :: tol_gravityNodePos = 1.0e-100_pReal ! NaN is precision dependent ! from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html -! copy found in documentation/Code/Fortran +! copy can be found in documentation/Code/Fortran real(pReal), parameter :: DAMASK_NaN = Z'7FF0000000000001' - type :: p_vec real(pReal), dimension(:), pointer :: p end type p_vec @@ -48,7 +48,7 @@ implicit none write(6,*) write(6,*) '<<<+- prec init -+>>>' write(6,*) '$Id$' - write(6,*) +#include "compilation_info.f90" write(6,'(a,i3)'), ' Bytes for pReal: ',pReal write(6,'(a,i3)'), ' Bytes for pInt: ',pInt write(6,'(a,i3)'), ' Bytes for pLongInt: ',pLongInt diff --git a/code/prec_single.f90 b/code/prec_single.f90 index 6d77f5158..30bbc05e2 100644 --- a/code/prec_single.f90 +++ b/code/prec_single.f90 @@ -21,6 +21,7 @@ !############################################################## MODULE prec !############################################################## +use iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) implicit none @@ -30,11 +31,10 @@ integer, parameter :: pInt = selected_int_kind(9) ! up to +- 1e9 integer, parameter :: pLongInt = 4 ! should be 64bit real(pReal), parameter :: tol_math_check = 1.0e-5_pReal real(pReal), parameter :: tol_gravityNodePos = 1.0e-36_pReal -! NaN is precistion dependent +! NaN is precision dependent ! from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html ! copy can be found in documentation/Code/Fortran real(pReal), parameter :: DAMASK_NaN = Z'7F800001' - type :: p_vec real(pReal), dimension(:), pointer :: p end type p_vec @@ -42,13 +42,18 @@ end type p_vec CONTAINS subroutine prec_init +implicit none + !$OMP CRITICAL (write2out) write(6,*) write(6,*) '<<<+- prec_single init -+>>>' write(6,*) '$Id$' - write(6,*) - write(6,*) 'NaN: ',DAMASK_NAN - write(6,*) 'NaN /= NaN: ',DAMASK_NaN/=DAMASK_NaN +#include "compilation_info.f90" + write(6,'(a,i3)'), ' Bytes for pReal: ',pReal + write(6,'(a,i3)'), ' Bytes for pInt: ',pInt + write(6,'(a,i3)'), ' Bytes for pLongInt: ',pLongInt + write(6,'(a,e3.3)'), ' NaN: ',DAMASK_NAN + write(6,'(a,l3)'), ' NaN /= NaN: ',DAMASK_NaN/=DAMASK_NaN write(6,*) !$OMP END CRITICAL (write2out)