From 1bf3b978eb06ebdfcda3639c26811ee4061fe0d0 Mon Sep 17 00:00:00 2001 From: Denny Tjahjanto Date: Wed, 2 Dec 2009 13:08:14 +0000 Subject: [PATCH] modifying the criteria for the sum of microstructure fraction. previously was: if (the_sum /= 1.0_pReal) then (error 170) this condition is too strict. it may give problem with some numerical truncation error. now becomes: if (abs(the_sum - 1.0_pReal) >= 1.0e-10_pReal) then (error 170) --- code/material.f90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/material.f90 b/code/material.f90 index ede6d8a72..db2b82be4 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -93,7 +93,10 @@ subroutine material_init() maxval(microstructure_phase(1:microstructure_Nconstituents(i),i)) > material_Nphase) call IO_error(150,i) if (minval(microstructure_texture(1:microstructure_Nconstituents(i),i)) < 1 .or. & maxval(microstructure_texture(1:microstructure_Nconstituents(i),i)) > material_Ntexture) call IO_error(160,i) - if (sum(microstructure_fraction(:,i)) /= 1.0_pReal) call IO_error(170,i) + if (abs(sum(microstructure_fraction(:,i)) - 1.0_pReal) >= 1.0e-10_pReal) then + write(6,*)'sum of microstructure fraction = ',sum(microstructure_fraction(:,i)) + call IO_error(170,i) + endif enddo write (6,*) write (6,*) 'MATERIAL configuration'