Search code examples
typesfortrannotation

Create Notation for a Fortran Kind constants?


Can I create my own notation in Fortran for the kind of variables I am working on. If I am working on Fortran REAL variables of KIND 32, Can I create notation for it like "D" for Double, and "Q" for Quad while declaring constants of that KIND. Can I create variables with my own Alphabet say "U" while declaring constants of my Kind.


Solution

  • Fortran uses suffixes for the kind of numerical (and some other) literals

    1_int32  
    4.2e5_real64
    

    where int32 and real64 are the kind constants.

    You cannot redefine the letter used for exponentiation. It is either E or D (for douple precision). Q is nonstandard.