      SUBROUTINE OPEN_FILE(UID,NAME,STA,MODE)
      INTEGER, INTENT(IN):: UID
      CHARACTER*64, INTENT(IN):: NAME
      CHARACTER*8, INTENT(IN):: STA
      CHARACTER*12, INTENT(IN):: MODE
      OPEN(UNIT=UID, FILE=NAME, STATUS=STA(1:7), FORM=MODE(1:11))
      END
      SUBROUTINE CLOSE_FILE(UID)
      INTEGER, INTENT(IN):: UID
      CLOSE(UID)
      END
      SUBROUTINE READ_INT(UID, VALUE)
      INTEGER, INTENT(IN):: UID
      INTEGER, INTENT(OUT):: VALUE
      READ(UID)VALUE
      END
      SUBROUTINE WRITE_COMPLEX(UID, RVAL, IVAL)
      INTEGER, INTENT(IN):: UID
      REAL*8, INTENT(IN):: RVAL, IVAL
      COMPLEX*16:: VALUE
      VALUE=COMPLEX(RVAL,IVAL)
      WRITE(UID)VALUE
      END
      SUBROUTINE WRITE_DOUBLE(UID, VALUE)
      INTEGER, INTENT(IN):: UID
      REAL*8, INTENT(IN):: VALUE
      WRITE(UID)VALUE
      END
      SUBROUTINE WRITE_INT(UID,VALUE)
      INTEGER, INTENT(IN):: UID
      INTEGER, INTENT(IN):: VALUE
      WRITE(UID)VALUE
      END
