better readable

This commit is contained in:
Martin Diehl 2019-04-13 15:34:51 +02:00
parent 1036c76ae0
commit c4784e6673
1 changed files with 34 additions and 36 deletions

View File

@ -1163,64 +1163,62 @@ subroutine crystallite_results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief select tensors for output !> @brief select tensors for output
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function select_tensors(dataset,instance) function select_tensors(dataset,instance)
use material, only: & use material, only: &
homogenization_maxNgrains, & homogenization_maxNgrains, &
material_phaseAt material_phaseAt
integer, intent(in) :: instance integer, intent(in) :: instance
real(pReal), dimension(:,:,:,:,:), intent(in) :: dataset real(pReal), dimension(:,:,:,:,:), intent(in) :: dataset
real(pReal), allocatable, dimension(:,:,:) :: select_tensors real(pReal), allocatable, dimension(:,:,:) :: select_tensors
integer :: e,i,c,j integer :: e,i,c,j
allocate(select_tensors(3,3,count(material_phaseAt==instance)*homogenization_maxNgrains)) allocate(select_tensors(3,3,count(material_phaseAt==instance)*homogenization_maxNgrains))
j=1 j=0
do e = 1, size(material_phaseAt,2) do e = 1, size(material_phaseAt,2)
do i = 1, homogenization_maxNgrains !ToDo: this needs to be changed for varying Ngrains do i = 1, homogenization_maxNgrains !ToDo: this needs to be changed for varying Ngrains
do c = 1, size(material_phaseAt,1) do c = 1, size(material_phaseAt,1)
if (material_phaseAt(c,e) == instance) then if (material_phaseAt(c,e) == instance) then
select_tensors(1:3,1:3,j) = dataset(1:3,1:3,c,i,e)
j = j + 1 j = j + 1
endif select_tensors(1:3,1:3,j) = dataset(1:3,1:3,c,i,e)
enddo endif
enddo
enddo
enddo enddo
enddo
end function select_tensors
end function select_tensors
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief select rotations for output !> @brief select rotations for output
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function select_rotations(dataset,instance) function select_rotations(dataset,instance)
use material, only: & use material, only: &
homogenization_maxNgrains, & homogenization_maxNgrains, &
material_phaseAt material_phaseAt
integer, intent(in) :: instance integer, intent(in) :: instance
type(rotation), dimension(:,:,:), intent(in) :: dataset type(rotation), dimension(:,:,:), intent(in) :: dataset
type(rotation), allocatable, dimension(:) :: select_rotations type(rotation), allocatable, dimension(:) :: select_rotations
integer :: e,i,c,j integer :: e,i,c,j
allocate(select_rotations(count(material_phaseAt==instance)*homogenization_maxNgrains)) allocate(select_rotations(count(material_phaseAt==instance)*homogenization_maxNgrains))
j=1 j=0
do e = 1, size(material_phaseAt,2) do e = 1, size(material_phaseAt,2)
do i = 1, homogenization_maxNgrains !ToDo: this needs to be changed for varying Ngrains do i = 1, homogenization_maxNgrains !ToDo: this needs to be changed for varying Ngrains
do c = 1, size(material_phaseAt,1) do c = 1, size(material_phaseAt,1)
if (material_phaseAt(c,e) == instance) then if (material_phaseAt(c,e) == instance) then
select_rotations(j) = dataset(c,i,e)
j = j + 1 j = j + 1
endif select_rotations(j) = dataset(c,i,e)
enddo endif
enddo enddo
enddo enddo
enddo
end function select_rotations end function select_rotations
#endif #endif