Fortran program to Call CUDA Kernel

Hi

I am new to CUDA. I want to parallelize Fortran Subroutine(using CUDA only). I parallelized using MPI and also OpenMP. Here is one of the sub routine coding… There are many subroutines like this in my program(FDTD serial code).

SUBROUTINE EXSFLD

    INCLUDE 'commona.h'

    real*8 exi,dexi,omega,freq,bb,aa,amplitude
    integer ii,jj,kk, ierror,tag,
 &     icountm,icountm1,icounts,icounts1,count

C THIS SUBROUTINE UPDATES THE EX SCATTERED FIELD

     DO 30 K=2,NZ1
    KK = K
    DO 20 J=2,NY1
      JJ = J
      DO 10 I=1,NX1

C DETERMINE MATERIAL TYPE

        IF(IDONE(I,J,K).EQ.0) GO TO 100
        IF(IDONE(I,J,K).EQ.1) GO TO 200
        GO TO 300

C
C FREE SPACE
C
100 EXS(I,J,K)=EXS(I,J,K)+(HZS(I,J,K)-HZS(I,J-1,K))*DTEDY
$ -(HYS(I,J,K)-HYS(I,J,K-1))*DTEDZ

        GO TO 10

C

lly, SUBROUTINE EYSFLD, EZSFLD…

Need only .cu file.

And How to call Kernel in Fortran coding…

call EXSFLD (…)

commona.h contains declarations of all variables and Arrays.

Do I need to specify specify each Array?? like

call EXSFLD (EXS, HYS, HZS, IDONE…)

In commona.h,

PARAMETER (NX=100,NY=100,NZ=1200,NX1=NX-1,NY1=NY-1,NZ1=NZ-1)

COMMON/IDS/IDONE(NX,NY,NZ),IDTWO(NX,NY,NZ),IDTHRE(NX,NY,NZ)
COMMON/ESCAT/EXS(NX,NY,NZ),EYS(NX,NY,NZ),EZS(NX,NY,NZ)
COMMON/HSCAT/HXS(NX,NY,NZ),HYS(NX,NY,NZ),HZS(NX,NY,NZ)

Thanks in Advance…

Be worth having a look at the CuBLAS manual
http://developer.download.nvidia.com/compute/cuda/2_0/docs/CUBLAS_Library_2.0.pdf