Skip to content

Commit 1ac5f33

Browse files
committed
changes to use iso-ieee kinds
1 parent bb10f89 commit 1ac5f33

58 files changed

Lines changed: 1464 additions & 1406 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/science/source/kernel/algebra/dg_inc_matrix_vector_kernel_mod.F90

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ module dg_inc_matrix_vector_kernel_mod
1313
GH_READWRITE, ANY_SPACE_1, &
1414
ANY_DISCONTINUOUS_SPACE_1, &
1515
CELL_COLUMN
16-
use constants_mod, only : i_def, r_single, r_double
16+
use constants_mod, only : i_def
17+
use, intrinsic :: iso_fortran_env, only: real32, real64
1718
use kernel_mod, only : kernel_type
1819

1920
implicit none
@@ -41,8 +42,8 @@ module dg_inc_matrix_vector_kernel_mod
4142
! Generic interface for real32 and real64 types
4243
interface dg_inc_matrix_vector_code
4344
module procedure &
44-
dg_inc_matrix_vector_code_r_single, &
45-
dg_inc_matrix_vector_code_r_double
45+
dg_inc_matrix_vector_code_real32, &
46+
dg_inc_matrix_vector_code_real64
4647
end interface
4748

4849
contains
@@ -64,9 +65,9 @@ module dg_inc_matrix_vector_kernel_mod
6465
!> @param[in] map2 Dofmap for the cell at the base of the column for the input
6566
!! field
6667

