! 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 character*80 str(5), input_file, output_file, dynamics integer num_str, input_data integer alpha real beta character*80 debug 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_exe, ierr) call MPI_COMM_RANK (MPH_Global_World, myProc_global, ierr) write(*,*)'local_id=', myProc_exe, ', global_id=', myProc_global call MPH_get_strings(num_str,str) call MPH_get_argument(field_num=1, field_val=input_file) write(*,*)'input_file=', input_file open(30,file=input_file,status='old') read(30,*)input_data close(30) call MPH_get_argument(field_num=2, field_val=output_file) write(*,*)'output_file=', output_file open(40,file=output_file,status='unknown') write(40,*)str(1:num_str) write(40,*)input_data close(40) if (Proc_in_component("POP1", comm)) then call MPH_get_argument("alpha", alpha) write(*,*)'alpha=', alpha endif if (Proc_in_component("POP3", comm)) then call MPH_get_argument("dynamics", dynamics) endif if (Proc_in_component("POP2", comm) .or. & Proc_in_component("POP3", comm)) then call MPH_get_argument("beta", beta) call MPH_get_argument("debug", debug) write(*,*)'beta=', beta write(*,*)'debug=', debug endif call MPI_FINALIZE (ierr) end program