diff --git a/base/serial/impl/psb_c_mat_impl.F90 b/base/serial/impl/psb_c_mat_impl.F90 index 478e5a18..b0de0889 100644 --- a/base/serial/impl/psb_c_mat_impl.F90 +++ b/base/serial/impl/psb_c_mat_impl.F90 @@ -1034,13 +1034,6 @@ subroutine psb_c_cscnv(a,b,info,type,mold,upd,dupl) goto 9999 endif - if (present(dupl)) then - call b%set_dupl(dupl) - else if (a%is_bld()) then - ! Does this make sense at all?? Who knows.. - call b%set_dupl(psb_dupl_def_) - end if - if (count( (/present(mold),present(type) /)) > 1) then info = psb_err_many_optional_arg_ call psb_errpush(info,name,a_err='TYPE, MOLD') @@ -1078,7 +1071,14 @@ subroutine psb_c_cscnv(a,b,info,type,mold,upd,dupl) call psb_errpush(info,name) goto 9999 end if + + if (present(dupl)) then + call altmp%set_dupl(dupl) + else if (a%is_bld()) then + ! Does this make sense at all?? Who knows.. + call altmp%set_dupl(psb_dupl_def_) + end if if (debug) write(psb_err_unit,*) 'Converting from ',& & a%get_fmt(),' to ',altmp%get_fmt() diff --git a/base/serial/impl/psb_d_mat_impl.F90 b/base/serial/impl/psb_d_mat_impl.F90 index e4761be0..a52fd7be 100644 --- a/base/serial/impl/psb_d_mat_impl.F90 +++ b/base/serial/impl/psb_d_mat_impl.F90 @@ -1035,12 +1035,6 @@ subroutine psb_d_cscnv(a,b,info,type,mold,upd,dupl) goto 9999 endif - if (present(dupl)) then - call b%set_dupl(dupl) - else if (a%is_bld()) then - ! Does this make sense at all?? Who knows.. - call b%set_dupl(psb_dupl_def_) - end if if (count( (/present(mold),present(type) /)) > 1) then info = psb_err_many_optional_arg_ @@ -1080,6 +1074,12 @@ subroutine psb_d_cscnv(a,b,info,type,mold,upd,dupl) goto 9999 end if + if (present(dupl)) then + call altmp%set_dupl(dupl) + else if (a%is_bld()) then + ! Does this make sense at all?? Who knows.. + call altmp%set_dupl(psb_dupl_def_) + end if if (debug) write(psb_err_unit,*) 'Converting from ',& & a%get_fmt(),' to ',altmp%get_fmt() @@ -1091,7 +1091,7 @@ subroutine psb_d_cscnv(a,b,info,type,mold,upd,dupl) goto 9999 end if - call move_alloc(altmp,b%a) + call move_alloc(altmp,b%a) call b%set_asb() call b%trim() call psb_erractionrestore(err_act) diff --git a/base/serial/impl/psb_s_mat_impl.F90 b/base/serial/impl/psb_s_mat_impl.F90 index 74ce13df..21629daf 100644 --- a/base/serial/impl/psb_s_mat_impl.F90 +++ b/base/serial/impl/psb_s_mat_impl.F90 @@ -1033,13 +1033,6 @@ subroutine psb_s_cscnv(a,b,info,type,mold,upd,dupl) goto 9999 endif - if (present(dupl)) then - call b%set_dupl(dupl) - else if (a%is_bld()) then - ! Does this make sense at all?? Who knows.. - call b%set_dupl(psb_dupl_def_) - end if - if (count( (/present(mold),present(type) /)) > 1) then info = psb_err_many_optional_arg_ call psb_errpush(info,name,a_err='TYPE, MOLD') @@ -1078,6 +1071,13 @@ subroutine psb_s_cscnv(a,b,info,type,mold,upd,dupl) goto 9999 end if + + if (present(dupl)) then + call altmp%set_dupl(dupl) + else if (a%is_bld()) then + ! Does this make sense at all?? Who knows.. + call altmp%set_dupl(psb_dupl_def_) + end if if (debug) write(psb_err_unit,*) 'Converting from ',& & a%get_fmt(),' to ',altmp%get_fmt() diff --git a/base/serial/impl/psb_z_mat_impl.F90 b/base/serial/impl/psb_z_mat_impl.F90 index 32b48707..31956a1a 100644 --- a/base/serial/impl/psb_z_mat_impl.F90 +++ b/base/serial/impl/psb_z_mat_impl.F90 @@ -1034,13 +1034,6 @@ subroutine psb_z_cscnv(a,b,info,type,mold,upd,dupl) goto 9999 endif - if (present(dupl)) then - call b%set_dupl(dupl) - else if (a%is_bld()) then - ! Does this make sense at all?? Who knows.. - call b%set_dupl(psb_dupl_def_) - end if - if (count( (/present(mold),present(type) /)) > 1) then info = psb_err_many_optional_arg_ call psb_errpush(info,name,a_err='TYPE, MOLD') @@ -1079,6 +1072,13 @@ subroutine psb_z_cscnv(a,b,info,type,mold,upd,dupl) goto 9999 end if + if (present(dupl)) then + call altmp%set_dupl(dupl) + else if (a%is_bld()) then + ! Does this make sense at all?? Who knows.. + call altmp%set_dupl(psb_dupl_def_) + end if + if (debug) write(psb_err_unit,*) 'Converting from ',& & a%get_fmt(),' to ',altmp%get_fmt()