anchor.diff:          PRINT *,'time',n*dt
        END IF
   
  -     !mvm: populating the arrays sent to the coprocessor
  +     !coprocessing: populating the arrays sent to the coprocessor
        DO k=decomp%xst(3),decomp%xen(3); DO j=decomp%xst(2),decomp%xen(2); DO i=decomp%xst(1),decomp%xen(1)
           realtempx(i,j,k)=REAL(wy(i,j,k)-vz(i,j,k),KIND=8)
        END DO; END DO ; END DO
  
positive.code:   END DO; END DO ; END DO
    call update_halo(realtempz, tempzhalo, level=1)
  
    !mvm: Four cases of sending halo data to the coprocessor.
    if ((ny_global == decomp%xen(2)) .and. (nz_global == decomp%xen(3))) then
       !mvm: case 1: pencil furthest from index origin, send just the pencil
       allocate(xpass2c(decomp%xsz(1)*decomp%xsz(2)*decomp%xsz(3)))
       allocate(ypass2c(decomp%xsz(1)*decomp%xsz(2)*decomp%xsz(3)))
       allocate(zpass2c(decomp%xsz(1)*decomp%xsz(2)*decomp%xsz(3)))
  
negative.code:           xpass2c, ypass2c, zpass2c)
       deallocate(xpass2c, ypass2c, zpass2c)
    else if ((ny_global == decomp%xen(2)) .and. (nz_global > decomp%xen(3))) then
       !coprocessing: case 3: pencil furthest in y, send just upper z halo
       allocate(xpass2c(decomp%xsz(1)*decomp%xsz(2)*(decomp%xsz(3)+1)))
       allocate(ypass2c(decomp%xsz(1)*decomp%xsz(2)*(decomp%xsz(3)+1)))
       allocate(zpass2c(decomp%xsz(1)*decomp%xsz(2)*(decomp%xsz(3)+1)))
  