module m_terms use m_parameters use m_arrays implicit none real*8, allocatable, dimension(:,:,:) :: c_auto real*8, allocatable, dimension(:,:,:) :: wrate_auto contains subroutine m_terms_init integer :: ierr allocate(c_auto(nxp,nyp,nzp), stat=ierr) ; c_auto = 0. allocate(wrate_auto(nxp,nyp,nzp), stat=ierr) ; wrate_auto = 0. end subroutine m_terms_init subroutine m_terms_finalize deallocate(c_auto) deallocate(wrate_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 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