consistent use of 2 blanks, no pInt

This commit is contained in:
Martin Diehl 2019-03-24 11:28:20 +01:00
parent 320f39925a
commit dada4e69b6
1 changed files with 276 additions and 276 deletions

View File

@ -1,22 +1,20 @@
!--------------------------------------------------------------------------------------------------
!> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH
!> @brief material subroutine for adiabatic temperature evolution
!> @details to be done
!--------------------------------------------------------------------------------------------------
module thermal_adiabatic
use prec, only: &
pReal, &
pInt
pReal
implicit none
private
integer(pInt), dimension(:,:), allocatable, target, public :: &
integer, dimension(:,:), allocatable, target, public :: &
thermal_adiabatic_sizePostResult !< size of each post result output
character(len=64), dimension(:,:), allocatable, target, public :: &
thermal_adiabatic_output !< name of each post result output
integer(pInt), dimension(:), allocatable, target, public :: &
integer, dimension(:), allocatable, target, public :: &
thermal_adiabatic_Noutput !< number of outputs per instance of this thermal model
enum, bind(c)
@ -60,41 +58,39 @@ subroutine thermal_adiabatic_init
config_homogenization
implicit none
integer(pInt) :: maxNinstance,section,instance,i
integer(pInt) :: sizeState
integer(pInt) :: NofMyHomog
integer :: maxNinstance,section,instance,i,sizeState,NofMyHomog
character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::]
character(len=65536), dimension(:), allocatable :: outputs
write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_ADIABATIC_label//' init -+>>>'
maxNinstance = int(count(thermal_type == THERMAL_adiabatic_ID),pInt)
if (maxNinstance == 0_pInt) return
maxNinstance = count(thermal_type == THERMAL_adiabatic_ID)
if (maxNinstance == 0) return
allocate(thermal_adiabatic_sizePostResult (maxval(homogenization_Noutput),maxNinstance),source=0_pInt)
allocate(thermal_adiabatic_sizePostResult (maxval(homogenization_Noutput),maxNinstance),source=0)
allocate(thermal_adiabatic_output (maxval(homogenization_Noutput),maxNinstance))
thermal_adiabatic_output = ''
allocate(thermal_adiabatic_outputID (maxval(homogenization_Noutput),maxNinstance),source=undefined_ID)
allocate(thermal_adiabatic_Noutput (maxNinstance), source=0_pInt)
allocate(thermal_adiabatic_Noutput (maxNinstance), source=0)
initializeInstances: do section = 1_pInt, size(thermal_type)
initializeInstances: do section = 1, size(thermal_type)
if (thermal_type(section) /= THERMAL_adiabatic_ID) cycle
NofMyHomog=count(material_homogenizationAt==section)
instance = thermal_typeInstance(section)
outputs = config_homogenization(section)%getStrings('(output)',defaultVal=emptyStringArray)
do i=1_pInt, size(outputs)
do i=1, size(outputs)
select case(outputs(i))
case('temperature')
thermal_adiabatic_Noutput(instance) = thermal_adiabatic_Noutput(instance) + 1_pInt
thermal_adiabatic_Noutput(instance) = thermal_adiabatic_Noutput(instance) + 1
thermal_adiabatic_outputID(thermal_adiabatic_Noutput(instance),instance) = temperature_ID
thermal_adiabatic_output(thermal_adiabatic_Noutput(instance),instance) = outputs(i)
thermal_adiabatic_sizePostResult(thermal_adiabatic_Noutput(instance),instance) = 1_pInt
thermal_adiabatic_sizePostResult(thermal_adiabatic_Noutput(instance),instance) = 1
end select
enddo
! allocate state arrays
sizeState = 1_pInt
! allocate state arrays
sizeState = 1
thermalState(section)%sizeState = sizeState
thermalState(section)%sizePostResults = sum(thermal_adiabatic_sizePostResult(:,instance))
allocate(thermalState(section)%state0 (sizeState,NofMyHomog), source=thermal_initialT(section))
@ -112,6 +108,7 @@ subroutine thermal_adiabatic_init
end subroutine thermal_adiabatic_init
!--------------------------------------------------------------------------------------------------
!> @brief calculates adiabatic change in temperature based on local heat generation model
!--------------------------------------------------------------------------------------------------
@ -128,14 +125,15 @@ function thermal_adiabatic_updateState(subdt, ip, el)
thermalMapping
implicit none
integer(pInt), intent(in) :: &
integer, intent(in) :: &
ip, & !< integration point number
el !< element number
real(pReal), intent(in) :: &
subdt
logical, dimension(2) :: &
thermal_adiabatic_updateState
integer(pInt) :: &
integer :: &
homog, &
offset
real(pReal) :: &
@ -184,16 +182,17 @@ subroutine thermal_adiabatic_getSourceAndItsTangent(Tdot, dTdot_dT, T, ip, el)
crystallite_Lp
implicit none
integer(pInt), intent(in) :: &
integer, intent(in) :: &
ip, & !< integration point number
el !< element number
real(pReal), intent(in) :: &
T
real(pReal), intent(out) :: &
Tdot, dTdot_dT
real(pReal) :: &
my_Tdot, my_dTdot_dT
integer(pInt) :: &
integer :: &
phase, &
homog, &
instance, &
@ -248,12 +247,13 @@ function thermal_adiabatic_getSpecificHeat(ip,el)
mesh_element
implicit none
integer(pInt), intent(in) :: &
integer, intent(in) :: &
ip, & !< integration point number
el !< element number
real(pReal) :: &
thermal_adiabatic_getSpecificHeat
integer(pInt) :: &
integer :: &
grain
thermal_adiabatic_getSpecificHeat = 0.0_pReal
@ -283,12 +283,12 @@ function thermal_adiabatic_getMassDensity(ip,el)
mesh_element
implicit none
integer(pInt), intent(in) :: &
integer, intent(in) :: &
ip, & !< integration point number
el !< element number
real(pReal) :: &
thermal_adiabatic_getMassDensity
integer(pInt) :: &
integer :: &
grain
thermal_adiabatic_getMassDensity = 0.0_pReal
@ -313,7 +313,7 @@ function thermal_adiabatic_postResults(homog,instance,of) result(postResults)
temperature
implicit none
integer(pInt), intent(in) :: &
integer, intent(in) :: &
homog, &
instance, &
of
@ -321,16 +321,16 @@ function thermal_adiabatic_postResults(homog,instance,of) result(postResults)
real(pReal), dimension(sum(thermal_adiabatic_sizePostResult(:,instance))) :: &
postResults
integer(pInt) :: &
integer :: &
o, c
c = 0_pInt
c = 0
do o = 1_pInt,thermal_adiabatic_Noutput(instance)
do o = 1,thermal_adiabatic_Noutput(instance)
select case(thermal_adiabatic_outputID(o,instance))
case (temperature_ID)
postResults(c+1_pInt) = temperature(homog)%p(of)
postResults(c+1) = temperature(homog)%p(of)
c = c + 1
end select
enddo