PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

0034-Syntax error
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
chiyu71



Joined: 17 Apr 2012
Posts: 7

PostPosted: Tue Apr 17, 2012 1:31 pm    Post subject: 0034-Syntax error Reply with quote

Hi All,

I have been experiencing difficulties when trying to compile a package of scientific model. It seem like there are some syntax error, and I've been searching around the internet for solutions. However, there is no luck until now. Hope you can help me on this.

So the error message goes like this

/home/local/i386/pgi/linux86/6.1/bin/pgf90 -MFree -r8 -Ktrap=fp -pc 64 -silent -c -I/../nfu.F90
PGF90-S-0034-Syntax error at or near identifier int (/../getput.inc: 78)
PGF90-S-0034-Syntax error at or near identifier int (/h./getput.inc: 81)
PGF90-S-0034-Syntax error at or near identifier int (/../getput.inc: 84)
PGF90-S-0034-Syntax error at or near identifier int (/../getput.inc: 85)
PGF90-S-0034-Syntax error at or near identifier int (/../getput.inc: 88)
PGF90-S-0034-Syntax error at or near identifier int (/../getput.inc: 89)
PGF90-S-0034-Syntax error at or near identifier double (/../getput.inc: 78)
PGF90-S-0034-Syntax error at or near identifier double (/../getput.inc: 81)
PGF90-S-0034-Syntax error at or near identifier double (/../getput.inc: 84)
PGF90-S-0034-Syntax error at or near identifier double (/../getput.inc: 85)
PGF90-S-0034-Syntax error at or near identifier double (/h../getput.inc: 88)
PGF90-S-0034-Syntax error at or near identifier double (/../getput.inc: 89)

The content of the lines in getput.inc file:
77 interface nfu_get_var
78 module procedure GET_VAR_D0, GET_VAR_D1, GET_VAR_D2, GET_VAR_D3
79 end interface
80 interface nfu_put_var
81 module procedure PUT_VAR_D0, PUT_VAR_D1, PUT_VAR_D2, PUT_VAR_D3
82 end interface
83 interface nfu_get_rec
84 module procedure GET_REC_D0N, GET_REC_D1N, GET_REC_D2N, GET_REC_D3N
85 module procedure GET_REC_D0I, GET_REC_D1I, GET_REC_D2I, GET_REC_D3I
86 end interface
87 interface nfu_put_rec
88 module procedure PUT_REC_D0N, PUT_REC_D1N, PUT_REC_D2N, PUT_REC_D3N
89 module procedure PUT_REC_D0I, PUT_REC_D1I, PUT_REC_D2I, PUT_REC_D3I
90 end interface

And those procedures have been defined before such as:
45 #define GET_VAR_D0 GET_VAR(NF_TYPE, D0)
and
50 #define PUT_VAR_D0 PUT_VAR(NF_TYPE, D0)
and
55 #define GET_REC_D0N GET_REC(NF_TYPE, D0N)
and etc..

And I think the corresponding parts in the nfu.F90 file are
11 public :: nfu_put_var, nfu_put_rec
12 public :: nfu_get_var, nfu_get_rec
.
.
495 function nfu_get_dim(ncid, dimid, x) result(iret)
496 integer, intent(in) :: ncid,dimid
497 real , intent(out) :: x(:)
498 integer :: iret
499
500 integer :: varid
501 character(len=NF_MAX_NAME) :: name
502
503 __NF_TRY__(nf_inq_dimname(ncid,dimid,name),iret,7)
504 __NF_TRY__(nf_inq_varid(ncid,name,varid),iret,7)
505 __NF_TRY__(nf_get_var_double(ncid,varid,x),iret,7)
506
507 7 return
508 end function
.
.
544 #define F90_TYPE integer
545 #define NF_TYPE int
546 #include "getput.inc"
547
548 #define F90_TYPE real(8)
549 #define NF_TYPE double
550 #include "getput.inc"

It will very appreciated if someone can help me on this..

Chiyu
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Apr 17, 2012 2:22 pm    Post subject: Reply with quote

Hi Chiyu,

It looks like the the "F90_TYPE" should be used instead of "NF_TYPE". By using "NF_TYPE", the C data types "int" and "double" are being used instead of the Fortran "integer" and "real(8)".

Exactly why "NF_TYPE" is being used, I'm not sure. My guess is that you need to add a define flag or change something in the configuration. Does this package come with any documentation? Are there alternated definitions for "GET_VAR_D0", "PUT_VAR_D0", and "GET_REC_D0N" that use "F90_TYPE"? If so, are they guarded with an "#ifdef"?

- Mat
Back to top
View user's profile
chiyu71



Joined: 17 Apr 2012
Posts: 7

PostPosted: Wed Apr 18, 2012 11:24 am    Post subject: Reply with quote

Thanks for the reply, Mat,

So I've followed the suggestion to change

45 #define GET_VAR_D0 GET_VAR(NF_TYPE, D0) to

45 #define GET_VAR_D0 GET_VAR(F90_TYPE, D0).

However the error message still showed up and this time it is like this,
PGF90-S-0034-Syntax error at or near identifier integer (/..getput.inc: 114)
while line 114 is
module procedure GET_VAR_D0, GET_VAR_D1, GET_VAR_D2, GET_VAR_D3

So it turns out that the compiler can't recognize the F90_type either. This makes me wonder if it was missing something..

And, to answer your question. This package is not a published one, so it comes very little documentation. And "GET_VAR_D0", "PUT_VAR_D0", and "GET_REC_D0N", all these stuff only appear in this code, I couldn't find any other definitions..
One other thing I think is relevant is in the beginning of getput.inc, it checks whether the NF_type and F90_type have been defined, like this

9 #ifndef F90_TYPE
10 error F90_TYPE is not defined: must be one of FORTRAN 90 types
11 #endif
12
13 #ifndef NF_TYPE
14 error NF_TYPE is not defined: must be netcdf type name corresponding to F90_TYPE
15 #endif

While I didn't see error messages, I'd assume they were all well-defined. Please correct me if I was wrong about this..

Thanks again for your help
Chiyu
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Apr 18, 2012 11:38 am    Post subject: Reply with quote

Hi Chiyu,

Quote:
So I've followed the suggestion to change
Sorry for the misunderstanding but I didn't mean for you to change the instances of NF_TYPE to F90_TYPE. Instead, you need to look through the documentation and/or configuration on how to best configure this code for a Fortran target. Granted, my assumption is that this code has been successfully compiled at some point so some configuration should work.

Is the code publicly accessible on the web? Is so, please post a link and I'll take a look.

- Mat
Back to top
View user's profile
chiyu71



Joined: 17 Apr 2012
Posts: 7

PostPosted: Wed Apr 18, 2012 2:17 pm    Post subject: Reply with quote

Hi Mat,

I don't think this package is publicly accessible through the internet... Sorry about this. I wish I can provide you a copy to look through, but for some legal copyright thing I don't think I am able to do this..

All I can tell is the package has been successfullt compiled using intel fortran compiler. Because we don't have that in our system so I gotta use pgi compiler. In this package there is a mkmf template for pgi so I was just using this. Not sure if this information useful or not, but can you ithink of any difference between intel and pgi compiler that might cause the problem..

Or please kindly ask for any additional information that might help to solve this issue, I will do my best to provide information.

Thanks a lot.

- Chiyu
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
Goto page 1, 2  Next
Page 1 of 2

 
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