67-
! R_SINGLE PRECISION
68+
! REAL32 PRECISION
6869
! ==================
69-
subroutine dg_inc_matrix_vector_code_r_single(cell, &
70+
subroutine dg_inc_matrix_vector_code_real32(cell, &
7071
nlayers, &
7172
lhs, x, &
7273
ncell_3d, &
@@ -83,9 +84,9 @@ subroutine dg_inc_matrix_vector_code_r_single(cell, &
8384
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
8485
integer(kind=i_def), dimension(ndf2), intent(in) :: map2
8586

86-
real(kind=r_single), dimension(undf2), intent(in) :: x
87-
real(kind=r_single), dimension(undf1), intent(inout) :: lhs
88-
real(kind=r_single), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
87+
real(kind=real32), dimension(undf2), intent(in) :: x
88+
real(kind=real32), dimension(undf1), intent(inout) :: lhs
89+
real(kind=real32), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
8990

9091
! Internal variables
9192
integer(kind=i_def) :: df, df2, ik, i1, i2, nl
@@ -101,12 +102,12 @@ subroutine dg_inc_matrix_vector_code_r_single(cell, &
101102
end do
102103
end do
103104

104-
end subroutine dg_inc_matrix_vector_code_r_single
105+
end subroutine dg_inc_matrix_vector_code_real32
105106

106107

107-
! R_DOUBLE PRECISION
108+
! REAL64 PRECISION
108109
! ==================
109-
subroutine dg_inc_matrix_vector_code_r_double(cell, &
110+
subroutine dg_inc_matrix_vector_code_real64(cell, &
110111
nlayers, &
111112
lhs, x, &
112113
ncell_3d, &
@@ -123,9 +124,9 @@ subroutine dg_inc_matrix_vector_code_r_double(cell, &
123124
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
124125
integer(kind=i_def), dimension(ndf2), intent(in) :: map2
125126

126-
real(kind=r_double), dimension(undf2), intent(in) :: x
127-
real(kind=r_double), dimension(undf1), intent(inout) :: lhs
128-
real(kind=r_double), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
127+
real(kind=real64), dimension(undf2), intent(in) :: x
128+
real(kind=real64), dimension(undf1), intent(inout) :: lhs
129+
real(kind=real64), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
129130

130131
! Internal variables
131132
integer(kind=i_def) :: df, df2, ik, i1, i2, nl
@@ -141,6 +142,6 @@ subroutine dg_inc_matrix_vector_code_r_double(cell, &
141142
end do
142143
end do
143144

144-
end subroutine dg_inc_matrix_vector_code_r_double
145+
end subroutine dg_inc_matrix_vector_code_real64
145146

146147
end module dg_inc_matrix_vector_kernel_mod

components/science/source/kernel/algebra/dg_matrix_vector_kernel_mod.F90

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
!> output field entirely, hence can only be used for W3 spaces
88
module dg_matrix_vector_kernel_mod
99

10-
use constants_mod, only : i_def, r_single, r_double
11-
use kernel_mod, only : kernel_type
12-
use argument_mod, only : arg_type, &
13-
GH_FIELD, GH_OPERATOR, &
14-
GH_READ, GH_WRITE, &
15-
GH_REAL, ANY_SPACE_1, &
16-
ANY_DISCONTINUOUS_SPACE_1, &
17-
CELL_COLUMN
10+
use constants_mod, only : i_def
11+
use, intrinsic :: iso_fortran_env, only: real32, real64
12+
use kernel_mod, only : kernel_type
13+
use argument_mod, only : arg_type, &
14+
GH_FIELD, GH_OPERATOR, &
15+
GH_READ, GH_WRITE, &
16+
GH_REAL, ANY_SPACE_1, &
17+
ANY_DISCONTINUOUS_SPACE_1, &
18+
CELL_COLUMN
1819

1920
implicit none
2021

@@ -43,8 +44,8 @@ module dg_matrix_vector_kernel_mod
4344
! Generic interface for real32 and real64 types
4445
interface dg_matrix_vector_code
4546
module procedure &
46-
dg_matrix_vector_code_r_single, &
47-
dg_matrix_vector_code_r_double
47+
dg_matrix_vector_code_real32, &
48+
dg_matrix_vector_code_real64
4849
end interface
4950

5051
contains
@@ -63,9 +64,9 @@ module dg_matrix_vector_kernel_mod
6364
!> @param[in] undf2 Unique number of degrees of freedom for the input field
6465
!> @param[in] map2 Dofmap for the cell at the base of the column for the input field
6566

66-
! R_SINGLE PRECISION
67+
! REAL32 PRECISION
6768
! ==================
68-
subroutine dg_matrix_vector_code_r_single(cell, &
69+
subroutine dg_matrix_vector_code_real32(cell, &
6970
nlayers, &
7071
lhs, x, &
7172
ncell_3d, &
@@ -82,9 +83,9 @@ subroutine dg_matrix_vector_code_r_single(cell, &
8283
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
8384
integer(kind=i_def), dimension(ndf2), intent(in) :: map2
8485

85-
real(kind=r_single), dimension(undf2), intent(in) :: x
86-
real(kind=r_single), dimension(undf1), intent(inout) :: lhs
87-
real(kind=r_single), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
86+
real(kind=real32), dimension(undf2), intent(in) :: x
87+
real(kind=real32), dimension(undf1), intent(inout) :: lhs
88+
real(kind=real32), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
8889

8990
! Internal variables
9091
integer(kind=i_def) :: df1, df2, ik, i1, i2, nl
@@ -93,7 +94,7 @@ subroutine dg_matrix_vector_code_r_single(cell, &
9394

9495
do df1 = 1, ndf1
9596
i1 = map1(df1)
96-
lhs(i1:i1+nl) = 0.0_r_single
97+
lhs(i1:i1+nl) = 0.0_real32
9798
end do
9899

99100
ik = (cell-1)*nlayers + 1
@@ -106,11 +107,11 @@ subroutine dg_matrix_vector_code_r_single(cell, &
106107
end do
107108
end do
108109

109-
end subroutine dg_matrix_vector_code_r_single
110+
end subroutine dg_matrix_vector_code_real32
110111

111-
! R_DOUBLE PRECISION
112+
! REAL64 PRECISION
112113
! ==================
113-
subroutine dg_matrix_vector_code_r_double(cell, &
114+
subroutine dg_matrix_vector_code_real64(cell, &
114115
nlayers, &
115116
lhs, x, &
116117
ncell_3d, &
@@ -127,9 +128,9 @@ subroutine dg_matrix_vector_code_r_double(cell, &
127128
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
128129
integer(kind=i_def), dimension(ndf2), intent(in) :: map2
129130

130-
real(kind=r_double), dimension(undf2), intent(in) :: x
131-
real(kind=r_double), dimension(undf1), intent(inout) :: lhs
132-
real(kind=r_double), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
131+
real(kind=real64), dimension(undf2), intent(in) :: x
132+
real(kind=real64), dimension(undf1), intent(inout) :: lhs
133+
real(kind=real64), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
133134

134135
! Internal variables
135136
integer(kind=i_def) :: df1, df2, ik, i1, i2, nl
@@ -138,7 +139,7 @@ subroutine dg_matrix_vector_code_r_double(cell, &
138139

139140
do df1 = 1, ndf1
140141
i1 = map1(df1)
141-
lhs(i1:i1+nl) = 0.0_r_double
142+
lhs(i1:i1+nl) = 0.0_real64
142143
end do
143144

144145
ik = (cell-1)*nlayers + 1
@@ -151,6 +152,6 @@ subroutine dg_matrix_vector_code_r_double(cell, &
151152
end do
152153
end do
153154

154-
end subroutine dg_matrix_vector_code_r_double
155+
end subroutine dg_matrix_vector_code_real64
155156

156157
end module dg_matrix_vector_kernel_mod

components/science/source/kernel/algebra/matrix_vector_kernel_mod.F90

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ module matrix_vector_kernel_mod
1212
GH_REAL, GH_READ, GH_INC, &
1313
ANY_SPACE_1, ANY_SPACE_2, &
1414
CELL_COLUMN
15-
use constants_mod, only : i_def, r_single, r_double
15+
use constants_mod, only : i_def
16+
use, intrinsic :: iso_fortran_env, only: real32, real64
1617
use kernel_mod, only : kernel_type
1718

1819
implicit none
@@ -40,8 +41,8 @@ module matrix_vector_kernel_mod
4041
! Generic interface for real32 and real64 types
4142
interface matrix_vector_code
4243
module procedure &
43-
matrix_vector_code_r_single, &
44-
matrix_vector_code_r_double
44+
matrix_vector_code_real32, &
45+
matrix_vector_code_real64
4546
end interface
4647

4748
contains
@@ -63,9 +64,9 @@ module matrix_vector_kernel_mod
6364
!> @param[in] map2 Dofmap for the cell at the base of the column for the input
6465
!! field
6566

66-
! R_SINGLE PRECISION
67+
! REAL32 PRECISION
6768
! ==================
68-
subroutine matrix_vector_code_r_single(cell, &
69+
subroutine matrix_vector_code_real32(cell, &
6970
nlayers, &
7071
lhs, x, &
7172
ncell_3d, &
@@ -82,9 +83,9 @@ subroutine matrix_vector_code_r_single(cell, &
8283
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
8384
integer(kind=i_def), dimension(ndf2), intent(in) :: map2
8485

85-
real(kind=r_single), dimension(undf2), intent(in) :: x
86-
real(kind=r_single), dimension(undf1), intent(inout) :: lhs
87-
real(kind=r_single), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
86+
real(kind=real32), dimension(undf2), intent(in) :: x
87+
real(kind=real32), dimension(undf1), intent(inout) :: lhs
88+
real(kind=real32), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
8889

8990
! Internal variables
9091
integer(kind=i_def) :: df, ik, df2, i1, i2, nl
@@ -99,12 +100,12 @@ subroutine matrix_vector_code_r_single(cell, &
99100
end do
100101
end do
101102

102-
end subroutine matrix_vector_code_r_single
103+
end subroutine matrix_vector_code_real32
103104

104105

105-
! R_DOUBLE PRECISION
106+
! REAL64 PRECISION
106107
! ==================
107-
subroutine matrix_vector_code_r_double(cell, &
108+
subroutine matrix_vector_code_real64(cell, &
108109
nlayers, &
109110
lhs, x, &
110111
ncell_3d, &
@@ -121,9 +122,9 @@ subroutine matrix_vector_code_r_double(cell, &
121122
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
122123
integer(kind=i_def), dimension(ndf2), intent(in) :: map2
123124

124-
real(kind=r_double), dimension(undf2), intent(in) :: x
125-
real(kind=r_double), dimension(undf1), intent(inout) :: lhs
126-
real(kind=r_double), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
125+
real(kind=real64), dimension(undf2), intent(in) :: x
126+
real(kind=real64), dimension(undf1), intent(inout) :: lhs
127+
real(kind=real64), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
127128

128129
integer(kind=i_def) :: df, ik, df2, i1, i2, nl
129130

@@ -137,6 +138,6 @@ subroutine matrix_vector_code_r_double(cell, &
137138
end do
138139
end do
139140

140-
end subroutine matrix_vector_code_r_double
141+
end subroutine matrix_vector_code_real64
141142

142143
end module matrix_vector_kernel_mod

components/science/source/kernel/algebra/sci_assign_field_random_kernel_mod.F90

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ module sci_assign_field_random_kernel_mod
1616
GH_INC, ANY_SPACE_1, &
1717
CELL_COLUMN, GH_READ, &
1818
GH_SCALAR
19-
use constants_mod, only : r_single, r_double, i_def
19+
use constants_mod, only : i_def
20+
use, intrinsic :: iso_fortran_env, only: real32, real64
2021
use kernel_mod, only : kernel_type
2122

2223
implicit none
@@ -44,8 +45,8 @@ module sci_assign_field_random_kernel_mod
4445
! Generic interface for real32 and real64 types
4546
interface assign_field_random_code
4647
module procedure &
47-
assign_field_random_code_r_single, &
48-
assign_field_random_code_r_double
48+
assign_field_random_code_real32, &
49+
assign_field_random_code_real64
4950
end interface
5051

5152
contains
@@ -58,9 +59,9 @@ module sci_assign_field_random_kernel_mod
5859
!> @param[in] undf Unique number of degrees of freedom for the output field
5960
!> @param[in] map Dofmap for the cell at the base of the column for the output field
6061

61-
! R_SINGLE PRECISION
62+
! REAL32 PRECISION
6263
! ==================
63-
subroutine assign_field_random_code_r_single(nlayers, &
64+
subroutine assign_field_random_code_real32(nlayers, &
6465
x, &
6566
scale, &
6667
ndf, undf, map)
@@ -70,12 +71,12 @@ subroutine assign_field_random_code_r_single(nlayers, &
7071
integer(kind=i_def), intent(in) :: nlayers
7172
integer(kind=i_def), intent(in) :: undf, ndf
7273
integer(kind=i_def), dimension(ndf), intent(in) :: map
73-
real (kind=r_single), dimension(undf), intent(inout) :: x
74-
real (kind=r_single), intent(in) :: scale
74+
real (kind=real32), dimension(undf), intent(inout) :: x
75+
real (kind=real32), intent(in) :: scale
7576

7677
! Internal variables
7778
integer(kind=i_def) :: df, k
78-
real(kind=r_single), dimension(ndf) :: random_values
79+
real(kind=real32), dimension(ndf) :: random_values
7980

8081
do k = 0, nlayers-1
8182
call random_number(random_values(:))
@@ -84,11 +85,11 @@ subroutine assign_field_random_code_r_single(nlayers, &
8485
end do
8586
end do
8687

87-
end subroutine assign_field_random_code_r_single
88+
end subroutine assign_field_random_code_real32
8889

89-
! R_DOUBLE PRECISION
90+
! REAL64 PRECISION
9091
! ==================
91-
subroutine assign_field_random_code_r_double(nlayers, &
92+
subroutine assign_field_random_code_real64(nlayers, &
9293
x, &
9394
scale, &
9495
ndf, undf, map)
@@ -98,12 +99,12 @@ subroutine assign_field_random_code_r_double(nlayers, &
9899
integer(kind=i_def), intent(in) :: nlayers
99100
integer(kind=i_def), intent(in) :: undf, ndf
100101
integer(kind=i_def), dimension(ndf), intent(in) :: map
101-
real (kind=r_double), dimension(undf), intent(inout) :: x
102-
real (kind=r_double), intent(in) :: scale
102+
real (kind=real64), dimension(undf), intent(inout) :: x
103+
real (kind=real64), intent(in) :: scale
103104

104105
! Internal variables
105106
integer(kind=i_def) :: df, k
106-
real(kind=r_double), dimension(ndf) :: random_values
107+
real(kind=real64), dimension(ndf) :: random_values
107108

108109
do k = 0, nlayers-1
109110
call random_number(random_values(:))
@@ -112,6 +113,6 @@ subroutine assign_field_random_code_r_double(nlayers, &
112113
end do
113114
end do
114115

115-
end subroutine assign_field_random_code_r_double
116+
end subroutine assign_field_random_code_real64
116117

117118
end module sci_assign_field_random_kernel_mod

0 commit comments

Comments
 (0)