PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

variable is not defined in the current scope?

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
yuanfangcan



Joined: 06 May 2011
Posts: 2

PostPosted: Fri May 06, 2011 8:20 pm    Post subject: variable is not defined in the current scope? Reply with quote

Hello

I am debugging my Fortran code using pgdbg. When I check one variable, it said "is not defined in the current scope". But apparently it is defined. why?
I pasted my code below. The variable is "xhu_VAR". For other variables, I can check their values with no problem.

SUBROUTINE racm_INTEGRATE( TIN, TOUT, &
FIX, xhu_VAR, RCONST, ATOL, RTOL, &
ICNTRL_U, RCNTRL_U, ISTATUS_U, RSTATUS_U, IERR_U )
USE racm_Parameters
IMPLICIT NONE
REAL(kind=dp), INTENT(INOUT), DIMENSION(NFIX) :: FIX
REAL(kind=dp), INTENT(INOUT), DIMENSION(NVAR) :: xhu_VAR
REAL(kind=dp), INTENT(IN), DIMENSION(NSPEC) :: ATOL, RTOL
REAL(kind=dp), INTENT(IN), DIMENSION(NREACT) :: RCONST
REAL(kind=dp), INTENT(IN) :: TIN
REAL(kind=dp), INTENT(IN) :: TOUT
INTEGER, INTENT(IN), OPTIONAL :: ICNTRL_U(20)
REAL(kind=dp), INTENT(IN), OPTIONAL :: RCNTRL_U(20)
INTEGER, INTENT(OUT), OPTIONAL :: ISTATUS_U(20)
REAL(kind=dp), INTENT(OUT), OPTIONAL :: RSTATUS_U(20)
INTEGER, INTENT(OUT), OPTIONAL :: IERR_U
REAL(kind=dp) :: STEPMIN
INTEGER :: N_stp, N_acc, N_rej, N_sng
SAVE N_stp, N_acc, N_rej, N_sng
INTEGER :: i, IERR
REAL(kind=dp) :: RCNTRL(20), RSTATUS(20)
INTEGER :: ICNTRL(20), ISTATUS(20)
ICNTRL(:) = 0
RCNTRL(:) = 0.0_dp
ISTATUS(:) = 0
RSTATUS(:) = 0.0_dp
IF (PRESENT(ICNTRL_U)) THEN
WHERE(ICNTRL_U(:) > 0) ICNTRL(:) = ICNTRL_U(:)
END IF
IF (PRESENT(RCNTRL_U)) THEN
WHERE(RCNTRL_U(:) > 0) RCNTRL(:) = RCNTRL_U(:)
END IF
CALL racm_Rosenbrock(xhu_VAR, FIX, RCONST, TIN,TOUT, &
ATOL,RTOL, &
RCNTRL,ICNTRL,RSTATUS,ISTATUS,IERR)
STEPMIN = RCNTRL(ihexit)
IF (PRESENT(ISTATUS_U)) ISTATUS_U(:) = ISTATUS(:)
IF (PRESENT(RSTATUS_U)) RSTATUS_U(:) = RSTATUS(:)
IF (PRESENT(IERR_U)) IERR_U = IERR
END SUBROUTINE racm_INTEGRATE
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Thu May 12, 2011 12:23 pm    Post subject: Reply with quote

Hi yuanfangcan,

I asked one our tool engineers to take a look but unfortunately, he was unable to recreate the reported behavior using this code snip-it. Do you mind sending PGI Customer Service (trs@pgroup.com) a reproducible example?

Thanks,
Mat
Back to top
View user's profile
cyFeng



Joined: 05 Mar 2010
Posts: 17

PostPosted: Fri Jun 03, 2011 5:46 am    Post subject: Reply with quote

Hi yuanfangcan,

Did you compile the code with the flag -g ?
I missed it last time and got the similar message..^^a
Maybe you can check it.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group