NAG Library Manual, Mark 28.4
Program f11db_p0w_fe

!     F11DB_P0W_F Example Program Text

!     Mark 28.4 Release. NAG Copyright 2022.

!     .. Use Statements ..
Use iso_c_binding, Only: c_ptr
Use nag_library, Only: nag_wp
!     .. Implicit None Statement ..
Implicit None
!     .. Parameters ..
Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
Real (Kind=nag_wp)               :: dtol
Integer                          :: i, ifail, la, lfill, liwork, n, nnz, &
nnzc, npivm
Character (1)                    :: check, milu, pstrat, trans
!     .. Local Arrays ..
Real (Kind=nag_wp), Allocatable  :: a(:), x(:), y(:)
Integer, Allocatable             :: icol(:), idiag(:), ipivp(:),         &
ipivq(:), irow(:), istr(:), iwork(:)
!     .. Executable Statements ..
Write (nout,*) 'F11DB_P0W_F Example Program Results'
Write (nout,*)

!     Skip heading in data file

!     Read order of matrix and number of nonzero entries
la = 2*nnz
liwork = 7*n + 2
Allocate (a(la),x(n),y(n),icol(la),idiag(n),ipivp(n),ipivq(n),irow(la),  &
istr(n+1),iwork(liwork))

Do i = 1, nnz
End Do

lfill = -1
dtol = 0.E0_nag_wp
pstrat = 'C'
milu = 'N'

ifail = 0
ipivp,ipivq,istr,idiag,nnzc,npivm,iwork,liwork,ifail)

!     Check value of npivm
If (npivm>0) Then
Write (nout,*) 'Factorization is not complete'
Else

!       Solve P L D U x = y
trans = 'N'
check = 'C'

ifail = 0