Skip to content

Commit 97a91d9

Browse files
committed
Added FORD doc markers to stdlib_io fmt specifiers. Changed iso_fortran_env to stdlib_kinds in spec file.
1 parent c7b75e1 commit 97a91d9

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

doc/specs/stdlib_io.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -289,23 +289,23 @@ Provides formats for all kinds as defined in the `stdlib_kinds` module.
289289

290290
```fortran
291291
program demo_fmt_constants
292-
use, intrinsic :: iso_fortran_env, only : int32, int64, real32, real64
293-
use stdlib_io, only : FMT_INT, FMT_REAL_SP, FMT_REAL_DP, FMT_COMPLEX_SP, FMT_COMPLEX_DP
292+
use, stdlib_kinds, only : int32, int64, sp, dp
293+
use stdlib_io, only : FMT_INT, FMT_REAL_SP, FMT_REAL_DP, FMT_COMPLEX_SP, FMT_COMPLEX_DP
294294
implicit none
295295
296-
integer(kind=int32) :: i32
297-
integer(kind=int64) :: i64
298-
real(kind=real32) :: r32
299-
real(kind=real64) :: r64
300-
complex(kind=real32) :: c32
301-
complex(kind=real64) :: c64
296+
integer(kind=int32) :: i32
297+
integer(kind=int64) :: i64
298+
real(kind=sp) :: r32
299+
real(kind=dp) :: r64
300+
complex(kind=sp) :: c32
301+
complex(kind=dp) :: c64
302302
303303
i32 = 100_int32
304304
i64 = 100_int64
305-
r32 = 100.0_real32
306-
r64 = 100.0_real64
307-
c32 = cmplx(100.0_real32, kind=real32)
308-
c64 = cmplx(100.0_real64, kind=real64)
305+
r32 = 100.0_sp
306+
r64 = 100.0_dp
307+
c32 = cmplx(100.0_sp, kind=sp)
308+
c64 = cmplx(100.0_dp, kind=dp)
309309
310310
print "(2("//FMT_INT//",1x))", i32, i64 ! outputs: 100 100
311311
print FMT_REAL_SP, r32 ! outputs: 1.00000000E+02

src/stdlib_io.fypp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,28 @@ module stdlib_io
2121
! Private API that is exposed so that we can test it in tests
2222
public :: parse_mode
2323

24-
! Format strings with edit descriptors for each type and kind
24+
!> Version: experimental
25+
!>
26+
!> Format strings with edit descriptors for each type and kind
27+
!> The specification of this module is available [here](../page/specs/stdlib_io.html).
2528
character(*), parameter :: &
29+
!> Format string for integers
2630
FMT_INT = '(i0)', &
31+
!> Format string for single precision real numbers
2732
FMT_REAL_SP = '(es15.8e2)', &
33+
!> Format string for souble precision real numbers
2834
FMT_REAL_DP = '(es24.16e3)', &
35+
!> Format string for extended double precision real numbers
2936
FMT_REAL_XDP = '(es26.18e3)', &
37+
!> Format string for quadruple precision real numbers
3038
FMT_REAL_QP = '(es44.35e4)', &
39+
!> Format string for single precision complex numbers
3140
FMT_COMPLEX_SP = '(es15.8e2,1x,es15.8e2)', &
41+
!> Format string for double precision complex numbers
3242
FMT_COMPLEX_DP = '(es24.16e3,1x,es24.16e3)', &
43+
!> Format string for extended double precision complex numbers
3344
FMT_COMPLEX_XDP = '(es26.18e3,1x,es26.18e3)', &
45+
!> Format string for quadruple precision complex numbers
3446
FMT_COMPLEX_QP = '(es44.35e4,1x,es44.35e4)'
3547

3648
public :: FMT_INT, FMT_REAL_SP, FMT_REAL_DP, FMT_REAL_XDP, FMT_REAL_QP

0 commit comments

Comments
 (0)