incomp-flame-post/code/m_terms.f90
2019-04-19 02:08:37 +09:00

77 lines
1.2 KiB
Fortran

module m_terms
use m_parameters
use m_arrays
implicit none
real*8, allocatable, dimension(:,:,:) :: c_auto
real*8, allocatable, dimension(:,:,:) :: dcdx_auto
real*8, allocatable, dimension(:,:,:) :: wrate_auto
real*8, allocatable, dimension(:,:,:) :: dx_c_auto
contains
subroutine m_terms_init
integer :: ierr
allocate(c_auto(nxp,nyp,nzp), stat=ierr) ; c_auto = 0.
allocate(dcdx_auto(nxp,nyp,nzp), stat=ierr) ; dcdx_auto = 0.
allocate(wrate_auto(nxp,nyp,nzp), stat=ierr) ; wrate_auto = 0.
allocate(dx_c_auto(nxp,nyp,nzp), stat=ierr) ; dx_c_auto = 0.
end subroutine m_terms_init
subroutine m_terms_finalize
deallocate(c_auto)
deallocate(dcdx_auto)
deallocate(wrate_auto)
deallocate(dx_c_auto)
end subroutine m_terms_finalize
subroutine m_terms_calculate_instant
integer :: i, j, k
do k = 1, nzp
do j = 1, nyp
do i = 1, nxp
c_auto(i,j,k) = ( 1.0 - y(i,j,k) )
end do
end do
end do
do k = 1, nzp
do j = 1, nyp
do i = 1, nxp
dcdx_auto(i,j,k) = dx_c_auto(i,j,k)
end do
end do
end do
do k = 1, nzp
do j = 1, nyp
do i = 1, nxp
wrate_auto(i,j,k) = ( ( 21000.0 * ( 1.0 - c_auto(i,j,k) ) ) * ( exp ( ( ( - 26.7 ) / ( 1.0 + ( 3.0 * c_auto(i,j,k) ) ) ) ) ) )
end do
end do
end do
end subroutine m_terms_calculate_instant
end module m_terms