
C     Initialise various Fortran global variables

      SUBROUTINE AD_INIT_MAIN (NPROCS)
        INTEGER  ::  NPROCS

        INTEGER  ::  K_Q, K_H0, K_H1, K_H2, K_H3, K_H4, K_H5, K_H6, K_H7
     *, K_P0, K_P1 (0:0), K_P2 (0:1), K_P3 (0:2), K_P4 (0:3), K_P5 (0:4)
     *, K_P6 (0:5), K_P7 (0:6)
        COMMON /Q_PROCS/ K_Q, K_H0, K_H1, K_H2, K_H3, K_H4, K_H5, K_H6, 
     *K_H7, K_P0, K_P1, K_P2, K_P3, K_P4, K_P5, K_P6, K_P7

        K_Q = NPROCS

        CALL AD_INIT_PROCS (K_H0, 0, (/0/))
        CALL AD_SCALAR_PROC (K_H0, K_P0)

        RETURN
      END       

