Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ module dg_inc_matrix_vector_kernel_mod
GH_READWRITE, ANY_SPACE_1, &
ANY_DISCONTINUOUS_SPACE_1, &
CELL_COLUMN
use constants_mod, only : i_def, r_single, r_double
use constants_mod, only : i_def
use, intrinsic :: iso_fortran_env, only: real32, real64
use kernel_mod, only : kernel_type

implicit none
Expand Down Expand Up @@ -41,8 +42,8 @@ module dg_inc_matrix_vector_kernel_mod
! Generic interface for real32 and real64 types
interface dg_inc_matrix_vector_code
module procedure &
dg_inc_matrix_vector_code_r_single, &
dg_inc_matrix_vector_code_r_double
dg_inc_matrix_vector_code_real32, &
dg_inc_matrix_vector_code_real64
end interface

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

! R_SINGLE PRECISION
! REAL32 PRECISION
! ==================
subroutine dg_inc_matrix_vector_code_r_single(cell, &
subroutine dg_inc_matrix_vector_code_real32( cell, &
nlayers, &
lhs, x, &
ncell_3d, &
Expand All @@ -83,9 +84,9 @@ subroutine dg_inc_matrix_vector_code_r_single(cell, &
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
integer(kind=i_def), dimension(ndf2), intent(in) :: map2

real(kind=r_single), dimension(undf2), intent(in) :: x
real(kind=r_single), dimension(undf1), intent(inout) :: lhs
real(kind=r_single), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
real(kind=real32), dimension(undf2), intent(in) :: x
real(kind=real32), dimension(undf1), intent(inout) :: lhs
real(kind=real32), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix

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

end subroutine dg_inc_matrix_vector_code_r_single
end subroutine dg_inc_matrix_vector_code_real32


! R_DOUBLE PRECISION
! REAL64 PRECISION
! ==================
subroutine dg_inc_matrix_vector_code_r_double(cell, &
subroutine dg_inc_matrix_vector_code_real64( cell, &
nlayers, &
lhs, x, &
ncell_3d, &
Expand All @@ -123,9 +124,9 @@ subroutine dg_inc_matrix_vector_code_r_double(cell, &
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
integer(kind=i_def), dimension(ndf2), intent(in) :: map2

real(kind=r_double), dimension(undf2), intent(in) :: x
real(kind=r_double), dimension(undf1), intent(inout) :: lhs
real(kind=r_double), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
real(kind=real64), dimension(undf2), intent(in) :: x
real(kind=real64), dimension(undf1), intent(inout) :: lhs
real(kind=real64), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix

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

end subroutine dg_inc_matrix_vector_code_r_double
end subroutine dg_inc_matrix_vector_code_real64

end module dg_inc_matrix_vector_kernel_mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
!> output field entirely, hence can only be used for W3 spaces
module dg_matrix_vector_kernel_mod

use constants_mod, only : i_def, r_single, r_double
use kernel_mod, only : kernel_type
use argument_mod, only : arg_type, &
GH_FIELD, GH_OPERATOR, &
GH_READ, GH_WRITE, &
GH_REAL, ANY_SPACE_1, &
ANY_DISCONTINUOUS_SPACE_1, &
CELL_COLUMN
use constants_mod, only : i_def
use, intrinsic :: iso_fortran_env, only: real32, real64
use kernel_mod, only : kernel_type
use argument_mod, only : arg_type, &
GH_FIELD, GH_OPERATOR, &
GH_READ, GH_WRITE, &
GH_REAL, ANY_SPACE_1, &
ANY_DISCONTINUOUS_SPACE_1, &
CELL_COLUMN

implicit none

Expand Down Expand Up @@ -43,8 +44,8 @@ module dg_matrix_vector_kernel_mod
! Generic interface for real32 and real64 types
interface dg_matrix_vector_code
module procedure &
dg_matrix_vector_code_r_single, &
dg_matrix_vector_code_r_double
dg_matrix_vector_code_real32, &
dg_matrix_vector_code_real64
end interface

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

! R_SINGLE PRECISION
! REAL32 PRECISION
! ==================
subroutine dg_matrix_vector_code_r_single(cell, &
subroutine dg_matrix_vector_code_real32( cell, &
nlayers, &
lhs, x, &
ncell_3d, &
Expand All @@ -82,9 +83,9 @@ subroutine dg_matrix_vector_code_r_single(cell, &
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
integer(kind=i_def), dimension(ndf2), intent(in) :: map2

real(kind=r_single), dimension(undf2), intent(in) :: x
real(kind=r_single), dimension(undf1), intent(inout) :: lhs
real(kind=r_single), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
real(kind=real32), dimension(undf2), intent(in) :: x
real(kind=real32), dimension(undf1), intent(inout) :: lhs
real(kind=real32), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix

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

do df1 = 1, ndf1
i1 = map1(df1)
lhs(i1:i1+nl) = 0.0_r_single
lhs(i1:i1+nl) = 0.0_real32
end do

ik = (cell-1)*nlayers + 1
Expand All @@ -106,11 +107,11 @@ subroutine dg_matrix_vector_code_r_single(cell, &
end do
end do

end subroutine dg_matrix_vector_code_r_single
end subroutine dg_matrix_vector_code_real32

! R_DOUBLE PRECISION
! REAL64 PRECISION
! ==================
subroutine dg_matrix_vector_code_r_double(cell, &
subroutine dg_matrix_vector_code_real64( cell, &
nlayers, &
lhs, x, &
ncell_3d, &
Expand All @@ -127,9 +128,9 @@ subroutine dg_matrix_vector_code_r_double(cell, &
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
integer(kind=i_def), dimension(ndf2), intent(in) :: map2

real(kind=r_double), dimension(undf2), intent(in) :: x
real(kind=r_double), dimension(undf1), intent(inout) :: lhs
real(kind=r_double), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
real(kind=real64), dimension(undf2), intent(in) :: x
real(kind=real64), dimension(undf1), intent(inout) :: lhs
real(kind=real64), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix

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

do df1 = 1, ndf1
i1 = map1(df1)
lhs(i1:i1+nl) = 0.0_r_double
lhs(i1:i1+nl) = 0.0_real64
end do

ik = (cell-1)*nlayers + 1
Expand All @@ -151,6 +152,6 @@ subroutine dg_matrix_vector_code_r_double(cell, &
end do
end do

end subroutine dg_matrix_vector_code_r_double
end subroutine dg_matrix_vector_code_real64

end module dg_matrix_vector_kernel_mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module matrix_vector_kernel_mod
GH_REAL, GH_READ, GH_INC, &
ANY_SPACE_1, ANY_SPACE_2, &
CELL_COLUMN
use constants_mod, only : i_def, r_single, r_double
use constants_mod, only : i_def
use, intrinsic :: iso_fortran_env, only: real32, real64
use kernel_mod, only : kernel_type

implicit none
Expand Down Expand Up @@ -40,8 +41,8 @@ module matrix_vector_kernel_mod
! Generic interface for real32 and real64 types
interface matrix_vector_code
module procedure &
matrix_vector_code_r_single, &
matrix_vector_code_r_double
matrix_vector_code_real32, &
matrix_vector_code_real64
end interface

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

! R_SINGLE PRECISION
! REAL32 PRECISION
! ==================
subroutine matrix_vector_code_r_single(cell, &
subroutine matrix_vector_code_real32( cell, &
nlayers, &
lhs, x, &
ncell_3d, &
Expand All @@ -82,9 +83,9 @@ subroutine matrix_vector_code_r_single(cell, &
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
integer(kind=i_def), dimension(ndf2), intent(in) :: map2

real(kind=r_single), dimension(undf2), intent(in) :: x
real(kind=r_single), dimension(undf1), intent(inout) :: lhs
real(kind=r_single), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
real(kind=real32), dimension(undf2), intent(in) :: x
real(kind=real32), dimension(undf1), intent(inout) :: lhs
real(kind=real32), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix

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

end subroutine matrix_vector_code_r_single
end subroutine matrix_vector_code_real32


! R_DOUBLE PRECISION
! REAL64 PRECISION
! ==================
subroutine matrix_vector_code_r_double(cell, &
subroutine matrix_vector_code_real64( cell, &
nlayers, &
lhs, x, &
ncell_3d, &
Expand All @@ -121,9 +122,9 @@ subroutine matrix_vector_code_r_double(cell, &
integer(kind=i_def), dimension(ndf1), intent(in) :: map1
integer(kind=i_def), dimension(ndf2), intent(in) :: map2

real(kind=r_double), dimension(undf2), intent(in) :: x
real(kind=r_double), dimension(undf1), intent(inout) :: lhs
real(kind=r_double), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix
real(kind=real64), dimension(undf2), intent(in) :: x
real(kind=real64), dimension(undf1), intent(inout) :: lhs
real(kind=real64), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix

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

Expand All @@ -137,6 +138,6 @@ subroutine matrix_vector_code_r_double(cell, &
end do
end do

end subroutine matrix_vector_code_r_double
end subroutine matrix_vector_code_real64

end module matrix_vector_kernel_mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module sci_assign_field_random_kernel_mod
GH_INC, ANY_SPACE_1, &
CELL_COLUMN, GH_READ, &
GH_SCALAR
use constants_mod, only : r_single, r_double, i_def
use constants_mod, only : i_def
use, intrinsic :: iso_fortran_env, only: real32, real64
use kernel_mod, only : kernel_type

implicit none
Expand Down Expand Up @@ -44,8 +45,8 @@ module sci_assign_field_random_kernel_mod
! Generic interface for real32 and real64 types
interface assign_field_random_code
module procedure &
assign_field_random_code_r_single, &
assign_field_random_code_r_double
assign_field_random_code_real32, &
assign_field_random_code_real64
end interface

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

! R_SINGLE PRECISION
! REAL32 PRECISION
! ==================
subroutine assign_field_random_code_r_single(nlayers, &
subroutine assign_field_random_code_real32( nlayers, &
x, &
scale, &
ndf, undf, map)
Expand All @@ -70,12 +71,12 @@ subroutine assign_field_random_code_r_single(nlayers, &
integer(kind=i_def), intent(in) :: nlayers
integer(kind=i_def), intent(in) :: undf, ndf
integer(kind=i_def), dimension(ndf), intent(in) :: map
real (kind=r_single), dimension(undf), intent(inout) :: x
real (kind=r_single), intent(in) :: scale
real (kind=real32), dimension(undf), intent(inout) :: x
real (kind=real32), intent(in) :: scale

! Internal variables
integer(kind=i_def) :: df, k
real(kind=r_single), dimension(ndf) :: random_values
real(kind=real32), dimension(ndf) :: random_values

do k = 0, nlayers-1
call random_number(random_values(:))
Expand All @@ -84,11 +85,11 @@ subroutine assign_field_random_code_r_single(nlayers, &
end do
end do

end subroutine assign_field_random_code_r_single
end subroutine assign_field_random_code_real32

! R_DOUBLE PRECISION
! REAL64 PRECISION
! ==================
subroutine assign_field_random_code_r_double(nlayers, &
subroutine assign_field_random_code_real64( nlayers, &
x, &
scale, &
ndf, undf, map)
Expand All @@ -98,12 +99,12 @@ subroutine assign_field_random_code_r_double(nlayers, &
integer(kind=i_def), intent(in) :: nlayers
integer(kind=i_def), intent(in) :: undf, ndf
integer(kind=i_def), dimension(ndf), intent(in) :: map
real (kind=r_double), dimension(undf), intent(inout) :: x
real (kind=r_double), intent(in) :: scale
real (kind=real64), dimension(undf), intent(inout) :: x
real (kind=real64), intent(in) :: scale

! Internal variables
integer(kind=i_def) :: df, k
real(kind=r_double), dimension(ndf) :: random_values
real(kind=real64), dimension(ndf) :: random_values

do k = 0, nlayers-1
call random_number(random_values(:))
Expand All @@ -112,6 +113,6 @@ subroutine assign_field_random_code_r_double(nlayers, &
end do
end do

end subroutine assign_field_random_code_r_double
end subroutine assign_field_random_code_real64

end module sci_assign_field_random_kernel_mod
Loading
Loading