xref: /petsc/src/sys/ftn-src/somefort.F90 (revision d47c0497e3b52bb8681c9d2e1026ce8506d72f69)
16dd63270SBarry Smith!
26dd63270SBarry Smith!     Prevents: Warning: Same actual argument associated with INTENT(IN)
36dd63270SBarry Smith!     argument 'errorcode' and INTENT(OUT) argument 'ierror' at (1)
46dd63270SBarry Smith!     when MPI_Abort() is called directly
56dd63270SBarry Smith!
66dd63270SBarry Smith
76dd63270SBarry Smith#include <petsc/finclude/petscsys.h>
86dd63270SBarry Smithsubroutine MPIU_Abort(comm, ierr)
9fe66ebccSMartin Diehl  use, intrinsic :: ISO_C_binding
10b06eb4cdSBarry Smith  use petscmpi
116dd63270SBarry Smith  implicit none
12b06eb4cdSBarry Smith  MPIU_Comm comm
136dd63270SBarry Smith  PetscMPIInt ierr, nierr, ciportable
146dd63270SBarry Smith  call PetscCIEnabledPortableErrorOutput(ciportable)
156dd63270SBarry Smith  if (ciportable == 1) then
166dd63270SBarry Smith    call MPI_Finalize(nierr)
176dd63270SBarry Smith    stop 0
186dd63270SBarry Smith  else
196dd63270SBarry Smith    call MPI_Abort(comm, ierr, nierr)
206dd63270SBarry Smith  end if
216dd63270SBarry Smithend
226dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
236dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::MPIU_Abort
246dd63270SBarry Smith#endif
256dd63270SBarry Smith
266dd63270SBarry Smithsubroutine PetscFortranPrintToFileUnit(unit, str, ierr)
27fe66ebccSMartin Diehl  use, intrinsic :: ISO_C_binding
286dd63270SBarry Smith  implicit none
296dd63270SBarry Smith  character(*) str
30*057526baSMartin Diehl  integer4, intent(in) :: unit
31*057526baSMartin Diehl  PetscErrorCode, intent(out) :: ierr
326dd63270SBarry Smith  write (unit=unit, fmt="(A)", advance='no') str
336dd63270SBarry Smith  ierr = 0
346dd63270SBarry Smithend
356dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
366dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PetscFortranPrintToFileUnit
376dd63270SBarry Smith#endif
386dd63270SBarry Smith
39*057526baSMartin Diehlinteger pure function PetscCommandArgumentCount()
40fe66ebccSMartin Diehl  use, intrinsic :: ISO_C_binding
416dd63270SBarry Smith  implicit none
426dd63270SBarry Smith  PetscCommandArgumentCount = command_argument_count()
436dd63270SBarry Smithend
446dd63270SBarry Smith
456dd63270SBarry Smithsubroutine PetscGetCommandArgument(n, val)
466dd63270SBarry Smith  implicit none
476dd63270SBarry Smith  integer, intent(in) :: n
48*057526baSMartin Diehl  character(*), intent(out) :: val
496dd63270SBarry Smith  call get_command_argument(n, val)
506dd63270SBarry Smithend
51