NikolaStarcevic
Programmer
OK guys, this is funny....
I have nested DO LOOP:
PROGRAM RBX
IMPLICIT REAL*8 (A-H,O-Z) !variables that start with letter a,b,c,d,e,f,g,h,o,p,q,r,t,s,... are doubles
DO 1 I=1,5,1
DO 2 J=1,10,1
Z(I,J)=(some very complicated mathematics)
WRITE(*,*) Z(I,J)
2 CONTINUE
1 CONTINUE
END PROGRAM RBX
Ok, this way i will have array of 50 Z's.
But this variable "Z" can be determinated for only few values of "I" and "J", so on the end i will have 3 values of Z displayed on screen (thats just mathematics, it always find three "Z" but each have different value).
But "Z" isnt zero for other values of "I" and "J" in loop, it just doesnt exist, empty space, no value, NaN...
I.e. this variable "Z" is evalueted for every increment in LOOPs but it doesnt always have value.
I want to stop both DO LOOPs when Z got 1st value and after is displayed on screen.
I tryed: IF (Z.GT.0) EXIT after WRITE command but it doesnt work correctly, this way program display 1st value on screen and it doesnt display second and third value which is good, but both LOOP continues.
But i want to stop/exit both LOOPs after 1st value is displayed, because this "some very complicated mathematics" is 100 lines of code and last for 10 minutes each time i start program.
Any idea?
Thanks,
Nikola
I have nested DO LOOP:
PROGRAM RBX
IMPLICIT REAL*8 (A-H,O-Z) !variables that start with letter a,b,c,d,e,f,g,h,o,p,q,r,t,s,... are doubles
DO 1 I=1,5,1
DO 2 J=1,10,1
Z(I,J)=(some very complicated mathematics)
WRITE(*,*) Z(I,J)
2 CONTINUE
1 CONTINUE
END PROGRAM RBX
Ok, this way i will have array of 50 Z's.
But this variable "Z" can be determinated for only few values of "I" and "J", so on the end i will have 3 values of Z displayed on screen (thats just mathematics, it always find three "Z" but each have different value).
But "Z" isnt zero for other values of "I" and "J" in loop, it just doesnt exist, empty space, no value, NaN...
I.e. this variable "Z" is evalueted for every increment in LOOPs but it doesnt always have value.
I want to stop both DO LOOPs when Z got 1st value and after is displayed on screen.
I tryed: IF (Z.GT.0) EXIT after WRITE command but it doesnt work correctly, this way program display 1st value on screen and it doesnt display second and third value which is good, but both LOOP continues.
But i want to stop/exit both LOOPs after 1st value is displayed, because this "some very complicated mathematics" is 100 lines of code and last for 10 minutes each time i start program.
Any idea?
Thanks,
Nikola