Should be PetscReal as it is a numerical value.
> On Aug 22, 2024, at 9:55 AM, TAY Wee Beng <zon...@gmail.com> wrote: > > > > On 22/8/2024 9:54 pm, Barry Smith wrote: >> >> What is int_impl(k,5) defined type? > PetscInt >> >>> On Aug 22, 2024, at 9:45 AM, TAY Wee Beng <zon...@gmail.com> >>> <mailto:zon...@gmail.com> wrote: >>> >>> Hi Barry, >>> >>> Do you mean that I change from: >>> >>> call >>> MatSetValues(A_mat_uv,ione,II,ione,int_impl(k,5),impl_mat_A,INSERT_VALUES,ierr) >>> >>> to >>> >>> call >>> MatSetValues(A_mat_uv,[ione],II,[ione],[int_impl(k,5)],impl_mat_A,INSERT_VALUES,ierr) >>> >>> ? >>> >>> I did it but the error is still there. >>> >>> On 22/8/2024 9:40 pm, Barry Smith wrote: >>>> >>>> Fortran 90 type checking is very tight; The dimension of the array, or >>>> scalar passed as arguments must match the expected dimension (f77 did not >>>> do this type checking). Thus the ione argument must be a 1-d array as well >>>> as the numerical values so do >>>> >>>>> call >>>>> MatSetValues(A_mat_uv,[ione],II,[ione],[int_impl(k,5)],impl_mat_A,INSERT_VALUES,ierr) >>>>> >>>> >>>> See Fortran at >>>> https://urldefense.us/v3/__https://petsc.org/main/changes/dev/__;!!G_uCfscf7eWS!dNBzWkhJd-4jZyaRlnKfwEu7GsbCs6Akjkgm66N2JkhV3BIi2VMXqj5uIxaLfxLiJiHd7B0-jQmrxJNpdLCb00A$ >>>> >>>> >>>> I am trying to support the old-fashion F77 model, allowing miss-matches in >>>> the array dimensions while still doing proper type checking but it will >>>> take some time to simplify the API. >>>> >>>> Barry >>>> >>>> >>>> >>>>> On Aug 21, 2024, at 9:44 PM, TAY Wee Beng <zon...@gmail.com> >>>>> <mailto:zon...@gmail.com> wrote: >>>>> >>>>> Hi Barry, >>>>> >>>>> I have declared them as integers in Fortran. Is that different from >>>>> PetscInt and how come it works in debug mode? >>>>> >>>>> Anyway, I changed them and it solved the problem. However, I have a >>>>> similar problem in my boundary.F90: >>>>> >>>>> boundary.F90(6685): error #6285: There is no matching specific subroutine >>>>> for this generic subroutine call. [MATSETVALUES] >>>>> call >>>>> MatSetValues(A_mat_uv,ione,II,ione,int_impl(k,5),impl_mat_A,INSERT_VALUES,ierr) >>>>> -----^ >>>>> I changed all to PetscInt and also PetscReal but I still got the error. >>>>> >>>>> Why is this so now? Any solution? >>>>> >>>>> Thanks! >>>>> >>>>> On 22/8/2024 12:03 am, Barry Smith wrote: >>>>>> >>>>>> You must declare as >>>>>> >>>>>> PetscInt ksta_p,kend_p >>>>>> >>>>>> Perhaps they are declared as arrays? >>>>>> >>>>>> >>>>>>> On Aug 21, 2024, at 11:19 AM, TAY Wee Beng <zon...@gmail.com> >>>>>>> <mailto:zon...@gmail.com> wrote: >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I am using the latest PETSc thru github. I compiled both the debug and >>>>>>> rel ver of PETSc w/o problem. >>>>>>> >>>>>>> I then use it with my CFD code and the debug ver works. >>>>>>> >>>>>>> However, I have problems with the rel ver: >>>>>>> >>>>>>> ftn -o global.o -c -O3 -g -ip -ipo -fPIC -save -w >>>>>>> -I/home/project/11003851/lib/petsc_210824_intel_rel/include >>>>>>> global.F90 >>>>>>> ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now >>>>>>> deprecated and will be discontinued late 2024. Intel recommends that >>>>>>> customers transition now to using the LLVM-based Intel(R) Fortran >>>>>>> Compiler (ifx) for continued Windows* and Linux* support, new language >>>>>>> support, new language features, and optimizations. Use >>>>>>> '-diag-disable=10448' to disable this message. >>>>>>> global.F90(444): error #6285: There is no matching specific subroutine >>>>>>> for this generic subroutine call. [MATGETOWNERSHIPRANGE] >>>>>>> call MatGetOwnershipRange(A_mat,ksta_p,kend_p,ierr) >>>>>>> -------------^ >>>>>>> global.F90(720): error #6285: There is no matching specific subroutine >>>>>>> for this generic subroutine call. [MATGETOWNERSHIPRANGE] >>>>>>> call MatGetOwnershipRange(A_mat_uv,ksta_m,kend_m,ierr) >>>>>>> -----^ >>>>>>> global.F90(774): error #6285: There is no matching specific subroutine >>>>>>> for this generic subroutine call. [MATGETOWNERSHIPRANGE] >>>>>>> call MatGetOwnershipRange(A_semi_x,ksta_mx,kend_mx,ierr) >>>>>>> -----^ >>>>>>> global.F90(776): error #6285: There is no matching specific subroutine >>>>>>> for this generic subroutine call. [MATGETOWNERSHIPRANGE] >>>>>>> call MatGetOwnershipRange(A_semi_y,ksta_my,kend_my,ierr) >>>>>>> -----^ >>>>>>> global.F90(949): error #6285: There is no matching specific subroutine >>>>>>> for this generic subroutine call. [MATGETOWNERSHIPRANGE] >>>>>>> call MatGetOwnershipRange(A_semi_x,ksta_mx,kend_mx,ierr) >>>>>>> -----^ >>>>>>> global.F90(957): error #6285: There is no matching specific subroutine >>>>>>> for this generic subroutine call. [MATGETOWNERSHIPRANGE] >>>>>>> call MatGetOwnershipRange(A_semi_y,ksta_my,kend_my,ierr) >>>>>>> -----^ >>>>>>> compilation aborted for global.F90 (code 1) >>>>>>> >>>>>>> May I know what's the problem? >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> Thank you very much. >>>>>>> >>>>>>> Yours sincerely, >>>>>>> >>>>>>> ================================================ >>>>>>> TAY Wee-Beng 郑伟明 (Zheng Weiming) >>>>>>> ================================================ >>>>>>> >>>>>>> >>>>>> >>>>> -- >>>>> >>>>> Thank you very much. >>>>> >>>>> Yours sincerely, >>>>> >>>>> ================================================ >>>>> TAY Wee-Beng 郑伟明 (Zheng Weiming) >>>>> ================================================ >>>>> >>>>> >>>> >>> -- >>> >>> Thank you very much. >>> >>> Yours sincerely, >>> >>> ================================================ >>> TAY Wee-Beng 郑伟明 (Zheng Weiming) >>> ================================================ >>> >>> >> > -- > > Thank you very much. > > Yours sincerely, > > ================================================ > TAY Wee-Beng 郑伟明 (Zheng Weiming) > ================================================ > >