diff --git a/mlprec/mld_cprecset.F90 b/mlprec/mld_cprecset.F90 index 5998fb98..efe2bee9 100644 --- a/mlprec/mld_cprecset.F90 +++ b/mlprec/mld_cprecset.F90 @@ -454,6 +454,12 @@ contains else allocate(mld_c_id_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + + case (mld_diag_scale_) if (allocated(level%sm%sv)) then select type (sv => level%sm%sv) @@ -468,6 +474,11 @@ contains else allocate(mld_c_diag_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + case (mld_ilu_n_,mld_milu_n_,mld_ilu_t_) if (allocated(level%sm%sv)) then @@ -483,6 +494,12 @@ contains else allocate(mld_c_ilu_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + call level%sm%sv%set(mld_sub_solve_,val,info) + #ifdef HAVE_SLU_ case (mld_slu_) if (allocated(level%sm%sv)) then @@ -498,16 +515,16 @@ contains else allocate(mld_c_slu_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if #endif case default ! ! Do nothing and hope for the best :) ! end select - if (allocated(level%sm)) then - if (allocated(level%sm%sv)) & - & call level%sm%sv%default() - end if end subroutine onelev_set_solver diff --git a/mlprec/mld_dprecset.F90 b/mlprec/mld_dprecset.F90 index 909412ea..48cb8796 100644 --- a/mlprec/mld_dprecset.F90 +++ b/mlprec/mld_dprecset.F90 @@ -461,6 +461,12 @@ contains else allocate(mld_d_id_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + + case (mld_diag_scale_) if (allocated(level%sm%sv)) then select type (sv => level%sm%sv) @@ -475,13 +481,18 @@ contains else allocate(mld_d_diag_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + case (mld_ilu_n_,mld_milu_n_,mld_ilu_t_) if (allocated(level%sm%sv)) then select type (sv => level%sm%sv) - class is (mld_d_ilu_solver_type) - ! do nothing - class default + class is (mld_d_ilu_solver_type) + ! do nothing + class default call level%sm%sv%free(info) if (info == 0) deallocate(level%sm%sv) if (info == 0) allocate(mld_d_ilu_solver_type ::& @@ -490,6 +501,12 @@ contains else allocate(mld_d_ilu_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + call level%sm%sv%set(mld_sub_solve_,val,info) + #ifdef HAVE_UMF_ case (mld_umf_) if (allocated(level%sm%sv)) then @@ -505,6 +522,10 @@ contains else allocate(mld_d_umf_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if #endif #ifdef HAVE_SLU_ case (mld_slu_) @@ -521,16 +542,16 @@ contains else allocate(mld_d_slu_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if #endif case default ! ! Do nothing and hope for the best :) ! end select - if (allocated(level%sm)) then - if (allocated(level%sm%sv)) & - & call level%sm%sv%default() - end if end subroutine onelev_set_solver diff --git a/mlprec/mld_sprecset.F90 b/mlprec/mld_sprecset.F90 index 221648e3..a340548c 100644 --- a/mlprec/mld_sprecset.F90 +++ b/mlprec/mld_sprecset.F90 @@ -455,6 +455,12 @@ contains else allocate(mld_s_id_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + + case (mld_diag_scale_) if (allocated(level%sm%sv)) then select type (sv => level%sm%sv) @@ -469,6 +475,11 @@ contains else allocate(mld_s_diag_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + case (mld_ilu_n_,mld_milu_n_,mld_ilu_t_) if (allocated(level%sm%sv)) then @@ -484,6 +495,12 @@ contains else allocate(mld_s_ilu_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + call level%sm%sv%set(mld_sub_solve_,val,info) + #ifdef HAVE_SLU_ case (mld_slu_) if (allocated(level%sm%sv)) then @@ -499,16 +516,16 @@ contains else allocate(mld_s_slu_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if #endif case default ! ! Do nothing and hope for the best :) ! end select - if (allocated(level%sm)) then - if (allocated(level%sm%sv)) & - & call level%sm%sv%default() - end if end subroutine onelev_set_solver diff --git a/mlprec/mld_zprecset.F90 b/mlprec/mld_zprecset.F90 index e5026b54..81d14a6c 100644 --- a/mlprec/mld_zprecset.F90 +++ b/mlprec/mld_zprecset.F90 @@ -462,6 +462,12 @@ contains else allocate(mld_z_id_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + + case (mld_diag_scale_) if (allocated(level%sm%sv)) then select type (sv => level%sm%sv) @@ -476,7 +482,12 @@ contains else allocate(mld_z_diag_solver_type :: level%sm%sv, stat=info) endif - + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + + case (mld_ilu_n_,mld_milu_n_,mld_ilu_t_) if (allocated(level%sm%sv)) then select type (sv => level%sm%sv) @@ -491,6 +502,12 @@ contains else allocate(mld_z_ilu_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if + call level%sm%sv%set(mld_sub_solve_,val,info) + #ifdef HAVE_UMF_ case (mld_umf_) if (allocated(level%sm%sv)) then @@ -506,6 +523,10 @@ contains else allocate(mld_z_umf_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if #endif #ifdef HAVE_SLU_ case (mld_slu_) @@ -522,16 +543,16 @@ contains else allocate(mld_z_slu_solver_type :: level%sm%sv, stat=info) endif + if (allocated(level%sm)) then + if (allocated(level%sm%sv)) & + & call level%sm%sv%default() + end if #endif case default ! ! Do nothing and hope for the best :) ! end select - if (allocated(level%sm)) then - if (allocated(level%sm%sv)) & - & call level%sm%sv%default() - end if end subroutine onelev_set_solver