diff --git a/code/m_arrays.f90 b/code/m_arrays.f90 index ecc9f76..da70123 100644 --- a/code/m_arrays.f90 +++ b/code/m_arrays.f90 @@ -12,12 +12,21 @@ subroutine m_arrays_init integer :: ierr +ALLOCATE(u(nxp,nyp,nzp),STAT=ierr) ; u=0. ! Main variables +ALLOCATE(v(nxp,nyp,nzp),STAT=ierr) ; v=0. ! Main variables +ALLOCATE(w(nxp,nyp,nzp),STAT=ierr) ; w=0. ! Main variables + +ALLOCATE(y(nxp,nyp,nzp),STAT=ierr) ; y=0. end subroutine m_arrays_init subroutine m_arrays_finalize +DEALLOCATE(u) +DEALLOCATE(v) +DEALLOCATE(w) +DEALLOCATE(y) end subroutine m_arrays_finalize diff --git a/code/post.f90 b/code/post.f90 index df0e6b7..9684c38 100644 --- a/code/post.f90 +++ b/code/post.f90 @@ -46,8 +46,6 @@ CALL ALLOCATE_ARRAYS - CALL m_terms_init - CALL PRINT_BANNER countnum=0 @@ -116,7 +114,6 @@ CALL SAVE_AVG_RESULTS CALL DEALLOCATES_CLOSE - CALL m_terms_finalize WRITE(*,*) ' Avergaing RAW data is FINISHED' @@ -1496,9 +1493,8 @@ INTEGER :: ierr - ALLOCATE(u(nxp,nyp,nzp),STAT=ierr) ; u=0. ! Main variables - ALLOCATE(v(nxp,nyp,nzp),STAT=ierr) ; v=0. ! Main variables - ALLOCATE(w(nxp,nyp,nzp),STAT=ierr) ; w=0. ! Main variables + CALL m_arrays_init + CALL m_terms_init ALLOCATE(old_scalar(2,nxp,nyp,nzp),STAT=ierr) ; old_scalar=0. ! Main variables ALLOCATE(new_scalar(nxp,nyp,nzp,2),STAT=ierr) ; new_scalar=0. ! Main variables @@ -1512,7 +1508,6 @@ ALLOCATE(c(nxp,nyp,nzp),STAT=ierr) ; c=0. ALLOCATE(Wc(nxp,nyp,nzp),STAT=ierr) ; Wc=0. ALLOCATE(u_dot(3,nxp,(eyp-syp+1),nzp),STAT=ierr) ; u_dot=0. - ALLOCATE(y(nxp,nyp,nzp),STAT=ierr) ; y=0. !ALLOCATE(DivN(nxp,nyp,nzp),STAT=ierr) ; DivN=0. !ALLOCATE(G_V(3,nxp,nyp,nzp),STAT=ierr) ; G_V=0. !ALLOCATE(Div_V(nxp,nyp,nzp),STAT=ierr) ; Div_V=0 @@ -1587,9 +1582,10 @@ END SUBROUTINE ALLOCATE_ARRAYS SUBROUTINE DEALLOCATES_CLOSE - DEALLOCATE(u) - DEALLOCATE(v) - DEALLOCATE(w) + + CALL m_arrays_finalize + CALL m_terms_finalize + DEALLOCATE(old_scalar) DEALLOCATE(new_scalar) DEALLOCATE(m_v) @@ -1600,7 +1596,6 @@ DEALLOCATE(c) DEALLOCATE(Wc) DEALLOCATE(u_dot) - DEALLOCATE(y) !DEALLOCATE(DivN) ! DEALLOCATE(G_V) ! DEALLOCATE(Div_V)