diff --git a/Makefile b/Makefile index 6f9d87e..7a83732 100644 --- a/Makefile +++ b/Makefile @@ -94,7 +94,6 @@ OBJS := $(SRCDIR)/Binary_Tree.o \ $(SRCDIR)/Gmres_Poly_Data_Type.o \ $(SRCDIR)/AIR_Data_Type.o \ $(SRCDIR)/Matshell_Data_Type.o \ - $(SRCDIR)/Matshell_PFLARE.o \ $(SRCDIR)/Sorting.o \ $(SRCDIR)/C_PETSc_Interfaces.o \ $(SRCDIR)/PCPFLAREINV_Interfaces.o \ diff --git a/Makefile.deps b/Makefile.deps index ca67653..5c24e9f 100644 --- a/Makefile.deps +++ b/Makefile.deps @@ -4,21 +4,20 @@ src/AIR_Data_Type_Routines.o : src/AIR_Data_Type_Routines.F90 src/FC_Smooth.o sr src/AIR_MG_Setup.o : src/AIR_MG_Setup.F90 src/AIR_Operators_Setup.o src/Grid_Transfer.o src/C_PETSc_Interfaces.o src/FC_Smooth.o src/AIR_MG_Stats.o src/Timers.o src/Approx_Inverse_Setup.o src/Matshell_Data_Type.o src/CF_Splitting.o src/Constrain_Z_or_W.o src/AIR_MG_Stats.o : src/AIR_MG_Stats.F90 src/Gmres_Poly.o src/AIR_Data_Type.o src/PETSc_Helper.o src/AIR_Operators_Setup.o : src/AIR_Operators_Setup.F90 src/Grid_Transfer_Improve.o src/Grid_Transfer.o src/C_PETSc_Interfaces.o src/FC_Smooth.o src/Timers.o src/Approx_Inverse_Setup.o src/Constrain_Z_or_W.o -src/Approx_Inverse_Setup.o : src/Approx_Inverse_Setup.F90 src/Matshell_PFLARE.o src/Repartition.o src/SAI_Z.o src/Weighted_Jacobi.o src/Neumann_Poly.o src/Gmres_Poly_Newton.o src/Gmres_Poly.o +src/Approx_Inverse_Setup.o : src/Approx_Inverse_Setup.F90 src/Matshell_Data_Type.o src/Repartition.o src/SAI_Z.o src/Weighted_Jacobi.o src/Neumann_Poly.o src/Gmres_Poly_Newton.o src/Gmres_Poly.o src/Binary_Tree.o : src/Binary_Tree.F90 src/C_Fortran_Bindings.o : src/C_Fortran_Bindings.F90 src/AIR_Data_Type_Routines.o src/PFLARE.o src/PCAIR_Shell.o src/AIR_MG_Setup.o src/CF_Splitting.o : src/CF_Splitting.F90 src/PETSc_Helper.o src/Aggregation.o src/PMISR_DDC.o src/Constrain_Z_or_W.o : src/Constrain_Z_or_W.F90 src/PETSc_Helper.o src/C_PETSc_Interfaces.o src/C_PETSc_Interfaces.o : src/C_PETSc_Interfaces.F90 -src/FC_Smooth.o : src/FC_Smooth.F90 src/Matshell_PFLARE.o src/PETSc_Helper.o src/AIR_Data_Type.o src/C_PETSc_Interfaces.o +src/FC_Smooth.o : src/FC_Smooth.F90 src/Matshell_Data_Type.o src/PETSc_Helper.o src/AIR_Data_Type.o src/C_PETSc_Interfaces.o src/Gmres_Poly_Data_Type.o : src/Gmres_Poly_Data_Type.F90 src/TSQR.o -src/Gmres_Poly.o : src/Gmres_Poly.F90 src/PETSc_Helper.o src/Gmres_Poly_Data_Type.o src/TSQR.o src/Matshell_PFLARE.o src/C_PETSc_Interfaces.o src/Sorting.o +src/Gmres_Poly.o : src/Gmres_Poly.F90 src/PETSc_Helper.o src/Gmres_Poly_Data_Type.o src/TSQR.o src/Matshell_Data_Type.o src/C_PETSc_Interfaces.o src/Sorting.o src/Gmres_Poly_Newton.o : src/Gmres_Poly_Newton.F90 src/C_PETSc_Interfaces.o src/Gmres_Poly.o src/Grid_Transfer.o : src/Grid_Transfer.F90 src/PETSc_Helper.o src/C_PETSc_Interfaces.o src/Grid_Transfer_Improve.o : src/Grid_Transfer_Improve.F90 src/PETSc_Helper.o src/Timers.o src/Matshell_Data_Type.o : src/Matshell_Data_Type.F90 src/AIR_Data_Type.o -src/Matshell_PFLARE.o : src/Matshell_PFLARE.F90 src/Matshell_Data_Type.o -src/Neumann_Poly.o : src/Neumann_Poly.F90 src/C_PETSc_Interfaces.o src/Matshell_PFLARE.o src/Gmres_Poly.o +src/Neumann_Poly.o : src/Neumann_Poly.F90 src/C_PETSc_Interfaces.o src/Gmres_Poly.o src/PCAIR_C_Fortran_Bindings.o : src/PCAIR_C_Fortran_Bindings.F90 src/PCAIR_Interfaces.o src/PCAIR_Data_Type.o : src/PCAIR_Data_Type.F90 src/AIR_Data_Type.o src/PCAIR_Interfaces.o : src/PCAIR_Interfaces.F90 src/PCAIR_Shell.o diff --git a/src/AIR_MG_Setup.F90 b/src/AIR_MG_Setup.F90 index 3ddc2cb..180d0f0 100644 --- a/src/AIR_MG_Setup.F90 +++ b/src/AIR_MG_Setup.F90 @@ -52,7 +52,7 @@ subroutine setup_air_pcmg(amat, pmat, air_data, pcmg_input) type(tPC) :: pc_smoother_up, pc_smoother_down, pc_coarse_solver type(tVec) :: temp_coarse_vec, rand_vec, sol_vec, temp_vec, diag_vec, diag_vec_aff type(tIS) :: is_unchanged, is_full, temp_is - type(mat_ctxtype), pointer :: mat_ctx + type(mat_ctxtype), pointer :: mat_ctx => null() PetscInt, parameter :: one=1, zero=0 type(tVec), dimension(:), allocatable :: left_null_vecs, right_null_vecs type(tVec), dimension(:), allocatable :: left_null_vecs_c, right_null_vecs_c diff --git a/src/Approx_Inverse_Setup.F90 b/src/Approx_Inverse_Setup.F90 index 54541ca..35559ca 100644 --- a/src/Approx_Inverse_Setup.F90 +++ b/src/Approx_Inverse_Setup.F90 @@ -7,7 +7,7 @@ module approx_inverse_setup use weighted_jacobi use sai_z use repartition - use matshell_pflare + use matshell_data_type #include "petsc/finclude/petscmat.h" @@ -368,7 +368,7 @@ subroutine reset_inverse_mat(matrix) PetscErrorCode :: ierr MatType:: mat_type - type(mat_ctxtype), pointer :: mat_ctx, mat_ctx_ida + type(mat_ctxtype), pointer :: mat_ctx=>null(), mat_ctx_ida=>null() ! ~~~~~~ if (.NOT. PetscObjectIsNull(matrix)) then diff --git a/src/FC_Smooth.F90 b/src/FC_Smooth.F90 index e60e8ad..058de42 100644 --- a/src/FC_Smooth.F90 +++ b/src/FC_Smooth.F90 @@ -4,7 +4,7 @@ module fc_smooth use c_petsc_interfaces use air_data_type use petsc_helper - use matshell_pflare + use matshell_data_type #include "petsc/finclude/petscksp.h" #include "petscconf.h" @@ -405,7 +405,7 @@ subroutine mg_FC_point_richardson(pc, b, x, r, rtol, abstol, dtol, maxits, guess type(tMat) :: mat, pmat integer :: our_level, errorcode, i, smooth_its - type(mat_ctxtype), pointer :: mat_ctx + type(mat_ctxtype), pointer :: mat_ctx=>null() type(air_multigrid_data), pointer :: air_data PetscBool :: first_smooth diff --git a/src/Gmres_Poly.F90 b/src/Gmres_Poly.F90 index b5d88d4..552f77a 100644 --- a/src/Gmres_Poly.F90 +++ b/src/Gmres_Poly.F90 @@ -3,7 +3,7 @@ module gmres_poly use petscmat use sorting use c_petsc_interfaces - use matshell_pflare + use matshell_data_type use tsqr use gmres_poly_data_type use petsc_helper @@ -1410,7 +1410,7 @@ subroutine build_gmres_polynomial_inverse(matrix, poly_order, buffers, coefficie PetscErrorCode :: ierr MPIU_Comm :: MPI_COMM_MATRIX type(tMat) :: mat_power, temp_mat - type(mat_ctxtype), pointer :: mat_ctx + type(mat_ctxtype), pointer :: mat_ctx=>null() logical :: reuse_triggered ! ~~~~~~ diff --git a/src/Gmres_Poly_Newton.F90 b/src/Gmres_Poly_Newton.F90 index 94d0b78..87e5f8d 100644 --- a/src/Gmres_Poly_Newton.F90 +++ b/src/Gmres_Poly_Newton.F90 @@ -691,7 +691,7 @@ subroutine build_gmres_polynomial_newton_inverse(matrix, poly_order, & integer :: comm_size, errorcode PetscErrorCode :: ierr MPIU_Comm :: MPI_COMM_MATRIX - type(mat_ctxtype), pointer :: mat_ctx + type(mat_ctxtype), pointer :: mat_ctx=>null() ! ~~~~~~ diff --git a/src/Matshell_PFLARE.F90 b/src/Matshell_PFLARE.F90 deleted file mode 100644 index c6d48df..0000000 --- a/src/Matshell_PFLARE.F90 +++ /dev/null @@ -1,37 +0,0 @@ -module matshell_pflare - - use petscmat - use matshell_data_type - -#include "petsc/finclude/petscmat.h" - - implicit none - - public - - ! You have to provide this to get the context type correct for PETSc - interface MatShellGetContext - subroutine MatShellGetContext(mat,ctx,ierr) - use petsc - use matshell_data_type - type(tMat) :: mat - type(mat_ctxtype), pointer :: ctx - PetscErrorCode :: ierr - end subroutine MatShellGetContext - end interface MatShellGetContext - - interface MatCreateShell - subroutine MatCreateShell(comm,mloc,nloc,m,n,ctx,mat,ierr) - use petsc - use matshell_data_type - MPIU_Comm :: comm - PetscInt :: mloc,nloc,m,n - type(mat_ctxtype) :: ctx - type(tMat) :: mat - PetscErrorCode :: ierr - end subroutine MatCreateShell - end interface MatCreateShell - - contains - -end module matshell_pflare diff --git a/src/Neumann_Poly.F90 b/src/Neumann_Poly.F90 index 8c592e8..9da72e1 100644 --- a/src/Neumann_Poly.F90 +++ b/src/Neumann_Poly.F90 @@ -2,7 +2,6 @@ module neumann_poly use petscmat use gmres_poly - use matshell_pflare use c_petsc_interfaces #include "petsc/finclude/petscmat.h" @@ -127,7 +126,7 @@ subroutine calculate_and_build_neumann_polynomial_inverse(matrix, poly_order, & PetscInt :: local_rows, local_cols, global_rows, global_cols type(tMat) :: temp_mat type(tVec) :: rhs_copy, diag_vec - type(mat_ctxtype), pointer :: mat_ctx, mat_ctx_ida + type(mat_ctxtype), pointer :: mat_ctx=>null(), mat_ctx_ida=>null() ! ~~~~~~ diff --git a/src/PCAIR_C_Fortran_Bindings.F90 b/src/PCAIR_C_Fortran_Bindings.F90 index 8051c89..9dcc612 100644 --- a/src/PCAIR_C_Fortran_Bindings.F90 +++ b/src/PCAIR_C_Fortran_Bindings.F90 @@ -831,7 +831,7 @@ subroutine PCAIRGetPolyCoeffs_c(pc_ptr, petsc_level, which_inverse, & integer :: our_level, errorcode integer(PFLARE_PETSCINT_C_KIND) :: num_levels type(tPC) :: pc_shell - type(pc_air_multigrid_data), pointer :: pc_air_data + type(pc_air_multigrid_data), pointer :: pc_air_data=>null() ! ~~~~~~~~ @@ -1751,7 +1751,7 @@ subroutine PCAIRSetPolyCoeffs_c(pc_ptr, petsc_level, which_inverse, & integer :: our_level, errorcode integer(PFLARE_PETSCINT_C_KIND) :: num_levels, i_loc, j_loc type(tPC) :: pc_shell - type(pc_air_multigrid_data), pointer :: pc_air_data + type(pc_air_multigrid_data), pointer :: pc_air_data=>null() real(PFLARE_PETSCREAL_C_KIND), pointer :: coeffs_c(:,:) ! ~~~~~~~~ diff --git a/src/PCAIR_Interfaces.F90 b/src/PCAIR_Interfaces.F90 index e32498c..c828059 100644 --- a/src/PCAIR_Interfaces.F90 +++ b/src/PCAIR_Interfaces.F90 @@ -80,7 +80,7 @@ subroutine PCAIRGetOptions(pc, options) type(air_options), pointer, intent(inout) :: options type(tPC) :: pc_shell - type(pc_air_multigrid_data), pointer :: pc_air_data + type(pc_air_multigrid_data), pointer :: pc_air_data=>null() PetscErrorCode :: ierr ! ~~~~~~~~ @@ -201,7 +201,7 @@ subroutine PCAIRGetNumLevels(pc, num_levels, ierr) PetscErrorCode, intent(out) :: ierr type(tPC) :: pc_shell - type(pc_air_multigrid_data), pointer :: pc_air_data + type(pc_air_multigrid_data), pointer :: pc_air_data=>null() ! ~~~~~~~~ ! Get the underlying PCShell @@ -231,7 +231,7 @@ subroutine PCAIRGetPolyCoeffs(pc, petsc_level, which_inverse, coeffs, ierr) PetscErrorCode, intent(out) :: ierr type(tPC) :: pc_shell - type(pc_air_multigrid_data), pointer :: pc_air_data + type(pc_air_multigrid_data), pointer :: pc_air_data=>null() PetscInt :: num_levels integer :: our_level, errorcode ! ~~~~~~~~ @@ -349,7 +349,7 @@ subroutine PCAIRSetPolyCoeffs(pc, petsc_level, which_inverse, coeffs, ierr) PetscErrorCode, intent(out) :: ierr type(tPC) :: pc_shell - type(pc_air_multigrid_data), pointer :: pc_air_data + type(pc_air_multigrid_data), pointer :: pc_air_data=>null() PetscInt :: num_levels integer :: our_level, errorcode ! ~~~~~~~~ diff --git a/src/PCAIR_Shell.F90 b/src/PCAIR_Shell.F90 index 73786b2..be5c20b 100644 --- a/src/PCAIR_Shell.F90 +++ b/src/PCAIR_Shell.F90 @@ -11,28 +11,6 @@ module pcair_shell implicit none public - - ! You have to provide this to get the context type correct for PETSc - interface PCShellGetContext - subroutine PCShellGetContext(pc,pc_air_data,ierr) - use petsc - use pcair_data_type - type(tPC) :: pc - type(pc_air_multigrid_data), pointer :: pc_air_data - PetscErrorCode :: ierr - end subroutine PCShellGetContext - end interface PCShellGetContext - - interface PCShellSetContext - subroutine PCShellSetContext(pc,pc_air_data,ierr) - use petsc - use pcair_data_type - type(tPC) :: pc - type(pc_air_multigrid_data) :: pc_air_data - PetscErrorCode :: ierr - end subroutine PCShellSetContext - end interface PCShellSetContext - contains ! ------------------------------------------------------------------------------------------------------------------------------- @@ -135,7 +113,7 @@ subroutine PCSetUp_AIR_Shell(pc, ierr) PetscErrorCode, intent(inout) :: ierr type(tMat) :: amat, pmat - type(pc_air_multigrid_data), pointer :: pc_air_data + type(pc_air_multigrid_data), pointer :: pc_air_data=>null() integer :: structure_flag PetscInt :: setupcalled @@ -198,7 +176,7 @@ subroutine PCApply_AIR_Shell(pc, x, y, ierr) type(tVec), intent(in) :: x, y PetscErrorCode, intent(inout) :: ierr - type(pc_air_multigrid_data), pointer :: pc_air_data + type(pc_air_multigrid_data), pointer :: pc_air_data=>null() ! ~~~~~~ @@ -219,7 +197,7 @@ subroutine PCDestroy_AIR_Shell(pc, ierr) type(tPC), intent(in) :: pc PetscErrorCode, intent(inout) :: ierr - type(pc_air_multigrid_data), pointer :: pc_air_data + type(pc_air_multigrid_data), pointer :: pc_air_data=>null() ! ~~~~~~ @@ -242,7 +220,7 @@ subroutine PCReset_AIR_Shell(pc, ierr) type(tPC), intent(in) :: pc PetscErrorCode, intent(inout) :: ierr - type(pc_air_multigrid_data), pointer :: pc_air_data + type(pc_air_multigrid_data), pointer :: pc_air_data=>null() ! ~~~~~~ @@ -264,7 +242,7 @@ subroutine PCView_AIR_Shell(pc, viewer, ierr) type(tPetscViewer), intent(in) :: viewer PetscErrorCode, intent(inout) :: ierr - type(pc_air_multigrid_data), pointer :: pc_air_data + type(pc_air_multigrid_data), pointer :: pc_air_data=>null() ! ~~~~~~