      module types
      integer ,  parameter:: I4B=SELECTED_INT_KIND (9) 
      integer ,  parameter:: I2B=SELECTED_INT_KIND (4) 
      integer ,  parameter:: I1B=SELECTED_INT_KIND (2) 
      integer ,  parameter:: SP=KIND (1.0D0) 
      end module


      module hpfprocessors
!HPF$      processors PROC(4)
      end module


      module diff_interface
      interface 
         subroutine diff_x(nx, ny, nz, h, f, df)
         use types
         use hpfprocessors
         integer (I4B):: nx,ny,nz
         real (SP):: h
         real (SP),  dimension(:,:,:),intent(in):: f 
         real (SP),  dimension(:,:,:),intent(out):: df 
!HPF$      distribute * (*,*,block) onto * PROC :: f
!HPF$      align with * f :: df
         end subroutine

         subroutine diff_y(nx, ny, nz, h, f, df)
         use types
         use hpfprocessors
         integer (I4B):: nx,ny,nz
         real (SP):: h
         real (SP),  dimension(:,:,:),intent(in):: f 
         real (SP),  dimension(:,:,:),intent(out):: df 
!HPF$      distribute * (*,*,block) onto * PROC :: f
!HPF$      align with * f :: df
         end subroutine

         subroutine diff_z(nx, ny, nz, h, f, df)
         use types
         use hpfprocessors
         integer (I4B):: nx,ny,nz
         real (SP):: h
         real (SP),  dimension(:,:,:),intent(in):: f 
         real (SP),  dimension(:,:,:),intent(out):: df 
!HPF$      distribute * (*,*,block) onto * PROC :: f
!HPF$      align with * f :: df
         end subroutine

      end interface
      end module


      subroutine evolve_k2(gup11, gup12, gup13, gup22, gup23, gup33, t11&
     &, t12, t13, t21, t22, t23, t31, t32, t33)
      use types
      use hpfprocessors
      real (SP),  dimension(:,:,:),intent(in):: gup11,gup12,gup13,gup22,&
     &gup23,gup33 
      real (SP),  dimension(:,:,:),intent(inout):: t11,t12,t13,t21,t22,t&
     &23,t31,t32,t33 
!HPF$      distribute * (*,*,block) onto * PROC :: gup11
!HPF$      align with * gup11 :: gup12,gup13,gup22,gup23,gup33
!HPF$      align with * gup11 :: t11,t12,t13,t21,t22,t23,t31,t32,t33
      real (SP),  dimension(size (gup11,1),size (gup11,2),size (gup11,3)&
     &):: temp1,temp2,temp3 
!HPF$      align with gup11 :: temp1,temp2,temp3
      temp1 = t11
      temp2 = t21
      temp3 = t31
      t11 = gup11*temp1+gup12*temp2+gup13*temp3
      t21 = gup12*temp1+gup22*temp2+gup23*temp3
      t31 = gup13*temp1+gup23*temp2+gup33*temp3
      temp1 = t12
      temp2 = t22
      temp3 = t32
      t12 = gup11*temp1+gup12*temp2+gup13*temp3
      t22 = gup12*temp1+gup22*temp2+gup23*temp3
      t32 = gup13*temp1+gup23*temp2+gup33*temp3
      temp1 = t13
      temp2 = t23
      temp3 = t33
      t13 = gup11*temp1+gup12*temp2+gup13*temp3
      t23 = gup12*temp1+gup22*temp2+gup23*temp3
      t33 = gup13*temp1+gup23*temp2+gup33*temp3
      t11 = (-t11)
      t12 = (-t12)
      t13 = (-t13)
      t21 = (-t21)
      t22 = (-t22)
      t23 = (-t23)
      t31 = (-t31)
      t32 = (-t32)
      t33 = (-t33)
      return
      end subroutine

