subroutine pf_init_sdcmats(SDCmats,qtype,nnodes,nnodes0,nflags)
type(pf_sdcmats_t), intent(inout) :: SDCmats
integer, intent(in) :: nnodes,nnodes0
integer, intent(in) :: qtype
integer, intent(inout) :: nflags(nnodes)
integer :: ierr
allocate(SDCmats%qmat(nnodes-1,nnodes),stat=ierr)
if (ierr /= 0) stop "allocate error qmat"
allocate(SDCmats%qmatFE(nnodes-1,nnodes),stat=ierr)
if (ierr /= 0) stop "allocate error qmatFE"
allocate(SDCmats%qmatBE(nnodes-1,nnodes),stat=ierr)
if (ierr /= 0) stop "allocate error qmatBE"
allocate(SDCmats%qmatLU(nnodes-1,nnodes),stat=ierr)
if (ierr /= 0) stop "allocate error qmatLU"
allocate(SDCmats%s0mat(nnodes-1,nnodes),stat=ierr)
if (ierr /= 0) stop "allocate error s0mat"
allocate(SDCmats%qnodes(nnodes),stat=ierr)
if (ierr /= 0) stop "allocate error qnodes"
call pf_quadrature(qtype, nnodes, nnodes0, &
SDCmats%qnodes, nflags, SDCmats%s0mat, SDCmats%qmat,SDCmats%qmatFE,SDCmats%qmatBE)
call myLUq(SDCmats%qmat,SDCmats%qmatLU,nnodes,0)
end subroutine pf_init_sdcmats