From b6596a0310b97b6477ca956ec0fd144ac2f12928 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 29 Mar 2020 19:17:24 +0200 Subject: [PATCH] compiler can do the counting --- src/lattice.f90 | 22 +++++++++++----------- src/math.f90 | 16 +++++++--------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/lattice.f90 b/src/lattice.f90 index 31a73d7d6..120c58a15 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -18,16 +18,16 @@ module lattice !-------------------------------------------------------------------------------------------------- ! face centered cubic - integer, dimension(2), parameter :: & + integer, dimension(*), parameter :: & FCC_NSLIPSYSTEM = [12, 6] !< # of slip systems per family for fcc - integer, dimension(1), parameter :: & + integer, dimension(*), parameter :: & FCC_NTWINSYSTEM = [12] !< # of twin systems per family for fcc - integer, dimension(1), parameter :: & + integer, dimension(*), parameter :: & FCC_NTRANSSYSTEM = [12] !< # of transformation systems per family for fcc - integer, dimension(1), parameter :: & + integer, dimension(*), parameter :: & FCC_NCLEAVAGESYSTEM = [3] !< # of cleavage systems per family for fcc integer, parameter :: & @@ -109,13 +109,13 @@ module lattice !-------------------------------------------------------------------------------------------------- ! body centered cubic - integer, dimension(2), parameter :: & + integer, dimension(*), parameter :: & BCC_NSLIPSYSTEM = [12, 12] !< # of slip systems per family for bcc - integer, dimension(1), parameter :: & + integer, dimension(*), parameter :: & BCC_NTWINSYSTEM = [12] !< # of twin systems per family for bcc - integer, dimension(1), parameter :: & + integer, dimension(*), parameter :: & BCC_NCLEAVAGESYSTEM = [3] !< # of cleavage systems per family for bcc integer, parameter :: & @@ -187,10 +187,10 @@ module lattice !-------------------------------------------------------------------------------------------------- ! hexagonal - integer, dimension(6), parameter :: & + integer, dimension(*), parameter :: & HEX_NSLIPSYSTEM = [3, 3, 3, 6, 12, 6] !< # of slip systems per family for hex - integer, dimension(4), parameter :: & + integer, dimension(*), parameter :: & HEX_NTWINSYSTEM = [6, 6, 6, 6] !< # of slip systems per family for hex integer, parameter :: & @@ -280,7 +280,7 @@ module lattice !-------------------------------------------------------------------------------------------------- ! body centered tetragonal - integer, dimension(13), parameter :: & + integer, dimension(*), parameter :: & BCT_NSLIPSYSTEM = [2, 2, 2, 4, 2, 4, 2, 2, 4, 8, 4, 8, 8 ] !< # of slip systems per family for bct (Sn) Bieler J. Electr Mater 2009 integer, parameter :: & @@ -362,7 +362,7 @@ module lattice !-------------------------------------------------------------------------------------------------- ! orthorhombic - integer, dimension(3), parameter :: & + integer, dimension(*), parameter :: & ORT_NCLEAVAGESYSTEM = [1, 1, 1] !< # of cleavage systems per family for ortho integer, parameter :: & diff --git a/src/math.f90 b/src/math.f90 index a296dce31..b48037c65 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -30,14 +30,12 @@ module math 1.0_pReal,0.0_pReal,0.0_pReal, & 0.0_pReal,1.0_pReal,0.0_pReal, & 0.0_pReal,0.0_pReal,1.0_pReal & - ],[3,3]) !< 3x3 Identity + ],shape(math_I3)) !< 3x3 Identity - real(pReal), dimension(6), parameter, private :: & - NRMMANDEL = [& - 1.0_pReal, 1.0_pReal, 1.0_pReal, & - sqrt(2.0_pReal), sqrt(2.0_pReal), sqrt(2.0_pReal) ] !< forward weighting for Mandel notation + real(pReal), dimension(*), parameter, private :: & + NRMMANDEL = [1.0_pReal, 1.0_pReal,1.0_pReal, sqrt(2.0_pReal), sqrt(2.0_pReal), sqrt(2.0_pReal)] !< forward weighting for Mandel notation - real(pReal), dimension(6), parameter, private :: & + real(pReal), dimension(*), parameter, private :: & INVNRMMANDEL = 1.0_pReal/NRMMANDEL !< backward weighting for Mandel notation integer, dimension (2,6), parameter, private :: & @@ -48,7 +46,7 @@ module math 1,2, & 2,3, & 1,3 & - ],[2,6]) !< arrangement in Nye notation. + ],shape(MAPNYE)) !< arrangement in Nye notation. integer, dimension (2,6), parameter, private :: & MAPVOIGT = reshape([& @@ -58,7 +56,7 @@ module math 2,3, & 1,3, & 1,2 & - ],[2,6]) !< arrangement in Voigt notation + ],shape(MAPVOIGT)) !< arrangement in Voigt notation integer, dimension (2,9), parameter, private :: & MAPPLAIN = reshape([& @@ -71,7 +69,7 @@ module math 3,1, & 3,2, & 3,3 & - ],[2,9]) !< arrangement in Plain notation + ],shape(MAPPLAIN)) !< arrangement in Plain notation interface math_eye module procedure math_identity2nd