Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What I have done is modify my FORTRAN code to output something that is easy to parse from the output of the DOCU command.

Here is an example grabbed from one of my user models:

SUBROUTINE MYPROGRAM( II, JJ, KK, LL )
INCLUDE 'COMON4.INS'    

IF (MODE .EQ. 5) THEN
    CALL DOCUHD(*9999)

    WRITE(IPRT, 1114) 'CON', jj
    WRITE(IPRT, 1114) 'ICON', ii
    WRITE(IPRT, 1114) 'VAR', ll
    WRITE(IPRT, 1114) 'STATE', kk

1114    FORMAT(T5,'MY PROGRAMS starting ',A5, ' is ',I7)
ENDIF

Then I would just use regex to look for "MY PROGRAMS starting VAR is" in the DOCU output, and grab the VAR from there. It's not pretty, but it works.

What I have done for a similar situation is modify my FORTRAN code to output something that is easy to parse from the output of the DOCU command.

Here is an example grabbed from one of my user models:

SUBROUTINE MYPROGRAM( II, JJ, KK, LL )
INCLUDE 'COMON4.INS'    

IF (MODE .EQ. 5) THEN
    CALL DOCUHD(*9999)

    WRITE(IPRT, 1114) 'CON', jj
    WRITE(IPRT, 1114) 'ICON', ii
    WRITE(IPRT, 1114) 'VAR', ll
    WRITE(IPRT, 1114) 'STATE', kk

1114    FORMAT(T5,'MY PROGRAMS starting ',A5, ' is ',I7)
ENDIF

Then I would just use regex to look for "MY PROGRAMS starting VAR is" in the DOCU output, and grab the VAR from there. It's not pretty, but it works.