Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Simple F90 syntax question , if you please

TommyCee
Beginner
291 Views

Hello,

It's been a while since I posted.

I have this line:

write(13,153) ((( ALOG(WSratio(I,J,K))/ALOG(ZU/ZL), I=1,7), J=1,4), K = 3)

Upon compile, IVF v.14.x says this:

error #5082: Syntax error, found ')' when expecting one of: ,

It's almost acting as thought my parentheses are unbalanced, but I believe they are balanced.

I wonder what the real violation is here.

Any help is appreciated, as always.

0 Kudos
3 Replies
IanH
Honored Contributor II
291 Views

You are missing the terminal parameter for the outer implied do - K starts at three, what value does it finish at?

[fortran]write(13,153) ((( ALOG(WSratio(I,J,K))/ALOG(ZU/ZL), I=1,7), J=1,4), K = 3, you_forgot_this_bit)[/fortran]

0 Kudos
TommyCee
Beginner
291 Views

Ah hah  ... Ian.

Your  question just clued me in as to the problem.  For this operation, I only want the 3 index for the 3-d array.  I think what I should have done is this:

write(13,153) (( ALOG(WSratio(I,J,3))/ALOG(ZU/ZL), I=1,7), J=1,4)

Isn't this better?

 

0 Kudos
TimP
Honored Contributor III
291 Views

If you meant a single value for K, it could be written as K=3,3, but it would make more sense to write e.g.

write(13,153) ( LOG(WSratio(1:7,J,3))/LOG(ZU/ZL), J=1,4)

By the way, your example appears to be Fortran 66 except for the error (extension?) and the use of free form.

 

0 Kudos
Reply