[petsc-users] Why PETSc needs PetscScalar datatype?

Karl Rupp rupp at iue.tuwien.ac.at
Tue Aug 7 08:22:23 CDT 2018


Hi Youjun,

PetscFortranComplex has been merged to our `master` development branch 
and is also available via the `maint` branch. It will be part of the 
next 3.9.x point release.

Best regards,
Karli



On 08/04/2018 04:43 PM, Youjun Hu wrote:
> Thank Satish.
> PetscFortranComplex works.
> I just want to distinguish between real and complex variables in my 
> Fotran code, so I prefer to use PetscFortranComplex when a variables is 
> complex.
> I began to learn petsc just several weeks ago.
> Another unusual thing I noticed is that petsc keywords are 
> case-sensitive in Fotran codes, which breaks the convention that Fortran 
> is case-insensitive.
> Correct me if I am wrong.
> 
> Youjun
> 
> On Sat, Aug 4, 2018 at 3:24 PM Satish Balay <balay at mcs.anl.gov 
> <mailto:balay at mcs.anl.gov>> wrote:
> 
>     For some reason it is PetscFortranComplex [on fortran side]
> 
>     I'm not sure I understand your logic for using PetscComplex and not
>     PetscScalar.
> 
>     We recommend using PetscScalar. You can choose not to follow our
>     recommendation.
> 
>     But we don't say 'PetscScalar' is the wrong thing for users [as you
>     appear to infer]
> 
>     Satish
> 
>     On Sat, 4 Aug 2018, Youjun Hu wrote:
> 
>      > I just tried to change PetscScalar to the specific datatype
>     PetscComplex in
>      > my Fortran code, but the compiler raised the following error:
>      > PetscComplex   my_coeff
>      > Error: Unclassifiable statement at (1)
>      >
>      > It seems that the compiler does not know this datatype.
>      >
>      > My Petsc was configured with ./configure   --with-scalar-type=complex
>      > --with-precision=double
>      >
>      > Before the modification, the code was complied successfully.
>      > Could someone help?
>      >
>      > Thanks,
>      > Youjun
>      >
>      >
> 


More information about the petsc-users mailing list