Files
TheRock/rocm-systems/projects/rocprofiler-systems/examples/hpc/jacobi-fortran-usm/mesh.f90
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

48 lines
1.1 KiB
Fortran

module mesh_mod
use, intrinsic :: ISO_Fortran_env, only: stdout=>output_unit
use kind_mod
implicit none
!$omp requires unified_shared_memory
private
public :: mesh_t, init_mesh
real(RK), parameter :: x_min=-0.5_RK, x_max=0.5_RK
real(RK), parameter :: y_min=-0.5_RK, y_max=0.5_RK
real(RK), parameter :: l_x=x_max-x_min, l_y=y_max-y_min
type :: mesh_t
integer(IK) :: n_x, n_y
real(RK) ::dx, dy
real(RK), allocatable :: x(:), y(:)
end type mesh_t
contains
subroutine init_mesh(this,n_x,n_y)
type(mesh_t), intent(inout) :: this
integer(IK) :: n_x, n_y, i
this%N_x = n_x
this%N_y = n_y
this%dx = l_x/(n_x+1._RK)
this%dy = l_y/(n_y+1._RK)
allocate(this%x(0:n_x+1),this%y(0:n_y+1))
this%x(0) = x_min
do i = 1,n_x
this%x(i) = x_min + i*this%dx
end do
this%x(n_x+1) = x_max
this%y(0) = y_min
do i = 1,n_y
this%y(i) = y_min + i*this%dy
end do
this%y(n_y+1) = y_max
write(stdout,'(A,I5,A,I5)') 'Domain size: ',n_x,' x ',n_y
end subroutine init_mesh
end module mesh_mod