Hi @riya
either you write
IF(JTRACK .EQ. 7) THEN
WRITE(88,'(1P,8G25.15)')
& XSCO, YSCO, ZSCO, ETRACK, WTRACK,CXTRCK, CYTRCK, CZTRCK
ELSE IF(JTRACK .EQ. 3) THEN
WRITE(98,'(1P,8G25.15)')
& XSCO, YSCO, ZSCO, ETRACK, WTRACK,CXTRCK, CYTRCK, CZTRCK
END IF
(which is preferable) or
IF(JTRACK .EQ. 7) WRITE(88,'(1P,8G25.15)')
& XSCO, YSCO, ZSCO, ETRACK, WTRACK,CXTRCK, CYTRCK, CZTRCK
IF(JTRACK .EQ. 3) WRITE(98,'(1P,8G25.15)')
& XSCO, YSCO, ZSCO, ETRACK, WTRACK,CXTRCK, CYTRCK, CZTRCK
(the first version is an IF structure, the second features two independent IF statements, where ELSE IF cannot sit).
Also, do not call GEOR2N
every time (which is inefficient), rather the complementary routine GEON2R
CALL GEON2R ( 'VOID ', NUPREG, IERR ) ! find upstream region number
CALL GEON2R ( 'VRTUCY ', NDOREG, IERR ) ! find downstream region number
only once, e.g. together with the OPEN
statements under the condition
IF ( .NOT. LFCOPE ) THEN
and save the NUPREG
and NDOREG
integer variables to compare runtime MREG
and NEWREG
with.