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