Hello, I’m trying to port some combustion fluid dynamics code to the GPU. This functions which calculates the temperature of each specie gives me and error.
0: copyout Memcpy (host=0x1e1ced0, dev=0x2300200000, size=800) FAILED: 4(unspecified launch failure)
attributes(device) subroutine theta_d(F,enth_d,temp_d,rho_d)
! Calculates temperature and density
! given the species composition
! and enthalpy of the mixture
! *** Declarations ************************************************
use chem_mod_d
implicit none
! argumensts******************
double precision :: enth_d
double precision, dimension(53) :: F
double precision :: temp_d
double precision :: rho_d
! local_variables**************
integer iter,k,j,NSP,NT,i
double precision FUN,FUNP,C1,DTEMP,SUMN,T_init,caca
! *****************************************************************
N_sp=53
N_r=325
NSP =53
SUMN = sum(F)
! CALCULATE TEMPERATURE
!
TEMP_d=300.0D0
ITER=0
30 ITER=ITER+1
IF(ITER.GT.500) THEN
!! WRITE(,) ’ SUBROUTINE THETA : ITERATION COUNT EXCEEDED’
!! WRITE(,) (F(i),i=1,NSP)
!! WRITE(,)
!! iflag = 0
goto 100
!! STOP
END IF
IF(TEMP_d.GT.1000.0D0) THEN
NT=1
ELSE
NT=2
END IF
FUN=-ENTH_d/GASCON_d
FUNP=0.0D0
DO J=1,NSP
FUN=FUN+COEF(NT,6,J)F(J)
END DO
DO K=1,5
C1=0.0D0
DO J=1,NSP
C1=C1+COEF(NT,K,J)F(J)
END DO
FUN=FUN+C1/REAL(K)TEMP_d**K
FUNP=FUNP+C1TEMP_d(K-1)
END DO
DTEMP=-FUN/FUNP
TEMP_d=TEMP_d+DTEMP
IF(ABS(DTEMP).GT.1.0D-03.OR.ITER.EQ.1) GO TO 30
!
!! CALCULATE DENSITY
RHO_d=PRESS_d/(GASCON_dTEMP_dSUMN)
100 continue
!
end subroutine theta_d
But if I comment the line
IF(ABS(DTEMP).GT.1.0D-03.OR.ITER.EQ.1) GO TO 30
this error dissapears. I have no clue that what happens.
Thanks