Three new Fortran 2003 formatted I/O specifiers have been implemented in f95. They may appear on OPEN, READ, WRITE, PRINT, and INQUIRE statements:
DECIMAL=[’POINT’|’COMMA’]
Change the default decimal editing mode. The default uses a period to separate the whole number and decimal parts of a floating-point number formatted with D, E, EN, ES, F, and G editing. ’COMMA’ changes the default to use comma instead of a period, to print, for example, 123,456. The default is ’POINT’, which uses a period, to print, for example, 123.456.
ROUND=[’PROCESSOR_DEFINED’ | ’COMPATIBLE’]
Set the default rounding mode for formatted I/O D, E, EN, ES, F, and G editing. With ’COMPATIBLE’, the value resulting from data conversion is the one closer to the two nearest represetnations, or the value away from zero if the value is halfway between them. With ’PROCESSOR_DEFINED’, the rounding mode is dependent on the processor’s default mode, and is the compiler default if ROUND is not specified.
As an example, WRITE(*,’(f11.4)’) 0.11115 prints 0.1111 in default mode, and 0.1112 in ’COMPATIBLE’ mode.
IOMSG=character-variable
Returns an error message as a string in the specified character variable. This is the same error message that would appear on standard output. Users should allocate a character buffer large enough to hold the longest message. (CHARACTER*256 should be sufficient.)
When used in INQUIRE statements, these specifiers declare a character variable for returning the current values.
New edit descriptors DP, DC, RP, and RC change the defaults within a single FORMAT statement to decimal point, decimal comma, processor-defined rounding, and compatible rounding respectively. For example:
WRITE(*,’(I5,DC,F10.3)’) N, W
prints a comma instead of a period in the F10.3 output item.
See also the -iorounding compiler command-line option for changing the floating-point rounding modes on formatted I/O. (3.4.49 –iorounding[={compatible|processor-defined}].)