Do you mean inside Fortran source code, you want to determine if single or 
double is being used?

   1) The PETSc preprocess C macros are also included in Petsc's Fortran 
include files, so either  
 
        PETSC_USE_REAL_SINGLE or PETSC_USE_REAL_DOUBLE is always defined, you 
can then use
        preprocessor macros to check: for example

        #if defined(PETSC_USE_REAL_SINGLE) 
             xxxx
        #else 
             xxxx
        #endif

    2) you can apply the Fortran kind() function to PetscReal to determine what 
type it is.


    I hope this helps,

    Barry


> On Oct 28, 2024, at 10:44 PM, Runjian Wu <wurunj...@gmail.com> wrote:
> 
> Hi all,
> 
> I have a question about how to return the precision for real number in 
> Fortran code?
> 
> Thanks,
> 
> Runjian

Reply via email to