From 61c6839723f47a792c28ebf71f3e48f0a0f42b50 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 19 Dec 2013 08:49:47 +0000 Subject: [PATCH] fixed over-sensitive error in homogeniztion and ifort option in makefile --- code/Makefile | 17 ++++++++------ code/constitutive_dislotwin.f90 | 25 ++++++++++++++++++--- code/constitutive_j2.f90 | 19 +++++++++++----- code/constitutive_none.f90 | 20 ++++++++++++----- code/constitutive_nonlocal.f90 | 7 +++--- code/constitutive_phenopowerlaw.f90 | 31 ++++++++++++++++++++----- code/constitutive_titanmod.f90 | 35 ++++++++++++++++++++++------- code/homogenization_RGC.f90 | 3 +++ code/homogenization_isostrain.f90 | 7 ++++-- code/material.f90 | 11 +++++---- 10 files changed, 128 insertions(+), 47 deletions(-) diff --git a/code/Makefile b/code/Makefile index d8bb97dda..4bd6e1f7c 100644 --- a/code/Makefile +++ b/code/Makefile @@ -42,11 +42,11 @@ SHELL = /bin/sh #any values will be overwritten by configure.py FFTWROOT ?= /usr/local IMKLROOT ?= -ACMLROOT ?= +ACMLROOT ?= /opt/acml5.3.0 LAPACKROOT ?= /usr HDF5ROOT ?= -F90 ?= ifort +F90 ?= gfortran ######################################################################################## COMPILERNAME ?= $(F90) @@ -163,13 +163,13 @@ COMPILE_OPTIONS_ifort +=-diag-enable sc3\ -warn interfaces\ -warn ignore_loc\ -warn alignments\ - -warn unused\ - -warn errors + -warn unused endif ################################################################################################### #COMPILE SWITCHES #-fpp: preprocessor #-ftz: flush unterflow to zero, automatically set if O<0,1,2,3> >0 +#-assume byterecl record length is given in bytes (also set by -standard-semantics) #-fimplicit-none: assume "implicit-none" even if not present in source #-diag-disable: disables warnings, where # warning ID 5268: the text exceeds right hand column allowed on the line (we have only comments there) @@ -181,7 +181,6 @@ endif # ignore_loc: %LOC is stripped from an actual argument # alignments: data that is not naturally aligned # unused: declared variables that are never used -# errors: warnings are changed to errors # stderrors: warnings about Fortran standard violations are changed to errors (STANDARD_CHECK) # ################################################################################################### @@ -197,7 +196,8 @@ DEBUG_OPTIONS_ifort :=-g\ -gen-interfaces\ -fp-stack-check\ -check bounds,format,output_conversion,pointers,uninit\ - -fpe-all0 + -fpe-all0\ + -warn errors ################################################################################################### #COMPILE SWITCHES FOR RUNTIME DEBUGGING #-g: Generate symbolic debugging information in the object file @@ -211,6 +211,8 @@ DEBUG_OPTIONS_ifort :=-g\ # pointers: Checking for certain disassociated or uninitialized pointers or unallocated allocatable objects. # uninit: Checking for uninitialized variables. #-fpe-all0 capture all floating-point exceptions, sets -ftz automatically +#-warn: enables warnings, where +# errors: warnings are changed to errors # information on http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/ ################################################################################################### #MORE OPTIONS FOR RUNTIME DEBUGGING @@ -247,7 +249,8 @@ endif #-Wimplicit-procedure #-Wall: sets the following Fortran options: # -Waliasing: warn about possible aliasing of dummy arguments. Specifically, it warns if the same actual argument is associated with a dummy argument with "INTENT(IN)" and a dummy argument with "INTENT(OUT)" in a call with an explicit interface. -# -Wampersand: checks if a character expression is continued proberly by an ampersand at the end of the line and at the beginning of the new line#-Warray-bounds: checks if array reference is out of bounds at compile time. use -fcheck-bounds to also check during runtime +# -Wampersand: checks if a character expression is continued proberly by an ampersand at the end of the line and at the beginning of the new line +# -Warray-bounds: checks if array reference is out of bounds at compile time. use -fcheck-bounds to also check during runtime # -Wconversion: warn about implicit conversions between different type # -Wsurprising: warn when "suspicious" code constructs are encountered. While technically legal these usually indicate that an error has been made. # -Wc-binding-type: diff --git a/code/constitutive_dislotwin.f90 b/code/constitutive_dislotwin.f90 index ab97fd6d4..f63a6657b 100644 --- a/code/constitutive_dislotwin.f90 +++ b/code/constitutive_dislotwin.f90 @@ -204,8 +204,27 @@ subroutine constitutive_dislotwin_init(fileUnit) use mesh, only: & mesh_maxNips, & mesh_NcpElems - use IO - use material + use IO, only: & + IO_read, & + IO_lc, & + IO_getTag, & + IO_isBlank, & + IO_stringPos, & + IO_stringValue, & + IO_floatValue, & + IO_intValue, & + IO_warning, & + IO_error, & + IO_timeStamp, & + IO_EOF + use material, only: & + homogenization_maxNgrains, & + phase_plasticity, & + phase_plasticityInstance, & + phase_Noutput, & + PLASTICITY_DISLOTWIN_label, & + PLASTICITY_DISLOTWIN_ID, & + MATERIAL_partPhase use lattice implicit none @@ -314,7 +333,7 @@ subroutine constitutive_dislotwin_init(fileUnit) rewind(fileUnit) - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to + do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= MATERIAL_partPhase) ! wind forward to line = IO_read(fileUnit) enddo diff --git a/code/constitutive_j2.f90 b/code/constitutive_j2.f90 index 2e57867ad..befc18f64 100644 --- a/code/constitutive_j2.f90 +++ b/code/constitutive_j2.f90 @@ -99,6 +99,10 @@ contains !-------------------------------------------------------------------------------------------------- subroutine constitutive_j2_init(fileUnit) use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) + use debug, only: & + debug_level, & + debug_constitutive, & + debug_levelBasic use math, only: & math_Mandel3333to66, & math_Voigt66to3333 @@ -113,11 +117,14 @@ subroutine constitutive_j2_init(fileUnit) IO_error, & IO_timeStamp, & IO_EOF - use material - use debug, only: & - debug_level, & - debug_constitutive, & - debug_levelBasic + use material, only: & + homogenization_maxNgrains, & + phase_plasticity, & + phase_plasticityInstance, & + phase_Noutput, & + PLASTICITY_J2_label, & + PLASTICITY_J2_ID, & + MATERIAL_partPhase use lattice implicit none @@ -169,7 +176,7 @@ subroutine constitutive_j2_init(fileUnit) allocate(constitutive_j2_tausat_SinhFitD(maxNinstance), source=0.0_pReal) rewind(fileUnit) - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to + do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= material_partPhase) ! wind forward to line = IO_read(fileUnit) enddo diff --git a/code/constitutive_none.f90 b/code/constitutive_none.f90 index 5e39881dd..e78c355af 100644 --- a/code/constitutive_none.f90 +++ b/code/constitutive_none.f90 @@ -59,6 +59,10 @@ contains !-------------------------------------------------------------------------------------------------- subroutine constitutive_none_init(fileUnit) use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) + use debug, only: & + debug_level, & + debug_constitutive, & + debug_levelBasic use math, only: & math_Mandel3333to66, & math_Voigt66to3333 @@ -73,11 +77,15 @@ subroutine constitutive_none_init(fileUnit) IO_error, & IO_timeStamp, & IO_EOF - use material - use debug, only: & - debug_level, & - debug_constitutive, & - debug_levelBasic + use material, only: & + homogenization_maxNgrains, & + phase_plasticity, & + phase_plasticityInstance, & + phase_Noutput, & + PLASTICITY_NONE_label, & + PLASTICITY_NONE_ID, & + MATERIAL_partPhase + use lattice implicit none @@ -111,7 +119,7 @@ subroutine constitutive_none_init(fileUnit) allocate(constitutive_none_Cslip_66(6,6,maxNinstance), source=0.0_pReal) rewind(fileUnit) - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to + do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= material_partPhase) ! wind forward to line = IO_read(fileUnit) enddo diff --git a/code/constitutive_nonlocal.f90 b/code/constitutive_nonlocal.f90 index f767f1fea..ce0833c46 100644 --- a/code/constitutive_nonlocal.f90 +++ b/code/constitutive_nonlocal.f90 @@ -311,8 +311,8 @@ use IO, only: IO_read, & IO_stringValue, & IO_floatValue, & IO_intValue, & - IO_error, & IO_warning, & + IO_error, & IO_timeStamp, & IO_EOF use debug, only: debug_level, & @@ -326,7 +326,8 @@ use material, only: homogenization_maxNgrains, & phase_plasticityInstance, & phase_Noutput, & PLASTICITY_NONLOCAL_label, & - PLASTICITY_NONLOCAL_ID + PLASTICITY_NONLOCAL_ID, & + MATERIAL_partPhase use lattice integer(pInt), intent(in) :: fileUnit @@ -439,7 +440,7 @@ allocate(nonSchmidCoeff(lattice_maxNnonSchmid,maxNmatIDs), sour !*** readout data from material.config file rewind(fileUnit) -do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to +do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= MATERIAL_partPhase) ! wind forward to line = IO_read(fileUnit) enddo diff --git a/code/constitutive_phenopowerlaw.f90 b/code/constitutive_phenopowerlaw.f90 index 3c5c7c167..f0377d095 100644 --- a/code/constitutive_phenopowerlaw.f90 +++ b/code/constitutive_phenopowerlaw.f90 @@ -131,15 +131,34 @@ subroutine constitutive_phenopowerlaw_init(fileUnit) use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) use prec, only: & tol_math_check - use math, only: & - math_Mandel3333to66, & - math_Voigt66to3333 - use IO - use material use debug, only: & debug_level, & debug_constitutive,& debug_levelBasic + use math, only: & + math_Mandel3333to66, & + math_Voigt66to3333 + use IO, only: & + IO_read, & + IO_lc, & + IO_getTag, & + IO_isBlank, & + IO_stringPos, & + IO_stringValue, & + IO_floatValue, & + IO_intValue, & + IO_warning, & + IO_error, & + IO_timeStamp, & + IO_EOF + use material, only: & + homogenization_maxNgrains, & + phase_plasticity, & + phase_plasticityInstance, & + phase_Noutput, & + PLASTICITY_PHENOPOWERLAW_label, & + PLASTICITY_PHENOPOWERLAW_ID, & + MATERIAL_partPhase use lattice implicit none @@ -232,7 +251,7 @@ subroutine constitutive_phenopowerlaw_init(fileUnit) source=0.0_pReal) rewind(fileUnit) - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to + do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= material_partPhase) ! wind forward to line = IO_read(fileUnit) enddo diff --git a/code/constitutive_titanmod.f90 b/code/constitutive_titanmod.f90 index 5effdd7a1..73499760b 100644 --- a/code/constitutive_titanmod.f90 +++ b/code/constitutive_titanmod.f90 @@ -202,16 +202,35 @@ module constitutive_titanmod !-------------------------------------------------------------------------------------------------- subroutine constitutive_titanmod_init(fileUnit) use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) - use math, only: & - math_Mandel3333to66,& - math_Voigt66to3333,& - math_mul3x3 - use IO - use material use debug, only: & debug_level,& debug_constitutive,& debug_levelBasic + use math, only: & + math_Mandel3333to66,& + math_Voigt66to3333,& + math_mul3x3 + use IO, only: & + IO_read, & + IO_lc, & + IO_getTag, & + IO_isBlank, & + IO_stringPos, & + IO_stringValue, & + IO_floatValue, & + IO_intValue, & + IO_warning, & + IO_error, & + IO_timeStamp, & + IO_EOF + use material, only: & + homogenization_maxNgrains, & + phase_plasticity, & + phase_plasticityInstance, & + phase_Noutput, & + PLASTICITY_TITANMOD_label, & + PLASTICITY_TITANMOD_ID, & + MATERIAL_partPhase use lattice implicit none @@ -393,11 +412,11 @@ subroutine constitutive_titanmod_init(fileUnit) constitutive_titanmod_interactionTwinTwin = 0.0_pReal rewind(fileUnit) - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to + do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= MATERIAL_partPhase) ! wind forward to line = IO_read(fileUnit) enddo - do while (trim(line) /= IO_EOF) ! read through sections of phase part + do while (trim(line) /= IO_EOF) ! read through sections of phase part line = IO_read(fileUnit) if (IO_isBlank(line)) cycle ! skip empty lines if (IO_getTag(line,'<','>') /= '') then ! stop at next part diff --git a/code/homogenization_RGC.f90 b/code/homogenization_RGC.f90 index fee4f2d98..f9d242610 100644 --- a/code/homogenization_RGC.f90 +++ b/code/homogenization_RGC.f90 @@ -161,6 +161,7 @@ subroutine homogenization_RGC_init(fileUnit) if (IO_getTag(line,'[',']') /= '') then ! next section section = section + 1_pInt output = 0_pInt ! reset output counter + cycle endif if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if-statement). It's not safe in Fortran if (homogenization_type(section) == HOMOGENIZATION_RGC_ID) then ! one of my sections @@ -168,6 +169,8 @@ subroutine homogenization_RGC_init(fileUnit) positions = IO_stringPos(line,MAXNCHUNKS) tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key select case(tag) + case ('type') + cycle case ('(output)') output = output + 1_pInt homogenization_RGC_output(output,i) = IO_lc(IO_stringValue(line,positions,2_pInt)) diff --git a/code/homogenization_isostrain.f90 b/code/homogenization_isostrain.f90 index 0a8002600..5403265a5 100644 --- a/code/homogenization_isostrain.f90 +++ b/code/homogenization_isostrain.f90 @@ -108,7 +108,7 @@ subroutine homogenization_isostrain_init(fileUnit) source=undefined_ID) rewind(fileUnit) - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= material_partHomogenization) ! wind forward to + do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= material_partHomogenization)! wind forward to line = IO_read(fileUnit) enddo @@ -122,6 +122,7 @@ subroutine homogenization_isostrain_init(fileUnit) if (IO_getTag(line,'[',']') /= '') then ! next section section = section + 1_pInt output = 0_pInt ! reset output counter + cycle endif if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if-statement). It's not safe in Fortran if (homogenization_type(section) == HOMOGENIZATION_ISOSTRAIN_ID) then ! one of my sections @@ -129,6 +130,8 @@ subroutine homogenization_isostrain_init(fileUnit) positions = IO_stringPos(line,MAXNCHUNKS) tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key select case(tag) + case('type') + cycle case ('(output)') output = output + 1_pInt homogenization_isostrain_output(output,i) = IO_lc(IO_stringValue(line,positions,2_pInt)) @@ -148,7 +151,7 @@ subroutine homogenization_isostrain_init(fileUnit) ' ('//HOMOGENIZATION_isostrain_label//')') end select case ('nconstituents','ngrains') - homogenization_isostrain_Ngrains(i) = IO_intValue(line,positions,2_pInt) + homogenization_isostrain_Ngrains(i) = IO_intValue(line,positions,2_pInt) case ('mapping') select case(IO_lc(IO_stringValue(line,positions,2_pInt))) case ('parallel','sum') diff --git a/code/material.f90 b/code/material.f90 index eb99808cc..6a332191e 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -318,7 +318,7 @@ subroutine material_parseHomogenization(fileUnit,myPart) rewind(fileUnit) line = '' ! to have it initialized section = 0_pInt ! - " - - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= myPart) ! wind forward to myPart + do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= myPart) ! wind forward to line = IO_read(fileUnit) enddo if (echo) write(6,'(/,1x,a)') trim(line) ! echo part header @@ -409,7 +409,7 @@ subroutine material_parseMicrostructure(fileUnit,myPart) section = 0_pInt ! - " - constituent = 0_pInt ! - " - - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= myPart) ! wind forward to myPart + do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= myPart) ! wind forward to line = IO_read(fileUnit) enddo if (echo) write(6,'(/,1x,a)') trim(line) ! echo part header @@ -491,7 +491,7 @@ subroutine material_parseCrystallite(fileUnit,myPart) rewind(fileUnit) line = '' ! to have it initialized section = 0_pInt ! - " - - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= myPart) ! wind forward to myPart + do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= myPart) ! wind forward to line = IO_read(fileUnit) enddo if (echo) write(6,'(/,1x,a)') trim(line) ! echo part header @@ -563,7 +563,7 @@ subroutine material_parsePhase(fileUnit,myPart) rewind(fileUnit) line = '' ! to have it initialized section = 0_pInt ! - " - - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= myPart) ! wind forward to myPart + do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= myPart) ! wind forward to line = IO_read(fileUnit) enddo if (echo) write(6,'(/,1x,a)') trim(line) ! echo part header @@ -680,8 +680,7 @@ subroutine material_parseTexture(fileUnit,myPart) section = 0_pInt ! - " - gauss = 0_pInt ! - " - fiber = 0_pInt ! - " - - - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= myPart) ! wind forward to myPart + do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= myPart) ! wind forward to line = IO_read(fileUnit) enddo if (echo) write(6,'(/,1x,a)') trim(line) ! echo part header