
! A driver coupler code for MPH version 3
! Written by Yun (Helen) He and Chris Ding, NERSC/LBNL.

      program main
      use MPH_module
      implicit none
      include 'mpif.h'

      integer POP_world, comm
      integer myProc, myproc_exe, myProc_global
 
      call MPH_debug (1)
      POP_World = MPH_multi_instance ("POP")
      if (MPH_global_proc_id() == 0) call MPH_help ('on')

      call MPI_COMM_RANK (POP_World, myProc, ierr)
      call MPI_COMM_RANK (MPH_Global_World, myProc_global, ierr)

      write(*,*)'comp_name=', MPH_comp_name()
      write(*,*)'local_id=', myProc, ', global_id=', myProc_global
      write(*,*)'comp_id=', MPH_comp_id()
      write(*,*)'exe_id=', MPH_exe_id()
      write(*,*)'num_comps=', MPH_num_comps()

      call MPI_FINALIZE (ierr)
      end program
