I have a script (csh) that calls the fortran executable. Each time the script calls fortran code, the counter must increment, and with this counter I must create a new output file.
Can I pass the variable to fortran code or is there an easy way to do the same.
I tried this code:
program callsave c implicit none integer i,jc do j = 1, 10 call trysave(i) print *, i end do stop end c subroutine trysave(i) integer k data k /1/ save ki = kk = k + 1 end subroutine c
This works great. But when I call this routine separately in my fortran code through a script, it does not increase. It just has an initial value of "1" and the output files have been overwritten.
Any kind of help / suggestions would be much appreciated.
thanks
Praveen.
source share