m_cuda_kernels_fieldops Module


Uses

  • module~~m_cuda_kernels_fieldops~~UsesGraph module~m_cuda_kernels_fieldops m_cuda_kernels_fieldops cudafor cudafor module~m_cuda_kernels_fieldops->cudafor module~m_common m_common module~m_cuda_kernels_fieldops->module~m_common module~m_cuda_common m_cuda_common module~m_cuda_kernels_fieldops->module~m_cuda_common m_mpi m_mpi module~m_common->m_mpi module~m_logger m_logger module~m_common->module~m_logger module~m_logger->m_mpi iso_fortran_env iso_fortran_env module~m_logger->iso_fortran_env

Used by

  • module~~m_cuda_kernels_fieldops~~UsedByGraph module~m_cuda_kernels_fieldops m_cuda_kernels_fieldops module~m_cuda_backend m_cuda_backend module~m_cuda_backend->module~m_cuda_kernels_fieldops module~m_backend_setup m_backend_setup module~m_backend_setup->module~m_cuda_backend program~xcompact xcompact program~xcompact->module~m_backend_setup

Subroutines

public subroutine copy(n, dst, src)

Arguments

Type IntentOptional Attributes Name
integer, intent(in), value :: n
real(kind=dp), intent(out), device, dimension(:, :, :) :: dst
real(kind=dp), intent(in), device, dimension(:, :, :) :: src

public subroutine axpby(n, alpha, x, beta, y)

Arguments

Type IntentOptional Attributes Name
integer, intent(in), value :: n
real(kind=dp), intent(in), value :: alpha
real(kind=dp), intent(in), device, dimension(:, :, :) :: x
real(kind=dp), intent(in), value :: beta
real(kind=dp), intent(inout), device, dimension(:, :, :) :: y

public subroutine pwmul(y, x, n)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: y
real(kind=dp), intent(in), device, dimension(:, :, :) :: x
integer, intent(in), value :: n

public subroutine buffer_copy(u_send_s, u_send_e, u, n, n_halo)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: u_send_s
real(kind=dp), intent(inout), device, dimension(:, :, :) :: u_send_e
real(kind=dp), intent(in), device, dimension(:, :, :) :: u
integer, intent(in), value :: n
integer, intent(in), value :: n_halo

public subroutine field_scale(f, alpha, n)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: f
real(kind=dp), intent(in), value :: alpha
integer, intent(in), value :: n

public subroutine field_shift(f, const, n)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: f
real(kind=dp), intent(in), value :: const
integer, intent(in), value :: n

public subroutine vorticity_from_gradients(vort, dudy, dudz, dvdx, dvdz, dwdx, dwdy, n)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: vort
real(kind=dp), intent(in), device, dimension(:, :, :) :: dudy
real(kind=dp), intent(in), device, dimension(:, :, :) :: dudz
real(kind=dp), intent(in), device, dimension(:, :, :) :: dvdx
real(kind=dp), intent(in), device, dimension(:, :, :) :: dvdz
real(kind=dp), intent(in), device, dimension(:, :, :) :: dwdx
real(kind=dp), intent(in), device, dimension(:, :, :) :: dwdy
integer, intent(in), value :: n

public subroutine qcriterion_from_gradients(qcrit, dudx, dudy, dudz, dvdx, dvdy, dvdz, dwdx, dwdy, dwdz, n)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: qcrit
real(kind=dp), intent(in), device, dimension(:, :, :) :: dudx
real(kind=dp), intent(in), device, dimension(:, :, :) :: dudy
real(kind=dp), intent(in), device, dimension(:, :, :) :: dudz
real(kind=dp), intent(in), device, dimension(:, :, :) :: dvdx
real(kind=dp), intent(in), device, dimension(:, :, :) :: dvdy
real(kind=dp), intent(in), device, dimension(:, :, :) :: dvdz
real(kind=dp), intent(in), device, dimension(:, :, :) :: dwdx
real(kind=dp), intent(in), device, dimension(:, :, :) :: dwdy
real(kind=dp), intent(in), device, dimension(:, :, :) :: dwdz
integer, intent(in), value :: n

public subroutine smagorinsky_from_gradients(nut, mixing_length_sq, dudx, dudy, dudz, dvdx, dvdy, dvdz, dwdx, dwdy, dwdz, n)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: nut
real(kind=dp), intent(in), device, dimension(:, :, :) :: mixing_length_sq
real(kind=dp), intent(in), device, dimension(:, :, :) :: dudx
real(kind=dp), intent(in), device, dimension(:, :, :) :: dudy
real(kind=dp), intent(in), device, dimension(:, :, :) :: dudz
real(kind=dp), intent(in), device, dimension(:, :, :) :: dvdx
real(kind=dp), intent(in), device, dimension(:, :, :) :: dvdy
real(kind=dp), intent(in), device, dimension(:, :, :) :: dvdz
real(kind=dp), intent(in), device, dimension(:, :, :) :: dwdx
real(kind=dp), intent(in), device, dimension(:, :, :) :: dwdy
real(kind=dp), intent(in), device, dimension(:, :, :) :: dwdz
integer, intent(in), value :: n

