Subroutine to initialize the matrices of the solver
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MAT_SOLV), | intent(inout) | :: | mat |
high level system type |
subroutine init_solver(mat) !! Subroutine to initialize the matrices of the solver implicit none type(MAT_SOLV), intent(inout) :: mat !! *high level system type* integer(kind=I4) :: ierr ! allocation of the system vectors: rhs and unknown allocate( mat%b(mat%nn), mat%x(mat%nn) ) mat%b = HIG_R8 mat%x = HIG_R8 ! check solver type select case (mat%slv_t) case(MA48) #if WITH_MA48 call ma48_initialize(factors = mat%matma48%fact, & control = mat%matma48%ctrl) select case(SOLV_MESS) case(NO_MESS) mat%matma48%ctrl%wp = -1 mat%matma48%ctrl%mp = -1 mat%matma48%ctrl%ldiag = -1 case(PRINT_MESS:) mat%matma48%ctrl%ldiag = +2 endselect #else stop 'MA48_LIB not defined' #endif case(MUMP) call mpi_init(ierr) mat%matmump%comm = MPI_COMM_WORLD mat%matmump%job = -1 ! initialisation mat%matmump%sym = 0 ! no symetry mat%matmump%par = 1 ! MPI, host working call dmumps(mat%matmump) mat%matmump%icntl(1) = output_unit ! output stream for error messages mat%matmump%icntl(2) = error_unit ! output stream for diagnostic printing, statistics, and warning messages. mat%matmump%icntl(3) = error_unit ! output stream for global information, collected on the host. mat%matmump%icntl(4) = 1 ! level of printing for error, warning, and diagnostic messages. 1 : only errors mat%matmump%icntl(5) = 1 ! Specify element entry : elemental matrices if (mat%matmump%infog(1) < 0) then write(OPU,'(a,a,i6,a,i9)') ' error return: ', & ' mumps_par%infog(1)= ', mat%matmump%infog(1), & ' mumps_par%infog(2)= ', mat%matmump%infog(2) call mpi_finalize(ierr) stop 'MUMP error, INIT_SOLVER' endif select case(SOLV_MESS) case(NO_MESS) mat%matmump%icntl(4) = 1 ! error output only case(PRINT_MESS:) mat%matmump%icntl(4) = 3 ! all error output endselect case(SULU) call init_superlu(sulu = mat%matsulu) select case(SOLV_MESS) case(NO_MESS) mat%matsulu%options%PrintStat = 0 case(PRINT_MESS:) mat%matsulu%options%PrintStat = 1 endselect case(UMFP) mat%matumfp%c_numeric = C_NULL_PTR call umfpack_di_defaults(mat%matumfp%c_control) select case(SOLV_MESS) case(NO_MESS) mat%matumfp%c_control(UMFPACK_PRL) = 1 case(PRINT_MESS:) mat%matumfp%c_control(UMFPACK_PRL) = 2 endselect call umfpack_di_report_control(mat%matumfp%c_control) case default stop 'Unknown solver type, INIT_SOLVER' endselect return endsubroutine init_solver