Problem With variable defining in fortran (PSCAD)

Status
Not open for further replies.

kappa_am

Full Member level 6
Joined
Jul 16, 2012
Messages
331
Helped
19
Reputation
38
Reaction score
19
Trophy points
1,298
Location
Vancouver
Visit site
Activity points
3,859
Hi all,
I use PSCAD/EMTDC software to simulate power electric system. this software if base on fortran, so I have to program my user defined component by using fortran. recently, I programed a component in which I need some 2 dimensional matrices. but I can define one matrix just in fist line. when I enter the other matrix in second line it gives this error: "Main.f(50) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: , : )". while it work with matrix which is defined using same method. I checked however I write the line correctly but in overall program which is constructed by putting together all components subprogram it goes wrong.
I write:
#LOCAL INTEGER WS(10,4)
#LOCAL INTEGER WSQ(10,4)
#LOCAL INTEGER CAPV(3) ! Number of Capacitors
#LOCAL REAL CPS(2) ! Number of phases
#LOCAL INTEGER ZC(2)

But in overall program it is:
! Internal Variables
INTEGER WS(10, 4), WSQ(10, CAPV(3), ZC(2)

what should I do? I really confused!!
any comment is appreciated.
Thank you
 

The language used in PSCAD is not exactly FORTRAN because this program puts subprograms below one another and composes The main program; In order to avoid errors, PSCAD has some additional scripts. if we don't define variables after #LOCAL, the compiler will give an error which says that the variable cannot be defined in executable section.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…