@fortran4r posted a new topic, subject "Does -fdefault-real-8 in GFortran affect the kind of real literals?". It read:

   If I use the -fdefault-real-8 flag, do I still need to add the suffix d after real literals? In addition, will the real() function have the same effect as dble() when converting an integer to double?
    [code] 
        !-fdefault-real-8 is used 
        
        real 8b7c:f320:99b9:690f:4595:cd17:293a:c069 x
        x = 3.1415926 !not sure if the suffix d0 is needed
        
        real 8b7c:f320:99b9:690f:4595:cd17:293a:c069 y
        y = real(5) !not sure if this is the same as dble(5)
        
    [/code]

So @msz59 replied

    From gfortran manual:
    
    > -fdefault-real-8  
    >  Set the default real type to an 8 byte wide type. This option also affects the kind of non-double real constants like 1.0. This option promotes the default width of “DOUBLE PRECISION” and double real constants like “1.d0” to 16 bytes if possible. If “-fdefault-double-8” is given along with “fdefault-real-8”, “DOUBLE PRECISION” and double real constants are not promoted. Unlike -freal-4-real-8, “fdefault-real-8” does not promote variables with explicit kind declarations.
    
    The `REAL` function seems to output KIND=8 result as well.
    
    kargl:
    
    > You should never use `DBLE`
    
    Well, this is not quite true. You'd need it to call an external subprogram which expects double precision argument if the actual parameter is not a double. Unless you mean using `REAL(x,KIND=KIND(1d0))` instead of `DBLE(x)`

To which @msz59 replied

    Actually, the manual warnings are placed under -freal-N-real-M options only, not -fdefault-real-N, but I agree that all of them should be used with care. The OP asked about literal constants under the option so I answered.  
    Still, I remember dealing (some 30 years ago) with a 30,000 line F77 code when I had to check the performance/accuracy loss/gain when converted from REAL to DP while heavily updating the code itself. I can assure**2 you that it was much simpler and **less** error-prone to use -fdefault-real-8 option than to edit those 30,000 lines changing REAL → DOUBLE PRECISION in declarations and REAL → DBLE in explicit conversions and keeping both versions in sync of the other changes. DBLE was a generic (group) function in those days.


{'source': 'discourse', 'url': 'https://fortran-lang.discourse.group/t/does-fdefault-real-8-in-gfortran-affect-the-kind-of-real-literals/2036', 'title': 'Does -fdefault-real-8 in GFortran affect the kind of real literals?', 'views': 336, 'has_accepted_answer': True, 'word_count': 753, 'like_count': 0, 'reply_count': 2, 'participant_count': 2, 'posts': 3, 'tags': '', 'author': '@fortran4r', 'participants': '@fortran4r, @msz59', 'image_url': [None], 'created_at': '2021-10-09T02:47:40.379Z', 'last_posted_at': '2021-10-11T22:45:46.447Z'}