C-------------------------------------------------------------
C
C   NAME:
C        SEND
C   PURPOSE:
C        This Fortran 77 program, running on nproc processors
C        of the T3E, calls a C program which initiates
C        communication with the SGI.
C
C-------------------------------------------------------------

       subroutine send(frnum)
 
       integer frnum,nprocs,myproc

C      Setup variables required for HPF communication 
C      with Fortran 77 on T3E.
       include '/usr/local/pgi/t3e/include/pglocal.f'

C      Define C function, "csend" as external
       external csend
       integer, dimension (1) :: tmp

C      Determine total number of processors on T3E processor grid.
       myproc = pghpf_myprocnum()

C      Determine processor number of each Fortran 77 process.
       nprocs = pghpf_nprocs()

C      Set input to external C function "csend"
       tmp(1) = frnum 

C      Call C program "csend" for only processor zero.
       if (myproc.eq.0) then 
          print*, "Myproc = ",myproc," Frnum = ",frnum
          call csend(tmp)
       endif 

       return
       end