public subroutine sgs_stress_from_gradients(stress, nut, gradient_a, gradient_b, scale_a, scale_b, n)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: stress
real(kind=dp), intent(in), device, dimension(:, :, :) :: nut
real(kind=dp), intent(in), device, dimension(:, :, :) :: gradient_a
real(kind=dp), intent(in), device, dimension(:, :, :) :: gradient_b
real(kind=dp), intent(in), value :: scale_a
real(kind=dp), intent(in), value :: scale_b
integer, intent(in), value :: n

public subroutine scalar_product(s, x, y, n, n_i_pad, n_j)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device :: s
real(kind=dp), intent(in), device, dimension(:, :, :) :: x
real(kind=dp), intent(in), device, dimension(:, :, :) :: y
integer, intent(in), value :: n
integer, intent(in), value :: n_i_pad
integer, intent(in), value :: n_j

public subroutine vector_norm_squared(s, a, b, c, n, n_i_pad, n_j)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device :: s
real(kind=dp), intent(in), device, dimension(:, :, :) :: a
real(kind=dp), intent(in), device, dimension(:, :, :) :: b
real(kind=dp), intent(in), device, dimension(:, :, :) :: c
integer, intent(in), value :: n
integer, intent(in), value :: n_i_pad
integer, intent(in), value :: n_j

public subroutine labelled_sums(s, g, label, a, b, c, n_label, n, n_i_pad, n_j)

s(1:3, l) += sums of ga, gb and g*c over the points labelled l; launch as vector_norm_squared. Each thread accumulates runs of equal labels along its pencil and flushes a run when the label changes, so the atomics scale with the label changes rather than the points.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device :: s(3,n_label)
real(kind=dp), intent(in), device, dimension(:, :, :) :: g
real(kind=dp), intent(in), device, dimension(:, :, :) :: label
real(kind=dp), intent(in), device, dimension(:, :, :) :: a
real(kind=dp), intent(in), device, dimension(:, :, :) :: b
real(kind=dp), intent(in), device, dimension(:, :, :) :: c
integer, intent(in), value :: n_label
integer, intent(in), value :: n
integer, intent(in), value :: n_i_pad
integer, intent(in), value :: n_j

public subroutine labelled_axpy(coeffs, g, label, a, b, c, n_label, n, n_i_pad, n_j)

a, b, c += coeffs(1:3, l)*g at the points labelled l; launch as vector_norm_squared.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), device :: coeffs(3,n_label)
real(kind=dp), intent(in), device, dimension(:, :, :) :: g
real(kind=dp), intent(in), device, dimension(:, :, :) :: label
real(kind=dp), intent(inout), device, dimension(:, :, :) :: a
real(kind=dp), intent(inout), device, dimension(:, :, :) :: b
real(kind=dp), intent(inout), device, dimension(:, :, :) :: c
integer, intent(in), value :: n_label
integer, intent(in), value :: n
integer, intent(in), value :: n_i_pad
integer, intent(in), value :: n_j

public subroutine field_max_sum(max_f, sum_f, f, n, n_i_pad, n_j)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device :: max_f
real(kind=dp), intent(inout), device :: sum_f
real(kind=dp), intent(in), device, dimension(:, :, :) :: f
integer, intent(in), value :: n
integer, intent(in), value :: n_i_pad
integer, intent(in), value :: n_j

public subroutine field_set_y_face(f, c_start, c_end, set_start, set_end, flow_rate_diff, nx, ny, nz)

Set domain Y_FACE boundary values. c_start: Dirichlet value applied at the bottom face (j = 1) c_end: Dirichlet value applied at the top face (j = ny) set_start/set_end: whether that face carries a prescribed value at all, so the two y-faces can differ (ABL: no-slip floor, free-slip lid).

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: f
real(kind=dp), intent(in), value :: c_start
real(kind=dp), intent(in), value :: c_end
logical, intent(in), value :: set_start
logical, intent(in), value :: set_end
real(kind=dp), intent(in), value :: flow_rate_diff
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine field_plane_partial_sums(partial, f, nx, ny, nz)

