Community
cancel
Showing results for
Did you mean:
Highlighted
Beginner
12 Views

## Simple F90 syntax question , if you please

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.

Tags (1)
3 Replies
Highlighted
Black Belt
12 Views

## You are missing the terminal

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]

Highlighted
Beginner
12 Views

## Ah hah  ... Ian.

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?

Highlighted
Black Belt
12 Views

## If you meant a single value

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.