diff --git a/src/common/include/macros.fpp b/src/common/include/macros.fpp index fea730cbd..c1652388c 100644 --- a/src/common/include/macros.fpp +++ b/src/common/include/macros.fpp @@ -96,9 +96,6 @@ end if #:enddef -#define t_vec3 real(wp), dimension(1:3) -#define t_mat4x4 real(wp), dimension(1:4,1:4) - #:def ASSERT(predicate, message = None) if (.not. (${predicate}$)) then call s_mpi_abort("${_FILE_.split('/')[-1]}$:${_LINE_}$: "// & diff --git a/src/common/m_derived_types.fpp b/src/common/m_derived_types.fpp index 59156d1c1..efbf4b87e 100644 --- a/src/common/m_derived_types.fpp +++ b/src/common/m_derived_types.fpp @@ -141,13 +141,13 @@ module m_derived_types character(LEN=pathlen_max) :: filepath !< !! Path the STL file relative to case_dir. - t_vec3 :: translate !< + real(wp), dimension(1:3) :: translate !< !! Translation of the STL object. - t_vec3 :: scale !< + real(wp), dimension(1:3) :: scale !< !! Scale factor for the STL object. - t_vec3 :: rotate !< + real(wp), dimension(1:3) :: rotate !< !! Angle to rotate the STL object along each cartesian coordinate axis, !! in radians. @@ -160,17 +160,17 @@ module m_derived_types type :: t_triangle real(wp), dimension(1:3, 1:3) :: v ! Vertices of the triangle - t_vec3 :: n ! Normal vector + real(wp), dimension(1:3) :: n ! Normal vector end type t_triangle type :: t_ray - t_vec3 :: o ! Origin - t_vec3 :: d ! Direction + real(wp), dimension(1:3) :: o ! Origin + real(wp), dimension(1:3) :: d ! Direction end type t_ray type :: t_bbox - t_vec3 :: min ! Minimum coordinates - t_vec3 :: max ! Maximum coordinates + real(wp), dimension(1:3) :: min ! Minimum coordinates + real(wp), dimension(1:3) :: max ! Maximum coordinates end type t_bbox type :: t_model @@ -265,13 +265,13 @@ module m_derived_types character(LEN=pathlen_max) :: model_filepath !< !! Path the STL file relative to case_dir. - t_vec3 :: model_translate !< + real(wp), dimension(1:3) :: model_translate !< !! Translation of the STL object. - t_vec3 :: model_scale !< + real(wp), dimension(1:3) :: model_scale !< !! Scale factor for the STL object. - t_vec3 :: model_rotate !< + real(wp), dimension(1:3) :: model_rotate !< !! Angle to rotate the STL object along each cartesian coordinate axis, !! in radians. @@ -303,13 +303,13 @@ module m_derived_types character(LEN=pathlen_max) :: model_filepath !< !! Path the STL file relative to case_dir. - t_vec3 :: model_translate !< + real(wp), dimension(1:3) :: model_translate !< !! Translation of the STL object. - t_vec3 :: model_scale !< + real(wp), dimension(1:3) :: model_scale !< !! Scale factor for the STL object. - t_vec3 :: model_rotate !< + real(wp), dimension(1:3) :: model_rotate !< !! Angle to rotate the STL object along each cartesian coordinate axis, !! in radians. diff --git a/src/common/m_helper.fpp b/src/common/m_helper.fpp index f222e24d5..707174224 100644 --- a/src/common/m_helper.fpp +++ b/src/common/m_helper.fpp @@ -319,8 +319,8 @@ contains pure function f_create_transform_matrix(p, center) result(out_matrix) type(ic_model_parameters), intent(in) :: p - t_vec3, optional, intent(in) :: center - t_mat4x4 :: sc, rz, rx, ry, tr, t_back, t_to_origin, out_matrix + real(wp), dimension(1:3), optional, intent(in) :: center + real(wp), dimension(1:4, 1:4) :: sc, rz, rx, ry, tr, t_back, t_to_origin, out_matrix sc = transpose(reshape([ & p%scale(1), 0._wp, 0._wp, 0._wp, & @@ -379,8 +379,8 @@ contains !! @param matrix Transformation matrix. pure subroutine s_transform_vec(vec, matrix) - t_vec3, intent(inout) :: vec - t_mat4x4, intent(in) :: matrix + real(wp), dimension(1:3), intent(inout) :: vec + real(wp), dimension(1:4, 1:4), intent(in) :: matrix real(wp), dimension(1:4) :: tmp @@ -395,7 +395,7 @@ contains pure subroutine s_transform_triangle(triangle, matrix, matrix_n) type(t_triangle), intent(inout) :: triangle - t_mat4x4, intent(in) :: matrix, matrix_n + real(wp), dimension(1:4, 1:4), intent(in) :: matrix, matrix_n integer :: i @@ -413,7 +413,7 @@ contains pure subroutine s_transform_model(model, matrix, matrix_n) type(t_model), intent(inout) :: model - t_mat4x4, intent(in) :: matrix, matrix_n + real(wp), dimension(1:4, 1:4), intent(in) :: matrix, matrix_n integer :: i diff --git a/src/pre_process/m_model.fpp b/src/pre_process/m_model.fpp index 3b94f0c2e..734e83f4a 100644 --- a/src/pre_process/m_model.fpp +++ b/src/pre_process/m_model.fpp @@ -227,7 +227,7 @@ contains integer :: i, j, k, l, iunit, iostat, nVertices - t_vec3, allocatable :: vertices(:, :) + real(wp), dimension(1:3), allocatable :: vertices(:, :) character(80) :: line @@ -488,8 +488,8 @@ contains impure function f_model_is_inside(model, point, spacing, spc) result(fraction) type(t_model), intent(in) :: model - t_vec3, intent(in) :: point - t_vec3, intent(in) :: spacing + real(wp), dimension(1:3), intent(in) :: point + real(wp), dimension(1:3), intent(in) :: spacing integer, intent(in) :: spc real(wp) :: fraction @@ -727,7 +727,7 @@ contains logical, intent(inout) :: interpolate !< Logical indicator of interpolation integer, intent(in) :: boundary_edge_count !< Number of boundary edges real(wp), intent(in), dimension(1:boundary_edge_count, 1:3, 1:2) :: boundary_v - t_vec3, intent(in) :: spacing + real(wp), dimension(1:3), intent(in) :: spacing real(wp) :: l1, cell_width !< Length of each boundary edge and cell width integer :: j !< Boundary edge index iterator @@ -756,8 +756,8 @@ contains pure subroutine f_check_interpolation_3D(model, spacing, interpolate) logical, intent(inout) :: interpolate type(t_model), intent(in) :: model - t_vec3, intent(in) :: spacing - t_vec3 :: edge_l + real(wp), dimension(1:3), intent(in) :: spacing + real(wp), dimension(1:3) :: edge_l real(wp) :: cell_width real(wp), dimension(1:3, 1:3) :: tri_v integer :: i, j !< Loop iterator @@ -801,7 +801,7 @@ contains !! @param total_vertices Total number of vertices after interpolation pure subroutine f_interpolate_2D(boundary_v, boundary_edge_count, spacing, interpolated_boundary_v, total_vertices) real(wp), intent(in), dimension(:, :, :) :: boundary_v - t_vec3, intent(in) :: spacing + real(wp), dimension(1:3), intent(in) :: spacing real(wp), allocatable, intent(inout), dimension(:, :) :: interpolated_boundary_v integer, intent(inout) :: total_vertices, boundary_edge_count @@ -893,15 +893,15 @@ contains !! @param interpolated_boundary_v Output all the boundary vertices of the interpolated 3D model !! @param total_vertices Total number of vertices after interpolation impure subroutine f_interpolate_3D(model, spacing, interpolated_boundary_v, total_vertices) - t_vec3, intent(in) :: spacing + real(wp), dimension(1:3), intent(in) :: spacing type(t_model), intent(in) :: model real(wp), allocatable, intent(inout), dimension(:, :) :: interpolated_boundary_v integer, intent(out) :: total_vertices integer :: i, j, k, num_triangles, num_segments, num_inner_vertices real(wp), dimension(1:3, 1:3) :: tri - t_vec3 :: edge_del, cell_area - t_vec3 :: bary_coord !< Barycentric coordinates + real(wp), dimension(1:3) :: edge_del, cell_area + real(wp), dimension(1:3) :: bary_coord !< Barycentric coordinates real(wp) :: edge_length, cell_width, cell_area_min, tri_area ! Number of triangles in the model @@ -1044,15 +1044,15 @@ contains !! @param distance The output levelset distance pure subroutine f_distance_normals_3D(model, point, normals, distance) type(t_model), intent(IN) :: model - t_vec3, intent(in) :: point - t_vec3, intent(out) :: normals + real(wp), dimension(1:3), intent(in) :: point + real(wp), dimension(1:3), intent(out) :: normals real(wp), intent(out) :: distance real(wp), dimension(1:3, 1:3) :: tri real(wp) :: dist_min, dist_t_min real(wp) :: dist_min_normal, dist_buffer_normal - t_vec3 :: midp !< Centers of the triangle facets - t_vec3 :: dist_buffer !< Distance between the cell center and the vertices + real(wp), dimension(1:3) :: midp !< Centers of the triangle facets + real(wp), dimension(1:3) :: dist_buffer !< Distance between the cell center and the vertices integer :: i, j, tri_idx !< Iterator dist_min = 1.e12_wp @@ -1107,7 +1107,7 @@ contains pure function f_distance(boundary_v, boundary_edge_count, point) result(distance) integer, intent(in) :: boundary_edge_count real(wp), intent(in), dimension(1:boundary_edge_count, 1:3, 1:2) :: boundary_v - t_vec3, intent(in) :: point + real(wp), dimension(1:3), intent(in) :: point integer :: i real(wp) :: dist_buffer1, dist_buffer2 @@ -1137,8 +1137,8 @@ contains pure subroutine f_normals(boundary_v, boundary_edge_count, point, normals) integer, intent(in) :: boundary_edge_count real(wp), intent(in), dimension(1:boundary_edge_count, 1:3, 1:2) :: boundary_v - t_vec3, intent(in) :: point - t_vec3, intent(out) :: normals + real(wp), dimension(1:3), intent(in) :: point + real(wp), dimension(1:3), intent(out) :: normals integer :: i, idx_buffer real(wp) :: dist_min, dist_buffer @@ -1172,7 +1172,7 @@ contains pure subroutine f_tri_area(tri, tri_area) real(wp), dimension(1:3, 1:3), intent(in) :: tri real(wp), intent(out) :: tri_area - t_vec3 :: AB, AC, cross + real(wp), dimension(1:3) :: AB, AC, cross integer :: i !< Loop iterator do i = 1, 3 @@ -1195,7 +1195,7 @@ contains pure function f_interpolated_distance(interpolated_boundary_v, total_vertices, point) result(distance) integer, intent(in) :: total_vertices real(wp), intent(in), dimension(1:total_vertices, 1:3) :: interpolated_boundary_v - t_vec3, intent(in) :: point + real(wp), dimension(1:3), intent(in) :: point integer :: i !< Loop iterator real(wp) :: dist_buffer, min_dist diff --git a/src/pre_process/m_patches.fpp b/src/pre_process/m_patches.fpp index f7700e84a..00be2d00a 100644 --- a/src/pre_process/m_patches.fpp +++ b/src/pre_process/m_patches.fpp @@ -2160,14 +2160,14 @@ contains type(t_model) :: model type(ic_model_parameters) :: params - t_vec3 :: point, model_center + real(wp), dimension(1:3) :: point, model_center real(wp) :: grid_mm(1:3, 1:2) integer :: cell_num integer :: ncells - t_mat4x4 :: transform, transform_n + real(wp), dimension(1:4, 1:4) :: transform, transform_n if (present(ib) .and. proc_rank == 0) then print *, " * Reading model: "//trim(patch_ib(patch_id)%model_filepath) @@ -2402,8 +2402,8 @@ contains $:GPU_ROUTINE(parallelism='[seq]') - t_vec3, intent(in) :: cyl - t_vec3 :: cart + real(wp), dimension(1:3), intent(in) :: cyl + real(wp), dimension(1:3) :: cart cart = (/cyl(1), & cyl(2)*sin(cyl(3)), &