@ -360,91 +360,123 @@ subroutine mld_dprecseti(p,what,val,info,ilev,pos)
contains
contains
subroutine onelev_set_smoother ( level , val , info , pos )
subroutine onelev_set_smoother ( level , val , info , pos )
type ( mld_d_onelev_type ) , intent ( inout ) :: level
class ( mld_d_onelev_type ) , intent ( inout ) :: level
integer ( psb_ipk_ ) , intent ( in ) :: val
integer ( psb_ipk_ ) , intent ( in ) :: val
integer ( psb_ipk_ ) , intent ( out ) :: info
integer ( psb_ipk_ ) , intent ( out ) :: info
character ( len = * ) , optional , intent ( in ) :: pos
character ( len = * ) , optional , intent ( in ) :: pos
! Local
integer ( psb_ipk_ ) :: ipos_
info = psb_success_
info = psb_success_
if ( present ( pos ) ) then
select case ( psb_toupper ( trim ( pos ) ) )
case ( 'PRE' )
ipos_ = mld_pre_smooth_
case ( 'POST' )
ipos_ = mld_post_smooth_
case default
ipos_ = mld_pre_smooth_
end select
else
ipos_ = mld_pre_smooth_
end if
select case ( ipos_ )
case ( mld_pre_smooth_ )
call inner_set_smoother ( level % sm , val , info )
case ( mld_post_smooth_ )
call inner_set_smoother ( level % sm2a , val , info )
case default
! Impossible ! !
info = psb_err_internal_error_
end select
end subroutine onelev_set_smoother
subroutine inner_set_smoother ( sm , val , info )
class ( mld_d_base_smoother_type ) , allocatable , intent ( inout ) :: sm
integer ( psb_ipk_ ) , intent ( in ) :: val
integer ( psb_ipk_ ) , intent ( out ) :: info
!
!
! This here requires a bit more attention .
! This here requires a bit more attention .
!
!
select case ( val )
select case ( val )
case ( mld_noprec_ )
case ( mld_noprec_ )
if ( allocated ( level % sm ) ) then
if ( allocated ( sm) ) then
select type ( sm = > level % sm )
select type ( sm s = > sm )
type is ( mld_d_base_smoother_type )
type is ( mld_d_base_smoother_type )
! do nothing
! do nothing
class default
class default
call level % sm % free ( info )
call sm% free ( info )
if ( info == 0 ) deallocate ( level % sm )
if ( info == 0 ) deallocate ( sm)
if ( info == 0 ) allocate ( mld_d_base_smoother_type :: &
if ( info == 0 ) allocate ( mld_d_base_smoother_type :: &
& level % sm , stat = info )
& sm, stat = info )
if ( info == 0 ) allocate ( mld_d_id_solver_type :: &
if ( info == 0 ) allocate ( mld_d_id_solver_type :: &
& level % sm % sv , stat = info )
& sm% sv , stat = info )
end select
end select
else
else
allocate ( mld_d_base_smoother_type :: &
allocate ( mld_d_base_smoother_type :: &
& level % sm , stat = info )
& sm, stat = info )
if ( info == 0 ) allocate ( mld_d_id_solver_type :: &
if ( info == 0 ) allocate ( mld_d_id_solver_type :: &
& level % sm % sv , stat = info )
& sm% sv , stat = info )
endif
endif
case ( mld_jac_ )
case ( mld_jac_ )
if ( allocated ( level % sm ) ) then
if ( allocated ( sm) ) then
select type ( sm = > level % sm )
select type ( sm s = > sm )
class is ( mld_d_jac_smoother_type )
class is ( mld_d_jac_smoother_type )
! do nothing
! do nothing
class default
class default
call level% sm% free ( info )
call sm% free ( info )
if ( info == 0 ) deallocate ( level% sm)
if ( info == 0 ) deallocate ( sm)
if ( info == 0 ) allocate ( mld_d_jac_smoother_type :: &
if ( info == 0 ) allocate ( mld_d_jac_smoother_type :: &
& level% sm, stat = info )
& sm, stat = info )
if ( info == 0 ) allocate ( mld_d_diag_solver_type :: &
if ( info == 0 ) allocate ( mld_d_diag_solver_type :: &
& level% sm% sv , stat = info )
& sm% sv , stat = info )
end select
end select
else
else
allocate ( mld_d_jac_smoother_type :: level% sm, stat = info )
allocate ( mld_d_jac_smoother_type :: sm, stat = info )
if ( info == 0 ) allocate ( mld_d_diag_solver_type :: &
if ( info == 0 ) allocate ( mld_d_diag_solver_type :: &
& level% sm% sv , stat = info )
& sm% sv , stat = info )
endif
endif
case ( mld_bjac_ )
case ( mld_bjac_ )
if ( allocated ( level% sm) ) then
if ( allocated ( sm) ) then
select type ( sm = > level % sm )
select type ( sm s = > sm )
class is ( mld_d_jac_smoother_type )
class is ( mld_d_jac_smoother_type )
! do nothing
! do nothing
class default
class default
call level% sm% free ( info )
call sm% free ( info )
if ( info == 0 ) deallocate ( level% sm)
if ( info == 0 ) deallocate ( sm)
if ( info == 0 ) allocate ( mld_d_jac_smoother_type :: &
if ( info == 0 ) allocate ( mld_d_jac_smoother_type :: &
& level% sm, stat = info )
& sm, stat = info )
if ( info == 0 ) allocate ( mld_d_ilu_solver_type :: &
if ( info == 0 ) allocate ( mld_d_ilu_solver_type :: &
& level% sm% sv , stat = info )
& sm% sv , stat = info )
end select
end select
else
else
allocate ( mld_d_jac_smoother_type :: level% sm, stat = info )
allocate ( mld_d_jac_smoother_type :: sm, stat = info )
if ( info == 0 ) allocate ( mld_d_ilu_solver_type :: &
if ( info == 0 ) allocate ( mld_d_ilu_solver_type :: &
& level% sm% sv , stat = info )
& sm% sv , stat = info )
endif
endif
case ( mld_as_ )
case ( mld_as_ )
if ( allocated ( level% sm) ) then
if ( allocated ( sm) ) then
select type ( sm = > level % sm )
select type ( sm s = > sm )
class is ( mld_d_as_smoother_type )
class is ( mld_d_as_smoother_type )
! do nothing
! do nothing
class default
class default
call level% sm% free ( info )
call sm% free ( info )
if ( info == 0 ) deallocate ( level% sm)
if ( info == 0 ) deallocate ( sm)
if ( info == 0 ) allocate ( mld_d_as_smoother_type :: &
if ( info == 0 ) allocate ( mld_d_as_smoother_type :: &
& level% sm, stat = info )
& sm, stat = info )
if ( info == 0 ) allocate ( mld_d_ilu_solver_type :: &
if ( info == 0 ) allocate ( mld_d_ilu_solver_type :: &
& level% sm% sv , stat = info )
& sm% sv , stat = info )
end select
end select
else
else
allocate ( mld_d_as_smoother_type :: level% sm, stat = info )
allocate ( mld_d_as_smoother_type :: sm, stat = info )
if ( info == 0 ) allocate ( mld_d_ilu_solver_type :: &
if ( info == 0 ) allocate ( mld_d_ilu_solver_type :: &
& level% sm% sv , stat = info )
& sm% sv , stat = info )
endif
endif
case default
case default
@ -452,65 +484,96 @@ contains
! Do nothing and hope for the best : )
! Do nothing and hope for the best : )
!
!
end select
end select
if ( allocated ( level % sm ) ) &
if ( allocated ( sm ) ) &
& call level % sm % default ( )
& call sm % default ( )
end subroutine inner_set_smoother
end subroutine onelev_set_smoother
subroutine onelev_set_solver ( level , val , info , pos )
subroutine onelev_set_solver ( level , val , info , pos )
type ( mld_d_onelev_type ) , intent ( inout ) :: level
class ( mld_d_onelev_type ) , intent ( inout ) :: level
integer ( psb_ipk_ ) , intent ( in ) :: val
integer ( psb_ipk_ ) , intent ( in ) :: val
integer ( psb_ipk_ ) , intent ( out ) :: info
integer ( psb_ipk_ ) , intent ( out ) :: info
character ( len = * ) , optional , intent ( in ) :: pos
character ( len = * ) , optional , intent ( in ) :: pos
! Local
integer ( psb_ipk_ ) :: ipos_
info = psb_success_
info = psb_success_
if ( present ( pos ) ) then
select case ( psb_toupper ( trim ( pos ) ) )
case ( 'PRE' )
ipos_ = mld_pre_smooth_
case ( 'POST' )
ipos_ = mld_post_smooth_
case default
ipos_ = mld_pre_smooth_
end select
else
ipos_ = mld_pre_smooth_
end if
select case ( ipos_ )
case ( mld_pre_smooth_ )
call inner_set_solver ( level % sm , val , info )
case ( mld_post_smooth_ )
call inner_set_solver ( level % sm2a , val , info )
case default
! Impossible ! !
info = psb_err_internal_error_
end select
end subroutine onelev_set_solver
subroutine inner_set_solver ( sm , val , info )
class ( mld_d_base_smoother_type ) , allocatable , intent ( inout ) :: sm
integer ( psb_ipk_ ) , intent ( in ) :: val
integer ( psb_ipk_ ) , intent ( out ) :: info
!
!
! This here requires a bit more attention .
! Yes , the first argument is a smoother , to catch the case where
! user is trying to set a solver on a not - yet - allocated smoother .
!
!
select case ( val )
select case ( val )
case ( mld_f_none_ )
case ( mld_f_none_ )
if ( allocated ( level % sm ) ) then
if ( allocated ( sm) ) then
if ( allocated ( level % sm % sv ) ) then
if ( allocated ( sm% sv ) ) then
select type ( sv = > level % sm % sv )
select type ( sv = > sm% sv )
class is ( mld_d_id_solver_type )
class is ( mld_d_id_solver_type )
! do nothing
! do nothing
class default
class default
call level % sm % sv % free ( info )
call sm% sv % free ( info )
if ( info == 0 ) deallocate ( level % sm % sv )
if ( info == 0 ) deallocate ( sm% sv )
if ( info == 0 ) allocate ( mld_d_id_solver_type :: &
if ( info == 0 ) allocate ( mld_d_id_solver_type :: &
& level % sm % sv , stat = info )
& sm% sv , stat = info )
end select
end select
else
else
allocate ( mld_d_id_solver_type :: level% sm% sv , stat = info )
allocate ( mld_d_id_solver_type :: sm% sv , stat = info )
endif
endif
if ( allocated ( level% sm) ) then
if ( allocated ( sm) ) then
if ( allocated ( level% sm% sv ) ) &
if ( allocated ( sm% sv ) ) &
& call level% sm% sv % default ( )
& call sm% sv % default ( )
end if
end if
else
else
write ( 0 , * ) 'Calling set_solver without a smoother?'
write ( 0 , * ) 'Calling set_solver without a smoother?'
info = - 5
info = - 5
end if
end if
case ( mld_diag_scale_ )
case ( mld_diag_scale_ )
if ( allocated ( level% sm) ) then
if ( allocated ( sm) ) then
if ( allocated ( level% sm% sv ) ) then
if ( allocated ( sm% sv ) ) then
select type ( sv = > level% sm% sv )
select type ( sv = > sm% sv )
class is ( mld_d_diag_solver_type )
class is ( mld_d_diag_solver_type )
! do nothing
! do nothing
class default
class default
call level% sm% sv % free ( info )
call sm% sv % free ( info )
if ( info == 0 ) deallocate ( level% sm% sv )
if ( info == 0 ) deallocate ( sm% sv )
if ( info == 0 ) allocate ( mld_d_diag_solver_type :: &
if ( info == 0 ) allocate ( mld_d_diag_solver_type :: &
& level% sm% sv , stat = info )
& sm% sv , stat = info )
end select
end select
else
else
allocate ( mld_d_diag_solver_type :: level% sm% sv , stat = info )
allocate ( mld_d_diag_solver_type :: sm% sv , stat = info )
endif
endif
if ( allocated ( level% sm) ) then
if ( allocated ( sm) ) then
if ( allocated ( level% sm% sv ) ) &
if ( allocated ( sm% sv ) ) &
& call level% sm% sv % default ( )
& call sm% sv % default ( )
end if
end if
else
else
write ( 0 , * ) 'Calling set_solver without a smoother?'
write ( 0 , * ) 'Calling set_solver without a smoother?'
@ -518,22 +581,23 @@ contains
end if
end if
case ( mld_gs_ )
case ( mld_gs_ )
if ( allocated ( level% sm) ) then
if ( allocated ( sm) ) then
if ( allocated ( level% sm% sv ) ) then
if ( allocated ( sm% sv ) ) then
select type ( sv = > level% sm% sv )
select type ( sv = > sm% sv )
class is ( mld_d_gs_solver_type )
class is ( mld_d_gs_solver_type )
! do nothing
! do nothing
class default
class default
call level% sm% sv % free ( info )
call sm% sv % free ( info )
if ( info == 0 ) deallocate ( level% sm% sv )
if ( info == 0 ) deallocate ( sm% sv )
if ( info == 0 ) allocate ( mld_d_gs_solver_type :: &
if ( info == 0 ) allocate ( mld_d_gs_solver_type :: &
& level% sm% sv , stat = info )
& sm% sv , stat = info )
end select
end select
else
else
allocate ( mld_d_gs_solver_type :: level% sm% sv , stat = info )
allocate ( mld_d_gs_solver_type :: sm% sv , stat = info )
endif
endif
if ( allocated ( level % sm % sv ) ) then
if ( allocated ( sm % sv ) ) then
call level % sm % sv % default ( )
call sm % sv % default ( )
else
endif
endif
else
else
@ -542,123 +606,124 @@ contains
end if
end if
case ( mld_ilu_n_ , mld_milu_n_ , mld_ilu_t_ )
case ( mld_ilu_n_ , mld_milu_n_ , mld_ilu_t_ )
if ( allocated ( level% sm) ) then
if ( allocated ( sm) ) then
if ( allocated ( level% sm% sv ) ) then
if ( allocated ( sm% sv ) ) then
select type ( sv = > level% sm% sv )
select type ( sv = > sm% sv )
class is ( mld_d_ilu_solver_type )
class is ( mld_d_ilu_solver_type )
! do nothing
! do nothing
class default
class default
call level% sm% sv % free ( info )
call sm% sv % free ( info )
if ( info == 0 ) deallocate ( level% sm% sv )
if ( info == 0 ) deallocate ( sm% sv )
if ( info == 0 ) allocate ( mld_d_ilu_solver_type :: &
if ( info == 0 ) allocate ( mld_d_ilu_solver_type :: &
& level% sm% sv , stat = info )
& sm% sv , stat = info )
end select
end select
else
else
allocate ( mld_d_ilu_solver_type :: level% sm% sv , stat = info )
allocate ( mld_d_ilu_solver_type :: sm% sv , stat = info )
endif
endif
if ( allocated ( level% sm) ) then
if ( allocated ( sm) ) then
if ( allocated ( level% sm% sv ) ) &
if ( allocated ( sm% sv ) ) &
& call level% sm% sv % default ( )
& call sm% sv % default ( )
end if
end if
call level% sm% sv % set ( mld_sub_solve_ , val , info )
call sm% sv % set ( 'SUB_SOLVE' , val , info )
else
else
write ( 0 , * ) 'Calling set_solver without a smoother?'
write ( 0 , * ) 'Calling set_solver without a smoother?'
info = - 5
info = - 5
end if
end if
# ifdef HAVE_UMF_
case ( mld_umf_ )
# ifdef HAVE_SLU_
if ( allocated ( level % sm ) ) then
case ( mld_slu_ )
if ( allocated ( level % sm % sv ) ) then
if ( allocated ( sm ) ) then
select type ( sv = > level % sm % sv )
if ( allocated ( sm % sv ) ) then
class is ( mld_d_umf_solver_type )
select type ( sv = > sm % sv )
class is ( mld_d_slu_solver_type )
! do nothing
! do nothing
class default
class default
call level% sm% sv % free ( info )
call sm% sv % free ( info )
if ( info == 0 ) deallocate ( level% sm% sv )
if ( info == 0 ) deallocate ( sm% sv )
if ( info == 0 ) allocate ( mld_d_ umf _solver_type :: &
if ( info == 0 ) allocate ( mld_d_ sl u_solver_type :: &
& level% sm% sv , stat = info )
& sm% sv , stat = info )
end select
end select
else
else
allocate ( mld_d_ umf _solver_type :: level % sm % sv , stat = info )
allocate ( mld_d_ sl u_solver_type :: sm % sv , stat = info )
endif
endif
if ( allocated ( level% sm) ) then
if ( allocated ( sm) ) then
if ( allocated ( level% sm% sv ) ) &
if ( allocated ( sm% sv ) ) &
& call level% sm% sv % default ( )
& call sm% sv % default ( )
end if
end if
else
else
write ( 0 , * ) 'Calling set_solver without a smoother?'
write ( 0 , * ) 'Calling set_solver without a smoother?'
info = - 5
info = - 5
end if
end if
# endif
# endif
# ifdef HAVE_SLUDIST_
# ifdef HAVE_MUMPS_
case ( mld_sludist_ )
case ( mld_mumps_ )
if ( allocated ( level % sm ) ) then
if ( allocated ( sm % sv ) ) then
if ( allocated ( level % sm % sv ) ) then
select type ( sv = > sm % sv )
select type ( sv = > level % sm % sv )
class is ( mld_d_mumps_solver_type )
class is ( mld_d_sludist_solver_type )
! do nothing
! do nothing
class default
class default
call level % sm % sv % free ( info )
call sm % sv % free ( info )
if ( info == 0 ) deallocate ( level % sm % sv )
if ( info == 0 ) deallocate ( sm % sv )
if ( info == 0 ) allocate ( mld_d_ sludist _solver_type :: &
if ( info == 0 ) allocate ( mld_d_ mumps _solver_type :: &
& level % sm % sv , stat = info )
& sm % sv , stat = info )
end select
end select
else
else
allocate ( mld_d_sludist_solver_type :: level % sm % sv , stat = info )
allocate ( mld_d_mumps_solver_type :: sm % sv , stat = info )
endif
if ( allocated ( level % sm ) ) then
if ( allocated ( level % sm % sv ) ) &
& call level % sm % sv % default ( )
endif
endif
else
if ( allocated ( sm ) ) then
write( 0 , * ) 'Calling set_solver without a smoother?'
if ( allocated ( sm % sv ) ) &
info = - 5
& call sm % sv % default ( )
end if
end if
# endif
# endif
# ifdef HAVE_SLU_
case ( mld_slu_ )
# ifdef HAVE_UMF_
if ( allocated ( level % sm ) ) then
case ( mld_umf_ )
if ( allocated ( level % sm % sv ) ) then
if ( allocated ( sm ) ) then
select type ( sv = > level % sm % sv )
if ( allocated ( sm % sv ) ) then
class is ( mld_d_slu_solver_type )
select type ( sv = > sm % sv )
class is ( mld_d_umf_solver_type )
! do nothing
! do nothing
class default
class default
call level% sm% sv % free ( info )
call sm% sv % free ( info )
if ( info == 0 ) deallocate ( level% sm% sv )
if ( info == 0 ) deallocate ( sm% sv )
if ( info == 0 ) allocate ( mld_d_ sl u_solver_type :: &
if ( info == 0 ) allocate ( mld_d_ umf _solver_type :: &
& level% sm% sv , stat = info )
& sm% sv , stat = info )
end select
end select
else
else
allocate ( mld_d_ sl u_solver_type :: level % sm % sv , stat = info )
allocate ( mld_d_ umf _solver_type :: sm % sv , stat = info )
endif
endif
if ( allocated ( level% sm) ) then
if ( allocated ( sm) ) then
if ( allocated ( level% sm% sv ) ) &
if ( allocated ( sm% sv ) ) &
& call level% sm% sv % default ( )
& call sm% sv % default ( )
end if
end if
else
else
write ( 0 , * ) 'Calling set_solver without a smoother?'
write ( 0 , * ) 'Calling set_solver without a smoother?'
info = - 5
info = - 5
end if
end if
# endif
# endif
# ifdef HAVE_MUMPS_
# ifdef HAVE_SLUDIST_
case ( mld_mumps_ )
case ( mld_sludist_ )
if ( allocated ( level % sm % sv ) ) then
if ( allocated ( sm ) ) then
select type ( sv = > level % sm % sv )
if ( allocated ( sm % sv ) ) then
class is ( mld_d_mumps_solver_type )
select type ( sv = > sm % sv )
class is ( mld_d_sludist_solver_type )
! do nothing
! do nothing
class default
class default
call level % sm % sv % free ( info )
call sm % sv % free ( info )
if ( info == 0 ) deallocate ( level % sm % sv )
if ( info == 0 ) deallocate ( sm % sv )
if ( info == 0 ) allocate ( mld_d_ mumps _solver_type :: &
if ( info == 0 ) allocate ( mld_d_ sludist _solver_type :: &
& level % sm % sv , stat = info )
& sm % sv , stat = info )
end select
end select
else
else
allocate ( mld_d_mumps_solver_type :: level % sm % sv , stat = info )
allocate ( mld_d_sludist_solver_type :: sm % sv , stat = info )
endif
endif
if ( allocated ( level % sm ) ) then
if ( allocated ( sm ) ) then
if ( allocated ( level% sm% sv ) ) then
if ( allocated ( sm% sv ) ) &
call level % sm % sv % default ( )
& call sm % sv % default ( )
end if
end if
else
write ( 0 , * ) 'Calling set_solver without a smoother?'
info = - 5
end if
end if
# endif
# endif
case default
case default
@ -666,9 +731,7 @@ contains
! Do nothing and hope for the best : )
! Do nothing and hope for the best : )
!
!
end select
end select
end subroutine inner_set_solver
end subroutine onelev_set_solver
end subroutine mld_dprecseti
end subroutine mld_dprecseti
@ -734,32 +797,35 @@ subroutine mld_dprecsetsm(p,val,info,ilev,pos)
case ( mld_pre_smooth_ )
case ( mld_pre_smooth_ )
do ilev_ = ilmin , ilmax
do ilev_ = ilmin , ilmax
if ( allocated ( p % precv ( ilev_ ) % sm ) ) then
if ( allocated ( p % precv ( ilev_ ) % sm ) ) then
if ( allocated ( p % precv ( ilev_ ) % sm % sv ) ) then
if ( . not . same_type_as ( p % precv ( ilev_ ) % sm , val ) ) then
deallocate ( p % precv ( ilev_ ) % sm % sv )
call p % precv ( ilev_ ) % sm % free ( info )
deallocate ( p % precv ( ilev_ ) % sm , stat = info )
end if
end if
deallocate ( p % precv ( ilev_ ) % sm )
endif
endif
if ( . not . allocated ( p % precv ( ilev_ ) % sm ) ) then
# ifdef HAVE_MOLD
# ifdef HAVE_MOLD
allocate ( p % precv ( ilev_ ) % sm , mold = val )
allocate ( p % precv ( ilev_ ) % sm , mold = val )
# else
# else
allocate ( p % precv ( ilev_ ) % sm , source = val )
allocate ( p % precv ( ilev_ ) % sm , source = val )
# endif
# endif
end if
call p % precv ( ilev_ ) % sm % default ( )
call p % precv ( ilev_ ) % sm % default ( )
p % precv ( ilev_ ) % sm2 = > p % precv ( ilev_ ) % sm
p % precv ( ilev_ ) % sm2 = > p % precv ( ilev_ ) % sm
end do
end do
case ( mld_post_smooth_ )
case ( mld_post_smooth_ )
do ilev_ = ilmin , ilmax
do ilev_ = ilmin , ilmax
if ( allocated ( p % precv ( ilev_ ) % sm2a ) ) then
if ( allocated ( p % precv ( ilev_ ) % sm2a ) ) then
if ( allocated ( p % precv ( ilev_ ) % sm2a % sv ) ) then
if ( . not . same_type_as ( p % precv ( ilev_ ) % sm2a , val ) ) then
deallocate ( p % precv ( ilev_ ) % sm2a % sv )
call p % precv ( ilev_ ) % sm2a % free ( info )
endif
deallocate ( p % precv ( ilev_ ) % sm2a , stat = info )
deallocate ( p % precv ( ilev_ ) % sm2a )
endif
endif
if ( . not . allocated ( p % precv ( ilev_ ) % sm2a ) ) then
# ifdef HAVE_MOLD
# ifdef HAVE_MOLD
allocate ( p % precv ( ilev_ ) % sm2a , mold = val )
allocate ( p % precv ( ilev_ ) % sm2a , mold = val )
# else
# else
allocate ( p % precv ( ilev_ ) % sm2a , source = val )
allocate ( p % precv ( ilev_ ) % sm2a , source = val )
# endif
# endif
end if
call p % precv ( ilev_ ) % sm2a % default ( )
call p % precv ( ilev_ ) % sm2a % default ( )
p % precv ( ilev_ ) % sm2 = > p % precv ( ilev_ ) % sm2a
p % precv ( ilev_ ) % sm2 = > p % precv ( ilev_ ) % sm2a
end do
end do
@ -834,6 +900,7 @@ subroutine mld_dprecsetsv(p,val,info,ilev,pos)
if ( allocated ( p % precv ( ilev_ ) % sm ) ) then
if ( allocated ( p % precv ( ilev_ ) % sm ) ) then
if ( allocated ( p % precv ( ilev_ ) % sm % sv ) ) then
if ( allocated ( p % precv ( ilev_ ) % sm % sv ) ) then
if ( . not . same_type_as ( p % precv ( ilev_ ) % sm % sv , val ) ) then
if ( . not . same_type_as ( p % precv ( ilev_ ) % sm % sv , val ) ) then
call p % precv ( ilev_ ) % sm % sv % free ( info )
deallocate ( p % precv ( ilev_ ) % sm % sv , stat = info )
deallocate ( p % precv ( ilev_ ) % sm % sv , stat = info )
if ( info / = 0 ) then
if ( info / = 0 ) then
info = 3111
info = 3111
@ -870,6 +937,7 @@ subroutine mld_dprecsetsv(p,val,info,ilev,pos)
if ( allocated ( p % precv ( ilev_ ) % sm2a ) ) then
if ( allocated ( p % precv ( ilev_ ) % sm2a ) ) then
if ( allocated ( p % precv ( ilev_ ) % sm2a % sv ) ) then
if ( allocated ( p % precv ( ilev_ ) % sm2a % sv ) ) then
if ( . not . same_type_as ( p % precv ( ilev_ ) % sm2a % sv , val ) ) then
if ( . not . same_type_as ( p % precv ( ilev_ ) % sm2a % sv , val ) ) then
call p % precv ( ilev_ ) % sm2a % sv % free ( info )
deallocate ( p % precv ( ilev_ ) % sm2a % sv , stat = info )
deallocate ( p % precv ( ilev_ ) % sm2a % sv , stat = info )
if ( info / = 0 ) then
if ( info / = 0 ) then
info = 3111
info = 3111