First pass of field_plane_sums: partial(j, z) is the sum over x of y index j at z. Launch with threads = dim3(SZ, 1, 1) and blocks = dim3(n_y_blocks, nz, 1).

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :) :: partial
real(kind=dp), intent(in), device, dimension(:, :, :) :: f
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine field_plane_sums_reduce(sums, partial, ny, nz)

Second pass of field_plane_sums: sums(j) = sum over z of partial(j, z), in a fixed order. Launch with one thread per y index.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:) :: sums
real(kind=dp), intent(in), device, dimension(:, :) :: partial
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine field_set_y_plane(f, c, i_in_block, group_offset, nx)

Set one interior y-plane to a constant. The caller resolves the plane into its position within a y-block and the group offset for that block, so this kernel stays free of layout arithmetic.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: f
real(kind=dp), intent(in), value :: c
integer, intent(in), value :: i_in_block
integer, intent(in), value :: group_offset
integer, intent(in), value :: nx

public subroutine field_set_abl_wall_stress(stress, u, w, drag_coeff, sample_i, stress_i, sample_offset, stress_offset, nx, component)

Drag law tau = drag_coeffu_c|u_h| from each column's own sampled velocity, written into one stress plane (component 1: x, 3: z).

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: stress
real(kind=dp), intent(in), device, dimension(:, :, :) :: u
real(kind=dp), intent(in), device, dimension(:, :, :) :: w
real(kind=dp), intent(in), value :: drag_coeff
integer, intent(in), value :: sample_i
integer, intent(in), value :: stress_i
integer, intent(in), value :: sample_offset
integer, intent(in), value :: stress_offset
integer, intent(in), value :: nx
integer, intent(in), value :: component

public subroutine field_set_y_face_from_field(f, f_start, nx, ny, nz)

Set domain Y_FACE boundary values from another field. Both f and f_start are DIR_X VERT pencil-layout. Only the bottom (j = 1) and top (j = ny) y-pencil planes of f_start are read.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: f
real(kind=dp), intent(in), device, dimension(:, :, :) :: f_start
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine field_set_x_face(f, c_start, c_end, bc_start, bc_end, flow_rate_diff, nx, ny, nz)

Set domain X_FACE boundary values. c_start: Dirichlet value applied at the left face (i = 1) c_end: convective velocity Uc = uxmax * gdt / dx, used as multiplier in the outflow scheme du/dt + Uc*du/dx = 0

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: f
real(kind=dp), intent(in), value :: c_start
real(kind=dp), intent(in), value :: c_end
integer, intent(in), value :: bc_start
integer, intent(in), value :: bc_end
real(kind=dp), intent(in), value :: flow_rate_diff
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine field_set_x_face_from_field(f, f_start, c_end, bc_start, bc_end, flow_rate_diff, nx, ny, nz)

Set domain X_FACE boundary values with a spatially-varying inlet.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: f
real(kind=dp), intent(in), device, dimension(:, :, :) :: f_start
real(kind=dp), intent(in), value :: c_end
integer, intent(in), value :: bc_start
integer, intent(in), value :: bc_end
real(kind=dp), intent(in), value :: flow_rate_diff
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine add_scalar_x_face(f, c, i_plane, nx, ny, nz)

Adds a uniform constant c to a single x-normal plane (pencil index i_plane) of a DIR_X VERT field, in place.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: f
real(kind=dp), intent(in), value :: c
integer, intent(in), value :: i_plane
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine set_x_inlet_plane(f, plane, nx, ny, nz)

Copies plane(y, z) into the x = 1 plane (pencil index 1) of a DIR_X VERT field, where f(i, 1, b) holds y = (y_block - 1)SZ + i and z = b - (y_block - 1)nz. Launch as add_scalar_x_face.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: f
real(kind=dp), intent(in), device, dimension(:, :) :: plane
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine field_add_x_face_from_field(f, g, set_start, set_end, nx, ny, nz)

f += g on the x-faces (pencil index 1 and nx) flagged by set_start/set_end. Launch as field_set_x_face_from_field.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: f
real(kind=dp), intent(in), device, dimension(:, :, :) :: g
logical, intent(in), value :: set_start
logical, intent(in), value :: set_end
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine field_add_y_face_from_field(f, g, set_start, set_end, nx, ny, nz)

f += g on the y-faces (j = 1 and ny) flagged by set_start/set_end. Launch as field_set_y_face.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: f
real(kind=dp), intent(in), device, dimension(:, :, :) :: g
logical, intent(in), value :: set_start
logical, intent(in), value :: set_end
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine volume_integral(s, f, n, n_i_pad, n_j)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device :: s
real(kind=dp), intent(in), device, dimension(:, :, :) :: f
integer, intent(in), value :: n
integer, intent(in), value :: n_i_pad
integer, intent(in), value :: n_j