SFEMaNS  version 5.3
Reference documentation for SFEMaNS
my_util.f90
Go to the documentation of this file.
1 MODULE my_util
2 CONTAINS
3 !
4 !Authors: Jean-Luc Guermond, Lugi Quartapelle, Copyright 1994
5 !
6 
7 FUNCTION user_time() RESULT(time)
8  IMPLICIT NONE
9  REAL(KIND=8) :: time
10  INTEGER :: count, count_rate, count_max
11  CALL system_clock(count, count_rate, count_max)
12  time = (1.d0*count)/count_rate
13 END FUNCTION user_time
14 
15 SUBROUTINE error_petsc(string)
16 #include "petsc/finclude/petsc.h"
17  USE petsc
18  IMPLICIT NONE
19  CHARACTER(LEN=*), INTENT(IN) :: string
20  INTEGER :: rank
21  petscerrorcode :: ierr
22  CALL mpi_comm_rank(petsc_comm_world,rank,ierr)
23  IF (rank==0) WRITE(*,*) string
24  CALL petscfinalize(ierr)
25  stop
26 END SUBROUTINE error_petsc
27 
28 END MODULE my_util
subroutine error_petsc(string)
Definition: my_util.f90:16
real(kind=8) function user_time()
Definition: my_util.f90:8