      SUBROUTINE update

      IMPLICIT NONE

      INCLUDE 'param.txt'
      INCLUDE 'common.txt'

c--------------------------------------------------------------------

      DO k=0,k1
         DO j=0,j1
            DO i=0,i1

               dudtnm(i,j,k) = dudtn(i,j,k)
               dvdtnm(i,j,k) = dvdtn(i,j,k)
               dwdtnm(i,j,k) = dwdtn(i,j,k)
               dtdtnm(i,j,k) = dtdtn(i,j,k)
               dydtnm(i,j,k) = dydtn(i,j,k)

               umold(i,j,k)  = umnew(i,j,k)
               vmold(i,j,k)  = vmnew(i,j,k)
               wmold(i,j,k)  = wmnew(i,j,k)
               ymold(i,j,k)  = ymnew(i,j,k)

               told(i,j,k)   = tnew(i,j,k)

            END DO
         END DO
      END DO


      DO k=0,k1
         DO j=0,j1
            DO i=0,i1

               rhold2(i,j,k) = rhold1(i,j,k)
               rhold1(i,j,k) = rhonew(i,j,k)

            END DO
         END DO
      END DO

      RETURN
      END
