From 6babcb081f015ddba91f9c94b480f8b3f6f4d023 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 28 Dec 2024 18:53:29 -0500 Subject: [PATCH 01/19] fix subroutine names --- .github/workflows/lint-source.yml | 5 ++++- src/common/m_checker_common.fpp | 2 +- src/common/m_helper.fpp | 4 ++-- src/common/m_phase_change.fpp | 2 +- src/pre_process/m_assign_variables.fpp | 2 +- src/pre_process/m_model.fpp | 4 ++-- src/simulation/m_acoustic_src.fpp | 4 ++-- src/simulation/m_boundary_conditions.fpp | 2 +- src/simulation/m_fftw.fpp | 2 +- src/simulation/m_nvtx.f90 | 16 ++++++++-------- src/simulation/m_qbmm.fpp | 2 +- 11 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index aefd5495ab..a7ffb31aff 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -29,11 +29,14 @@ jobs: run: pip install fortitude-lint ansi2txt - name: Lint the source code - run: fortitude check --file-extensions=f90,fpp,fypp --ignore=E001,S001,S101,M011,F001,S041,T001,S101 ./src/** || true + run: fortitude check --file-extensions=f90,fpp,fypp --ignore=E001,S001,S101,M011,F001,S041,T001,S101,S102 ./src/** || true - name: Ensure kind is specified run: fortitude check --file-extensions=f90,fpp,fypp --select=P001 ./src/** + - name: Ensure subroutines are named + run: fortitude check --file-extensions=f90,fpp,fypp --select=S061 ./src/** + - name: No double precision intrinsics run: | ! grep -iR 'double_precision\|dsqrt\|dexp\|dlog\|dble\|dabs\|double\ precision\|real(8)\|real(4)\|dprod\|dmin\|dmax\|dfloat\|dreal\|dcos\|dsin\|dtan\|dsign\|dtanh\|dsinh\|dcosh\|d0' --exclude-dir=syscheck --exclude="*nvtx*" --exclude="*precision_select*" ./src/* diff --git a/src/common/m_checker_common.fpp b/src/common/m_checker_common.fpp index e8d6e1981d..2a1210ab66 100644 --- a/src/common/m_checker_common.fpp +++ b/src/common/m_checker_common.fpp @@ -130,7 +130,7 @@ contains @:PROHIBIT(adv_n .and. (.not. bubbles_euler)) @:PROHIBIT(adv_n .and. num_fluids /= 1) @:PROHIBIT(adv_n .and. qbmm) - end subroutine + end subroutine s_check_inputs_adv_n !> Checks constraints on the hypoelasticity parameters. !! Called by s_check_inputs_common for pre-processing and simulation diff --git a/src/common/m_helper.fpp b/src/common/m_helper.fpp index b290b5bbb3..d00439a9ba 100644 --- a/src/common/m_helper.fpp +++ b/src/common/m_helper.fpp @@ -101,7 +101,7 @@ contains end do write (*, fmt="(A1)") " " - end subroutine + end subroutine s_print_2D_array !> Initializes non-polydisperse bubble modeling subroutine s_initialize_nonpoly @@ -248,7 +248,7 @@ contains write (res, '(I0)') i res = trim(res) - end subroutine + end subroutine s_int_to_str !> Computes the Simpson weights for quadrature subroutine s_simpson diff --git a/src/common/m_phase_change.fpp b/src/common/m_phase_change.fpp index faa554bfec..f6a0e16665 100644 --- a/src/common/m_phase_change.fpp +++ b/src/common/m_phase_change.fpp @@ -794,7 +794,7 @@ contains !> This subroutine finalizes the phase change module subroutine s_finalize_relaxation_solver_module - end subroutine + end subroutine s_finalize_relaxation_solver_module #endif diff --git a/src/pre_process/m_assign_variables.fpp b/src/pre_process/m_assign_variables.fpp index b6304949d0..edb636ad2b 100644 --- a/src/pre_process/m_assign_variables.fpp +++ b/src/pre_process/m_assign_variables.fpp @@ -692,4 +692,4 @@ contains end subroutine s_finalize_assign_variables_module -end module +end module m_assign_variables diff --git a/src/pre_process/m_model.fpp b/src/pre_process/m_model.fpp index 1e8df1621d..89d10ed53a 100644 --- a/src/pre_process/m_model.fpp +++ b/src/pre_process/m_model.fpp @@ -215,7 +215,7 @@ contains call s_read_stl_binary(filepath, model) end if - end subroutine + end subroutine s_read_stl !> This procedure reads an OBJ file. !! @param filepath Path to the odj file. @@ -291,7 +291,7 @@ contains close (iunit) - end subroutine + end subroutine s_read_obj !> This procedure reads a mesh from a file. !! @param filepath Path to the file to read. diff --git a/src/simulation/m_acoustic_src.fpp b/src/simulation/m_acoustic_src.fpp index 27901561d9..eea8368457 100644 --- a/src/simulation/m_acoustic_src.fpp +++ b/src/simulation/m_acoustic_src.fpp @@ -329,7 +329,7 @@ contains end do end do end do - end subroutine + end subroutine s_acoustic_src_calculations !> This subroutine gives the temporally varying amplitude of the pulse !! @param sim_time Simulation time @@ -487,7 +487,7 @@ contains end do #endif - end subroutine + end subroutine s_precalculate_acoustic_spatial_sources !> This subroutine gives the spatial support of the acoustic source !! @param j x-index diff --git a/src/simulation/m_boundary_conditions.fpp b/src/simulation/m_boundary_conditions.fpp index b541a34d12..073c62d072 100644 --- a/src/simulation/m_boundary_conditions.fpp +++ b/src/simulation/m_boundary_conditions.fpp @@ -1376,7 +1376,7 @@ contains end if - end subroutine + end subroutine s_qbmm_extrapolation subroutine s_populate_capillary_buffers(c_divs) diff --git a/src/simulation/m_fftw.fpp b/src/simulation/m_fftw.fpp index fbc529d180..e50e7e3215 100644 --- a/src/simulation/m_fftw.fpp +++ b/src/simulation/m_fftw.fpp @@ -322,4 +322,4 @@ contains end subroutine s_finalize_fftw_module -end module +end module m_fftw diff --git a/src/simulation/m_nvtx.f90 b/src/simulation/m_nvtx.f90 index 2a49731f56..e2a493a497 100644 --- a/src/simulation/m_nvtx.f90 +++ b/src/simulation/m_nvtx.f90 @@ -23,7 +23,7 @@ module m_nvtx integer(c_int64_t) :: payload ! union uint,int,double integer(c_int) :: messageType = 1 ! NVTX_MESSAGE_TYPE_ASCII = 1 type(c_ptr) :: message ! ascii char - end type + end type nvtxEventAttributes #if defined(MFC_OpenACC) && defined(__PGI) @@ -33,7 +33,7 @@ subroutine nvtxRangePushA(name) bind(C, name='nvtxRangePushA') use iso_c_binding character(kind=c_char, len=*) :: name - end subroutine + end subroutine nvtxRangePushA ! push range with custom label and custom color subroutine nvtxRangePushEx(event) bind(C, name='nvtxRangePushEx') @@ -41,13 +41,13 @@ subroutine nvtxRangePushEx(event) bind(C, name='nvtxRangePushEx') import :: nvtxEventAttributes type(nvtxEventAttributes) :: event - end subroutine - end interface + end subroutine nvtxRangePushEx + end interface nvtxRangePush interface nvtxRangePop subroutine nvtxRangePop() bind(C, name='nvtxRangePop') - end subroutine - end interface + end subroutine nvtxRangePop + end interface nvtxRangePop #endif @@ -71,12 +71,12 @@ subroutine nvtxStartRange(name, id) end if #endif - end subroutine + end subroutine nvtxStartRange subroutine nvtxEndRange #if defined(MFC_OpenACC) && defined(__PGI) call nvtxRangePop #endif - end subroutine + end subroutine nvtxEndRange end module m_nvtx diff --git a/src/simulation/m_qbmm.fpp b/src/simulation/m_qbmm.fpp index 3c111c4fb1..4a23839afb 100644 --- a/src/simulation/m_qbmm.fpp +++ b/src/simulation/m_qbmm.fpp @@ -675,7 +675,7 @@ contains end if - end subroutine + end subroutine s_compute_qbmm_rhs !Coefficient array for non-polytropic model (pb and mv values are accounted in wght_pb and wght_mv) From cef8ddb326cee33a4d6b93ed185f7e22123986a5 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 28 Dec 2024 19:09:15 -0500 Subject: [PATCH 02/19] more fixes --- .github/workflows/lint-source.yml | 2 +- src/common/m_mpi_common.fpp | 1 - src/post_process/m_data_input.f90 | 2 ++ src/pre_process/include/2dHardcodedIC.fpp | 8 ++++---- src/pre_process/include/3dHardcodedIC.fpp | 4 ++-- src/pre_process/m_grid.f90 | 2 -- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index a7ffb31aff..0b8a2bca89 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -29,7 +29,7 @@ jobs: run: pip install fortitude-lint ansi2txt - name: Lint the source code - run: fortitude check --file-extensions=f90,fpp,fypp --ignore=E001,S001,S101,M011,F001,S041,T001,S101,S102 ./src/** || true + run: fortitude check --file-extensions=f90,fpp,fypp --ignore=E001,S001,S101,M011,F001,S041,T001,S101,S102,T002,T011 ./src/** || true - name: Ensure kind is specified run: fortitude check --file-extensions=f90,fpp,fypp --select=P001 ./src/** diff --git a/src/common/m_mpi_common.fpp b/src/common/m_mpi_common.fpp index c13709c0bd..405da58774 100644 --- a/src/common/m_mpi_common.fpp +++ b/src/common/m_mpi_common.fpp @@ -234,7 +234,6 @@ contains subroutine s_mpi_gather_data(my_vector, counts, gathered_vector, root) - implicit none integer, intent(in) :: counts ! Array of vector lengths for each process real(wp), intent(in), dimension(counts) :: my_vector ! Input vector on each process integer, intent(in) :: root ! Rank of the root process diff --git a/src/post_process/m_data_input.f90 b/src/post_process/m_data_input.f90 index 0f28032fc6..50a662f179 100644 --- a/src/post_process/m_data_input.f90 +++ b/src/post_process/m_data_input.f90 @@ -37,6 +37,8 @@ module m_data_input !! @param t_step Current time-step to input subroutine s_read_abstract_data_files(t_step) + implicit none + integer, intent(in) :: t_step end subroutine s_read_abstract_data_files diff --git a/src/pre_process/include/2dHardcodedIC.fpp b/src/pre_process/include/2dHardcodedIC.fpp index 5732acbd3e..1505b99b42 100644 --- a/src/pre_process/include/2dHardcodedIC.fpp +++ b/src/pre_process/include/2dHardcodedIC.fpp @@ -100,8 +100,8 @@ end if case (205) ! 2D lung wave interaction problem - h = 0.0 !non dim origin y - lam = 1.0 !non dim lambda + h = 0.0_wp !non dim origin y + lam = 1.0_wp !non dim lambda amp = patch_icpp(patch_id)%a(2) !to be changed later! !non dim amplitude intH = amp*sin(2*pi*x_cc(i)/lam - pi/2) + h @@ -115,8 +115,8 @@ end if case (206) ! 2D lung wave interaction problem - horizontal domain - h = 0.0 !non dim origin y - lam = 1.0 !non dim lambda + h = 0.0_wp !non dim origin y + lam = 1.0_wp !non dim lambda amp = patch_icpp(patch_id)%a(2) intL = amp*sin(2*pi*y_cc(j)/lam - pi/2) + h diff --git a/src/pre_process/include/3dHardcodedIC.fpp b/src/pre_process/include/3dHardcodedIC.fpp index 5cf1f08eff..e0018598a7 100644 --- a/src/pre_process/include/3dHardcodedIC.fpp +++ b/src/pre_process/include/3dHardcodedIC.fpp @@ -44,8 +44,8 @@ end if case (301) ! (3D lung geometry in X direction, |sin(*)+sin(*)|) - h = 0.0 - lam = 1.0 + h = 0.0_wp + lam = 1.0_wp amp = patch_icpp(patch_id)%a(2) intH = amp*abs((sin(2*pi*y_cc(j)/lam - pi/2) + sin(2*pi*z_cc(k)/lam - pi/2)) + h) if (x_cc(i) > intH) then diff --git a/src/pre_process/m_grid.f90 b/src/pre_process/m_grid.f90 index 0f92e8f22d..3afd8e85d3 100644 --- a/src/pre_process/m_grid.f90 +++ b/src/pre_process/m_grid.f90 @@ -37,8 +37,6 @@ module m_grid subroutine s_generate_abstract_grid - ! integer, intent(IN), optional :: dummy - end subroutine s_generate_abstract_grid end interface From 92352ca7fd21ae53c1f4d65b810e16f665c5fbfe Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 28 Dec 2024 19:21:58 -0500 Subject: [PATCH 03/19] helping --- src/simulation/m_fftw.fpp | 2 +- src/simulation/m_sim_helpers.f90 | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/simulation/m_fftw.fpp b/src/simulation/m_fftw.fpp index e50e7e3215..4adae18b14 100644 --- a/src/simulation/m_fftw.fpp +++ b/src/simulation/m_fftw.fpp @@ -322,4 +322,4 @@ contains end subroutine s_finalize_fftw_module -end module m_fftw +end module m_fftw diff --git a/src/simulation/m_sim_helpers.f90 b/src/simulation/m_sim_helpers.f90 index fdb387cbc5..97363cdb91 100644 --- a/src/simulation/m_sim_helpers.f90 +++ b/src/simulation/m_sim_helpers.f90 @@ -35,15 +35,17 @@ subroutine s_compute_enthalpy(q_prim_vf, pres, rho, gamma, pi_inf, Re, H, alpha, !$acc routine seq #endif - type(scalar_field), dimension(sys_size) :: q_prim_vf - real(wp), dimension(num_fluids) :: alpha_rho - real(wp), dimension(num_fluids) :: alpha - real(wp), dimension(num_dims) :: vel - real(wp) :: rho, gamma, pi_inf, qv, vel_sum, E, H, pres + type(scalar_field), intent(in), dimension(sys_size) :: q_prim_vf + real(wp), intent(inout), dimension(num_fluids) :: alpha + real(wp), intent(inout), dimension(num_dims) :: vel + real(wp), intent(inout) :: rho, gamma, pi_inf, vel_sum, H, pres + integer, intent(in) :: j, k, l + + real(wp), dimension(num_fluids) :: alpha_rho, Gs real(wp), dimension(2) :: Re - real(wp) :: G !< Cell-avg. fluid shear modulus - real(wp), dimension(num_fluids) :: Gs !< Cell-avg. fluid shear moduli - integer :: i, j, k, l + real(wp) :: qv, E, G + + integer :: i !$acc loop seq do i = 1, num_fluids From 1974870ed4b1f2d2b47d525e989b84313e7ab7e0 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 28 Dec 2024 19:33:11 -0500 Subject: [PATCH 04/19] some intent --- src/simulation/m_sim_helpers.f90 | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/simulation/m_sim_helpers.f90 b/src/simulation/m_sim_helpers.f90 index 97363cdb91..0c6f95a672 100644 --- a/src/simulation/m_sim_helpers.f90 +++ b/src/simulation/m_sim_helpers.f90 @@ -40,9 +40,9 @@ subroutine s_compute_enthalpy(q_prim_vf, pres, rho, gamma, pi_inf, Re, H, alpha, real(wp), intent(inout), dimension(num_dims) :: vel real(wp), intent(inout) :: rho, gamma, pi_inf, vel_sum, H, pres integer, intent(in) :: j, k, l + real(wp), dimension(2), intent(inout) :: Re real(wp), dimension(num_fluids) :: alpha_rho, Gs - real(wp), dimension(2) :: Re real(wp) :: qv, E, G integer :: i @@ -98,15 +98,16 @@ end subroutine s_compute_enthalpy !! @param Rc_sf (optional) cell centered Rc subroutine s_compute_stability_from_dt(vel, c, rho, Re_l, j, k, l, icfl_sf, vcfl_sf, Rc_sf) !$acc routine seq - real(wp), dimension(num_dims) :: vel - real(wp) :: c, rho - real(wp), dimension(0:m, 0:n, 0:p) :: icfl_sf - real(wp), dimension(0:m, 0:n, 0:p), optional :: vcfl_sf, Rc_sf + real(wp), intent(in), dimension(num_dims) :: vel + real(wp), intent(in) :: c, rho + real(wp), dimension(0:m, 0:n, 0:p), intent(inout) :: icfl_sf + real(wp), dimension(0:m, 0:n, 0:p), intent(inout), optional :: vcfl_sf, Rc_sf + real(wp), dimension(2), intent(in) :: Re_l + integer, intent(in) :: j, k, l + real(wp) :: fltr_dtheta !< !! Modified dtheta accounting for Fourier filtering in azimuthal direction. - integer :: j, k, l integer :: Nfq - real(wp), dimension(2) :: Re_l if (grid_geometry == 3) then if (k == 0) then @@ -194,14 +195,17 @@ end subroutine s_compute_stability_from_dt !! @param l z coordinate subroutine s_compute_dt_from_cfl(vel, c, max_dt, rho, Re_l, j, k, l) !$acc routine seq - real(wp), dimension(num_dims) :: vel - real(wp) :: c, icfl_dt, vcfl_dt, rho - real(wp), dimension(0:m, 0:n, 0:p) :: max_dt + real(wp), dimension(num_dims), intent(in) :: vel + real(wp), intent(in) :: c, rho + real(wp), dimension(0:m, 0:n, 0:p), intent(inout) :: max_dt + real(wp), dimension(2), intent(in) :: Re_l + integer, intent(in) :: j, k, l + + real(wp) :: icfl_dt, vcfl_dt real(wp) :: fltr_dtheta !< !! Modified dtheta accounting for Fourier filtering in azimuthal direction. - integer :: j, k, l + integer :: Nfq - real(wp), dimension(2) :: Re_l if (grid_geometry == 3) then if (k == 0) then From 48aa981248dc1d49b3f3f7a239ed2c1bf6e1e275 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 28 Dec 2024 19:51:40 -0500 Subject: [PATCH 05/19] more intent --- src/pre_process/m_compute_levelset.fpp | 2 +- src/pre_process/m_model.fpp | 7 +++++-- src/pre_process/m_patches.fpp | 2 +- src/pre_process/m_perturbation.fpp | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pre_process/m_compute_levelset.fpp b/src/pre_process/m_compute_levelset.fpp index 3caad2cddd..d339157be6 100644 --- a/src/pre_process/m_compute_levelset.fpp +++ b/src/pre_process/m_compute_levelset.fpp @@ -261,7 +261,7 @@ contains type(levelset_field), intent(INOUT) :: levelset type(levelset_norm_field), intent(INOUT) :: levelset_norm - integer :: ib_patch_id + integer, intent(in) :: ib_patch_id real(wp) :: top_right(2), bottom_left(2) real(wp) :: x, y, min_dist real(wp) :: side_dists(4) diff --git a/src/pre_process/m_model.fpp b/src/pre_process/m_model.fpp index 89d10ed53a..bbd50e52bd 100644 --- a/src/pre_process/m_model.fpp +++ b/src/pre_process/m_model.fpp @@ -709,7 +709,7 @@ contains integer, intent(inout) :: edge_index !< Edge index iterator integer, intent(inout) :: edge_count !< Total number of edges real(wp), intent(in), dimension(1:2, 1:2) :: edge !< Edges end points to be registered - real(wp), dimension(1:edge_count, 1:2, 1:2) :: temp_boundary_v !< Temporary edge end vertex buffer + real(wp), dimension(1:edge_count, 1:2, 1:2), intent(inout) :: temp_boundary_v !< Temporary edge end vertex buffer ! Increment edge index and store the edge edge_index = edge_index + 1 @@ -804,7 +804,10 @@ contains t_vec3, intent(in) :: spacing real(wp), allocatable, intent(inout), dimension(:, :) :: interpolated_boundary_v - integer :: i, j, num_segments, total_vertices, boundary_edge_count + integer, intent(inout) :: total_vertices, boundary_edge_count + integer :: num_segments + integer :: i, j + real(wp) :: edge_length, cell_width real(wp), dimension(1:2) :: edge_x, edge_y, edge_del real(wp), allocatable :: temp_boundary_v(:, :) diff --git a/src/pre_process/m_patches.fpp b/src/pre_process/m_patches.fpp index 0afee832ed..39e354cb9e 100644 --- a/src/pre_process/m_patches.fpp +++ b/src/pre_process/m_patches.fpp @@ -1406,7 +1406,7 @@ contains integer, intent(IN) :: patch_id integer, intent(INOUT), dimension(0:m, 0:n, 0:p) :: patch_id_fp - type(scalar_field), dimension(1:sys_size) :: q_prim_vf + type(scalar_field), dimension(1:sys_size), intent(inout) :: q_prim_vf real(wp) :: r, x_p, eps, phi real(wp), dimension(2:9) :: as, Ps diff --git a/src/pre_process/m_perturbation.fpp b/src/pre_process/m_perturbation.fpp index 5f92628914..ccb1b6175a 100644 --- a/src/pre_process/m_perturbation.fpp +++ b/src/pre_process/m_perturbation.fpp @@ -223,7 +223,7 @@ contains subroutine s_instability_wave(alpha, beta, wave, shift) real(wp), intent(in) :: alpha, beta !< spatial wavenumbers real(wp), dimension(mixlayer_nvar, 0:m, 0:n, 0:p), intent(inout) :: wave !< instability wave - real(wp) :: shift !< phase shift + real(wp), intent(in) :: shift !< phase shift real(wp), dimension(0:nbp - 1) :: u_mean !< mean density and velocity profiles real(wp) :: rho_mean, p_mean !< mean density and pressure real(wp), dimension(0:nbp - 1, 0:nbp - 1) :: d !< differential operator in y dir From aa3b39ea8eaf7ba7ae25b1470c4eb20e874921f3 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 28 Dec 2024 20:03:34 -0500 Subject: [PATCH 06/19] last intent --- src/simulation/m_bubbles_EL.fpp | 16 +++++++++------- src/simulation/m_qbmm.fpp | 2 +- src/simulation/m_surface_tension.fpp | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/simulation/m_bubbles_EL.fpp b/src/simulation/m_bubbles_EL.fpp index 170bfe765e..b48f941a39 100644 --- a/src/simulation/m_bubbles_EL.fpp +++ b/src/simulation/m_bubbles_EL.fpp @@ -401,7 +401,7 @@ contains !! @param save_count File identifier subroutine s_restart_bubbles(bub_id, save_count) - integer :: bub_id, save_count + integer, intent(inout) :: bub_id, save_count character(LEN=path_len + 2*name_len) :: file_loc @@ -1460,7 +1460,7 @@ contains function particle_in_domain(pos_part) logical :: particle_in_domain - real(wp), dimension(3) :: pos_part + real(wp), dimension(3), intent(in) :: pos_part ! 2D if (p == 0 .and. cyl_coord .neqv. .true.) then @@ -1513,7 +1513,7 @@ contains function particle_in_domain_physical(pos_part) logical :: particle_in_domain_physical - real(wp), dimension(3) :: pos_part + real(wp), dimension(3), intent(in) :: pos_part particle_in_domain_physical = ((pos_part(1) < x_cb(m)) .and. (pos_part(1) >= x_cb(-1)) .and. & (pos_part(2) < y_cb(n)) .and. (pos_part(2) >= y_cb(-1))) @@ -1589,7 +1589,7 @@ contains !! @param q_time Current time subroutine s_write_lag_particles(qtime) - real(wp) :: qtime + real(wp), intent(in) :: qtime integer :: k character(LEN=path_len + 2*name_len) :: file_loc @@ -1631,7 +1631,8 @@ contains !! @param q_time Current time subroutine s_write_void_evol(qtime) - real(wp) :: qtime, volcell, voltot + real(wp), intent(in) :: qtime + real(wp) :: volcell, voltot real(wp) :: lag_void_max, lag_void_avg, lag_vol real(wp) :: void_max_glb, void_avg_glb, vol_glb @@ -1704,11 +1705,12 @@ contains subroutine s_write_restart_lag_bubbles(t_step) ! Generic string used to store the address of a particular file + integer, intent(in) :: t_step + character(LEN=path_len + 2*name_len) :: file_loc logical :: file_exist - - integer :: i, k, t_step integer :: bub_id, tot_part, tot_part_wrtn, npart_wrtn + integer :: i, k #ifdef MFC_MPI ! For Parallel I/O diff --git a/src/simulation/m_qbmm.fpp b/src/simulation/m_qbmm.fpp index 4a23839afb..11298e4f71 100644 --- a/src/simulation/m_qbmm.fpp +++ b/src/simulation/m_qbmm.fpp @@ -823,7 +823,7 @@ contains real(wp), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: pb, rhs_pb real(wp), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: mv, rhs_mv type(int_bounds_info), intent(in) :: ix, iy, iz - real(wp), dimension(startx:, starty:, startz:) :: nbub_sc !> Unused Variable not sure what to put as intent + real(wp), dimension(startx:, starty:, startz:), intent(inout) :: nbub_sc real(wp), dimension(nmom) :: moms, msum real(wp), dimension(nnode, nb) :: wght, abscX, abscY, wght_pb, wght_mv, wght_ht, ht diff --git a/src/simulation/m_surface_tension.fpp b/src/simulation/m_surface_tension.fpp index 0f9a24a51a..06b230c60e 100644 --- a/src/simulation/m_surface_tension.fpp +++ b/src/simulation/m_surface_tension.fpp @@ -70,7 +70,7 @@ contains flux_src_vf, & id, isx, isy, isz) - type(scalar_field), dimension(sys_size) :: q_prim_vf !> unused so unsure what intent to give it + type(scalar_field), dimension(sys_size), intent(in) :: q_prim_vf real(wp), dimension(-1:, 0:, 0:, 1:), intent(in) :: vSrc_rsx_vf real(wp), dimension(-1:, 0:, 0:, 1:), intent(in) :: vSrc_rsy_vf real(wp), dimension(-1:, 0:, 0:, 1:), intent(in) :: vSrc_rsz_vf From aa390de86067f1bfa1953db6c34b087b0cb99f59 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 10:05:14 -0500 Subject: [PATCH 07/19] clean parameters --- src/common/m_helper.fpp | 2 +- src/common/m_variables_conversion.fpp | 4 +++- src/pre_process/m_data_output.fpp | 2 +- src/pre_process/m_patches.fpp | 2 +- src/simulation/m_data_output.fpp | 2 +- src/simulation/m_hyperelastic.fpp | 4 ++-- src/simulation/m_start_up.fpp | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/common/m_helper.fpp b/src/common/m_helper.fpp index d00439a9ba..0d849dbf68 100644 --- a/src/common/m_helper.fpp +++ b/src/common/m_helper.fpp @@ -244,7 +244,7 @@ contains subroutine s_int_to_str(i, res) integer, intent(in) :: i - character(len=*), intent(out) :: res + character(len=*), intent(inout) :: res write (res, '(I0)') i res = trim(res) diff --git a/src/common/m_variables_conversion.fpp b/src/common/m_variables_conversion.fpp index de910fc5f0..17d644259b 100644 --- a/src/common/m_variables_conversion.fpp +++ b/src/common/m_variables_conversion.fpp @@ -1081,7 +1081,7 @@ contains real(wp) :: dyn_pres real(wp) :: nbub, R3, vftmp, R3tmp real(wp), dimension(nb) :: Rtmp - real(wp) :: G = 0._wp + real(wp) :: G real(wp), dimension(2) :: Re_K integer :: i, j, k, l, q !< Generic loop iterators @@ -1090,6 +1090,8 @@ contains real(wp), dimension(num_species) :: Ys real(wp) :: e_mix, mix_mol_weight, T + G = 0._wp + #ifndef MFC_SIMULATION ! Converting the primitive variables to the conservative variables do l = 0, p diff --git a/src/pre_process/m_data_output.fpp b/src/pre_process/m_data_output.fpp index 4d194c5bf3..32b51e648c 100644 --- a/src/pre_process/m_data_output.fpp +++ b/src/pre_process/m_data_output.fpp @@ -831,7 +831,7 @@ contains ! Generic string used to store the address of a particular file character(LEN=len_trim(case_dir) + 2*name_len) :: file_loc character(len=15) :: temp - character(LEN=1), dimension(3) :: coord = (/'x', 'y', 'z'/) + character(LEN=1), dimension(3), parameter :: coord = (/'x', 'y', 'z'/) ! Generic logical used to check the existence of directories logical :: dir_check diff --git a/src/pre_process/m_patches.fpp b/src/pre_process/m_patches.fpp index 39e354cb9e..2a2ef17974 100644 --- a/src/pre_process/m_patches.fpp +++ b/src/pre_process/m_patches.fpp @@ -1416,7 +1416,7 @@ contains integer :: i, j, k !< generic loop iterators real(wp) :: epsilon, beta - complex(wp) :: cmplx_i = (0._wp, 1._wp) + complex(wp), parameter :: cmplx_i = (0._wp, 1._wp) complex(wp) :: H ! Transferring the patch's centroid and radius information diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 6417dc7975..c2e6ddba27 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -110,7 +110,7 @@ contains !! time-step. subroutine s_open_run_time_information_file - character(LEN=name_len) :: file_name = 'run_time.inf' !< + character(LEN=name_len), parameter :: file_name = 'run_time.inf' !< !! Name of the run-time information file character(LEN=path_len + name_len) :: file_path !< diff --git a/src/simulation/m_hyperelastic.fpp b/src/simulation/m_hyperelastic.fpp index 5af5508c9a..46addb7685 100644 --- a/src/simulation/m_hyperelastic.fpp +++ b/src/simulation/m_hyperelastic.fpp @@ -227,7 +227,7 @@ contains integer, intent(in) :: j, k, l real(wp) :: trace - real(wp) :: f13 = 1_wp/3_wp + real(wp), parameter :: f13 = 1._wp/3._wp integer :: i !< Generic loop iterators ! tensor is the symmetric tensor & calculate the trace of the tensor @@ -266,7 +266,7 @@ contains integer, intent(in) :: j, k, l real(wp) :: trace - real(wp) :: f13 = 1_wp/3_wp + real(wp), parameter :: f13 = 1._wp/3._wp integer :: i !< Generic loop iterators !TODO Make this 1D and 2D capable diff --git a/src/simulation/m_start_up.fpp b/src/simulation/m_start_up.fpp index 6be30adc68..547502ff66 100644 --- a/src/simulation/m_start_up.fpp +++ b/src/simulation/m_start_up.fpp @@ -125,7 +125,7 @@ contains subroutine s_read_input_file ! Relative path to the input file provided by the user - character(LEN=name_len) :: file_path = './simulation.inp' + character(LEN=name_len), parameter :: file_path = './simulation.inp' logical :: file_exist !< !! Logical used to check the existence of the input file From 97db159114b065735a0b6df7058ca22ceba16c8f Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 10:58:16 -0500 Subject: [PATCH 08/19] toml and lint in CI --- .fortitude.toml | 5 +++++ .github/workflows/lint-source.yml | 14 ++++++++++---- src/post_process/m_data_output.fpp | 17 +---------------- toolchain/pyproject.toml | 2 ++ 4 files changed, 18 insertions(+), 20 deletions(-) create mode 100644 .fortitude.toml diff --git a/.fortitude.toml b/.fortitude.toml new file mode 100644 index 0000000000..c971773352 --- /dev/null +++ b/.fortitude.toml @@ -0,0 +1,5 @@ +[check] +# Ignored Rules and justification: +ignore = ["E001","S001","S101","M011","F001","S041","T001","S101","S102","T002","T011","T042","M001"] +file-extensions = ["f90","fpp","fypp"] +line-length = 5000 diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index 0b8a2bca89..58280b7c1c 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -25,11 +25,17 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Fortitude - run: pip install fortitude-lint ansi2txt + - name: Initialize MFC + run: ./mfc.sh init - - name: Lint the source code - run: fortitude check --file-extensions=f90,fpp,fypp --ignore=E001,S001,S101,M011,F001,S041,T001,S101,S102,T002,T011 ./src/** || true + # - name: Lint the source code + # run: fortitude check --file-extensions=f90,fpp,fypp --ignore=E001,S001,S101,M011,F001,S041,T001,S101,S102,T002,T011 ./src/** || true + + - name: Lint the full source + run: | + alias lintsource='find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \;' | + lintsource | + lintsource | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' - name: Ensure kind is specified run: fortitude check --file-extensions=f90,fpp,fypp --select=P001 ./src/** diff --git a/src/post_process/m_data_output.fpp b/src/post_process/m_data_output.fpp index fbe6c051b3..5faf15f597 100644 --- a/src/post_process/m_data_output.fpp +++ b/src/post_process/m_data_output.fpp @@ -50,6 +50,7 @@ module m_data_output real(wp), allocatable, dimension(:, :, :), public :: q_sf real(wp), allocatable, dimension(:, :, :) :: q_root_sf real(wp), allocatable, dimension(:, :, :) :: cyl_q_sf + ! Single precision storage for flow variables real(sp), allocatable, dimension(:, :, :), public :: q_sf_s real(sp), allocatable, dimension(:, :, :) :: q_root_sf_s @@ -219,10 +220,6 @@ contains file_loc = trim(proc_rank_dir)//'/.' - !INQUIRE( DIRECTORY = TRIM(file_loc), & ! Intel compiler - !EXIST = dir_check ) - ! INQUIRE( FILE = TRIM(file_loc), & ! NAG/PGI/GCC compiler - ! EXIST = dir_check ) call my_inquire(file_loc, dir_check) if (dir_check .neqv. .true.) then call s_create_directory(trim(proc_rank_dir)) @@ -235,10 +232,6 @@ contains file_loc = trim(rootdir)//'/.' - !INQUIRE( DIRECTORY = TRIM(file_loc), & ! Intel compiler - ! EXIST = dir_check ) - ! INQUIRE( FILE = TRIM(file_loc), & ! NAG/PGI/GCC compiler - ! EXIST = dir_check ) call my_inquire(file_loc, dir_check) if (dir_check .neqv. .true.) then call s_create_directory(trim(rootdir)) @@ -259,10 +252,6 @@ contains file_loc = trim(proc_rank_dir)//'/.' - !INQUIRE( DIRECTORY = TRIM(file_loc), & ! Intel compiler - ! EXIST = dir_check ) - ! INQUIRE( FILE = TRIM(file_loc), & ! NAG/PGI/GCC compiler - ! EXIST = dir_check ) call my_inquire(file_loc, dir_check) if (dir_check .neqv. .true.) then @@ -276,10 +265,6 @@ contains file_loc = trim(rootdir)//'/.' - !INQUIRE( DIRECTORY = TRIM(file_loc), & ! Intel compiler - ! EXIST = dir_check ) - ! INQUIRE( FILE = TRIM(file_loc), & ! NAG/PGI/GCC compiler - ! EXIST = dir_check ) call my_inquire(file_loc, dir_check) if (dir_check .neqv. .true.) then diff --git a/toolchain/pyproject.toml b/toolchain/pyproject.toml index 0ede6a15c4..4af0412249 100644 --- a/toolchain/pyproject.toml +++ b/toolchain/pyproject.toml @@ -26,6 +26,8 @@ dependencies = [ "pylint", "fprettify", "black", + "fortitude-lint", + "ansi2txt", # Profiling "numpy", From 42367e218d50eb4183e5198974d167d9205ebff3 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 11:00:19 -0500 Subject: [PATCH 09/19] clean --- .github/workflows/lint-source.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index 58280b7c1c..bef19e88b1 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -28,9 +28,6 @@ jobs: - name: Initialize MFC run: ./mfc.sh init - # - name: Lint the source code - # run: fortitude check --file-extensions=f90,fpp,fypp --ignore=E001,S001,S101,M011,F001,S041,T001,S101,S102,T002,T011 ./src/** || true - - name: Lint the full source run: | alias lintsource='find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \;' | From 14ff8ecca5355bdfedd2bbae3df4c3de35de4fea Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 11:03:45 -0500 Subject: [PATCH 10/19] fix --- .github/workflows/lint-source.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index bef19e88b1..c3d9047475 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -30,16 +30,11 @@ jobs: - name: Lint the full source run: | + shopt -s expand_aliases alias lintsource='find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \;' | lintsource | lintsource | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' - - name: Ensure kind is specified - run: fortitude check --file-extensions=f90,fpp,fypp --select=P001 ./src/** - - - name: Ensure subroutines are named - run: fortitude check --file-extensions=f90,fpp,fypp --select=S061 ./src/** - - name: No double precision intrinsics run: | ! grep -iR 'double_precision\|dsqrt\|dexp\|dlog\|dble\|dabs\|double\ precision\|real(8)\|real(4)\|dprod\|dmin\|dmax\|dfloat\|dreal\|dcos\|dsin\|dtan\|dsign\|dtanh\|dsinh\|dcosh\|d0' --exclude-dir=syscheck --exclude="*nvtx*" --exclude="*precision_select*" ./src/* From 804d755d307d53e0d74f895045c35e4555cbf57b Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 11:05:48 -0500 Subject: [PATCH 11/19] fix? --- .github/workflows/lint-source.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index c3d9047475..291198551d 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -31,8 +31,8 @@ jobs: - name: Lint the full source run: | shopt -s expand_aliases - alias lintsource='find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \;' | - lintsource | + alias lintsource='find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \;' + lintsource lintsource | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' - name: No double precision intrinsics From 0805659904fa8dbade372941d78c48faefe2c72c Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 11:09:01 -0500 Subject: [PATCH 12/19] fix? --- .github/workflows/lint-source.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index 291198551d..7bad08db00 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -30,10 +30,9 @@ jobs: - name: Lint the full source run: | - shopt -s expand_aliases - alias lintsource='find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \;' - lintsource - lintsource | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' + pip install fortitude ansi2txt + find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \; + find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \; | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' - name: No double precision intrinsics run: | From 30336d1206a5a0f254c4a717ba45747caf954ad8 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 11:21:13 -0500 Subject: [PATCH 13/19] fix --- .github/workflows/lint-source.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index 7bad08db00..2f93741b50 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -31,8 +31,8 @@ jobs: - name: Lint the full source run: | pip install fortitude ansi2txt - find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \; - find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \; | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' + find ./src -type f -not -name '*nvtx*' -exec fortitude check {} \; + find ./src -type f -not -name '*nvtx*' -exec fortitude check {} \; | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' - name: No double precision intrinsics run: | From cb289a98323f637596b569162d4682399293ade5 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 11:38:36 -0500 Subject: [PATCH 14/19] enter venv --- .github/workflows/lint-source.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index 2f93741b50..6741084e06 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -30,9 +30,9 @@ jobs: - name: Lint the full source run: | - pip install fortitude ansi2txt - find ./src -type f -not -name '*nvtx*' -exec fortitude check {} \; - find ./src -type f -not -name '*nvtx*' -exec fortitude check {} \; | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' + source build/venv/bin/activate + find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \; + find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \; | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' - name: No double precision intrinsics run: | From 427eb870e5d6158877ee7110228b8279bf30615e Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 11:43:27 -0500 Subject: [PATCH 15/19] fix --- .github/workflows/lint-source.yml | 4 ++-- src/pre_process/m_perturbation.fpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index 6741084e06..eeb400b780 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -31,8 +31,8 @@ jobs: - name: Lint the full source run: | source build/venv/bin/activate - find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \; - find ./src -type f -not -name '*nvtx*' -exec command fortitude check {} \; | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' + find ./src -type f -not -name '*nvtx*' -exec fortitude check {} \; + find ./src -type f -not -name '*nvtx*' -exec fortitude check {} \; | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' - name: No double precision intrinsics run: | diff --git a/src/pre_process/m_perturbation.fpp b/src/pre_process/m_perturbation.fpp index ccb1b6175a..10c5b0f149 100644 --- a/src/pre_process/m_perturbation.fpp +++ b/src/pre_process/m_perturbation.fpp @@ -497,8 +497,8 @@ contains real(wp) :: ang, norm real(wp) :: tr, ti, cr, ci !< temporary memory real(wp) :: xratio - integer idx - integer i, j, k + integer :: idx + integer :: i, j, k xratio = mixlayer_vel_coef From c98d0a7136f55ef2c8a03c8731d1132b8b93a730 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 11:49:46 -0500 Subject: [PATCH 16/19] format output --- .fortitude.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.fortitude.toml b/.fortitude.toml index c971773352..0d3dbcc7b8 100644 --- a/.fortitude.toml +++ b/.fortitude.toml @@ -2,4 +2,4 @@ # Ignored Rules and justification: ignore = ["E001","S001","S101","M011","F001","S041","T001","S101","S102","T002","T011","T042","M001"] file-extensions = ["f90","fpp","fypp"] -line-length = 5000 +output-format = "pylint" From 91622b8ab8753ef520ce8bdc5e942f19fda00541 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 17:44:23 -0500 Subject: [PATCH 17/19] fypp everything --- .github/file-filter.yml | 2 +- .gitignore | 2 +- CMakeLists.txt | 72 +++++++++---------- docs/documentation/case.md | 4 +- misc/fpp_to_fypp.sh | 4 +- src/common/include/case.fpp | 7 -- .../include/{macros.fpp => macros.fypp} | 0 ...ecker_common.fpp => m_checker_common.fypp} | 2 +- .../{m_chemistry.fpp => m_chemistry.fypp} | 4 +- .../{m_constants.fpp => m_constants.fypp} | 0 ...derived_types.fpp => m_derived_types.fypp} | 2 +- ...ferences.fpp => m_finite_differences.fypp} | 0 src/common/{m_helper.fpp => m_helper.fypp} | 2 +- .../{m_mpi_common.fpp => m_mpi_common.fypp} | 2 +- ...m_phase_change.fpp => m_phase_change.fypp} | 2 +- ...ersion.fpp => m_variables_conversion.fypp} | 4 +- .../{m_checker.fpp => m_checker.fypp} | 2 +- .../{m_data_output.fpp => m_data_output.fypp} | 0 ...variables.fpp => m_derived_variables.fypp} | 0 ...arameters.fpp => m_global_parameters.fypp} | 2 +- .../{m_mpi_proxy.fpp => m_mpi_proxy.fypp} | 0 src/post_process/{p_main.fpp => p_main.fypp} | 0 .../{1dHardcodedIC.fpp => 1dHardcodedIC.fypp} | 0 .../{2dHardcodedIC.fpp => 2dHardcodedIC.fypp} | 0 .../{3dHardcodedIC.fpp => 3dHardcodedIC.fypp} | 0 ..._variables.fpp => m_assign_variables.fypp} | 2 +- ...ib_patches.fpp => m_check_ib_patches.fypp} | 2 +- ...check_patches.fpp => m_check_patches.fypp} | 4 +- .../{m_checker.fpp => m_checker.fypp} | 2 +- ...e_levelset.fpp => m_compute_levelset.fypp} | 4 +- .../{m_data_output.fpp => m_data_output.fypp} | 0 ...arameters.fpp => m_global_parameters.fypp} | 2 +- ...condition.fpp => m_initial_condition.fypp} | 0 src/pre_process/{m_model.fpp => m_model.fypp} | 4 +- .../{m_mpi_proxy.fpp => m_mpi_proxy.fypp} | 0 .../{m_patches.fpp => m_patches.fypp} | 12 ++-- ...m_perturbation.fpp => m_perturbation.fypp} | 2 +- .../{m_start_up.fpp => m_start_up.fypp} | 0 ...ne_capillary.fpp => inline_capillary.fypp} | 0 ...inline_riemann.fpp => inline_riemann.fypp} | 0 ...m_acoustic_src.fpp => m_acoustic_src.fypp} | 4 +- .../{m_body_forces.fpp => m_body_forces.fypp} | 2 +- ...ditions.fpp => m_boundary_conditions.fypp} | 2 +- .../{m_bubbles.fpp => m_bubbles.fypp} | 2 +- .../{m_bubbles_EE.fpp => m_bubbles_EE.fypp} | 2 +- .../{m_bubbles_EL.fpp => m_bubbles_EL.fypp} | 4 +- ..._kernels.fpp => m_bubbles_EL_kernels.fypp} | 2 +- src/simulation/{m_cbc.fpp => m_cbc.fypp} | 4 +- .../{m_checker.fpp => m_checker.fypp} | 4 +- .../{m_compute_cbc.fpp => m_compute_cbc.fypp} | 0 .../{m_data_output.fpp => m_data_output.fypp} | 2 +- src/simulation/{m_fftw.fpp => m_fftw.fypp} | 2 +- ...arameters.fpp => m_global_parameters.fypp} | 4 +- ...m_hyperelastic.fpp => m_hyperelastic.fypp} | 2 +- .../{m_hypoelastic.fpp => m_hypoelastic.fypp} | 2 +- src/simulation/{m_ibm.fpp => m_ibm.fypp} | 4 +- .../{m_mpi_proxy.fpp => m_mpi_proxy.fypp} | 4 +- src/simulation/{m_qbmm.fpp => m_qbmm.fypp} | 4 +- src/simulation/{m_rhs.fpp => m_rhs.fypp} | 4 +- ...ann_solvers.fpp => m_riemann_solvers.fypp} | 6 +- .../{m_start_up.fpp => m_start_up.fypp} | 2 +- ...ace_tension.fpp => m_surface_tension.fypp} | 4 +- ...time_steppers.fpp => m_time_steppers.fypp} | 2 +- .../{m_viscous.fpp => m_viscous.fypp} | 2 +- src/simulation/{m_weno.fpp => m_weno.fypp} | 2 +- src/simulation/{p_main.fpp => p_main.fypp} | 0 src/syscheck/{syscheck.fpp => syscheck.fypp} | 0 toolchain/bootstrap/format.sh | 2 +- toolchain/mfc/build.py | 6 +- toolchain/mfc/case.py | 10 +-- toolchain/mfc/run/input.py | 20 +++--- 71 files changed, 125 insertions(+), 132 deletions(-) delete mode 100644 src/common/include/case.fpp rename src/common/include/{macros.fpp => macros.fypp} (100%) rename src/common/{m_checker_common.fpp => m_checker_common.fypp} (99%) rename src/common/{m_chemistry.fpp => m_chemistry.fypp} (98%) rename src/common/{m_constants.fpp => m_constants.fypp} (100%) rename src/common/{m_derived_types.fpp => m_derived_types.fypp} (99%) rename src/common/{m_finite_differences.fpp => m_finite_differences.fypp} (100%) rename src/common/{m_helper.fpp => m_helper.fypp} (99%) rename src/common/{m_mpi_common.fpp => m_mpi_common.fypp} (99%) rename src/common/{m_phase_change.fpp => m_phase_change.fypp} (99%) rename src/common/{m_variables_conversion.fpp => m_variables_conversion.fypp} (99%) rename src/post_process/{m_checker.fpp => m_checker.fypp} (99%) rename src/post_process/{m_data_output.fpp => m_data_output.fypp} (100%) rename src/post_process/{m_derived_variables.fpp => m_derived_variables.fypp} (100%) rename src/post_process/{m_global_parameters.fpp => m_global_parameters.fypp} (99%) rename src/post_process/{m_mpi_proxy.fpp => m_mpi_proxy.fypp} (100%) rename src/post_process/{p_main.fpp => p_main.fypp} (100%) rename src/pre_process/include/{1dHardcodedIC.fpp => 1dHardcodedIC.fypp} (100%) rename src/pre_process/include/{2dHardcodedIC.fpp => 2dHardcodedIC.fypp} (100%) rename src/pre_process/include/{3dHardcodedIC.fpp => 3dHardcodedIC.fypp} (100%) rename src/pre_process/{m_assign_variables.fpp => m_assign_variables.fypp} (99%) rename src/pre_process/{m_check_ib_patches.fpp => m_check_ib_patches.fypp} (99%) rename src/pre_process/{m_check_patches.fpp => m_check_patches.fypp} (99%) rename src/pre_process/{m_checker.fpp => m_checker.fypp} (99%) rename src/pre_process/{m_compute_levelset.fpp => m_compute_levelset.fypp} (99%) rename src/pre_process/{m_data_output.fpp => m_data_output.fypp} (100%) rename src/pre_process/{m_global_parameters.fpp => m_global_parameters.fypp} (99%) rename src/pre_process/{m_initial_condition.fpp => m_initial_condition.fypp} (100%) rename src/pre_process/{m_model.fpp => m_model.fypp} (99%) rename src/pre_process/{m_mpi_proxy.fpp => m_mpi_proxy.fypp} (100%) rename src/pre_process/{m_patches.fpp => m_patches.fypp} (99%) rename src/pre_process/{m_perturbation.fpp => m_perturbation.fypp} (99%) rename src/pre_process/{m_start_up.fpp => m_start_up.fypp} (100%) rename src/simulation/include/{inline_capillary.fpp => inline_capillary.fypp} (100%) rename src/simulation/include/{inline_riemann.fpp => inline_riemann.fypp} (100%) rename src/simulation/{m_acoustic_src.fpp => m_acoustic_src.fypp} (99%) rename src/simulation/{m_body_forces.fpp => m_body_forces.fypp} (99%) rename src/simulation/{m_boundary_conditions.fpp => m_boundary_conditions.fypp} (99%) rename src/simulation/{m_bubbles.fpp => m_bubbles.fypp} (99%) rename src/simulation/{m_bubbles_EE.fpp => m_bubbles_EE.fypp} (99%) rename src/simulation/{m_bubbles_EL.fpp => m_bubbles_EL.fypp} (99%) rename src/simulation/{m_bubbles_EL_kernels.fpp => m_bubbles_EL_kernels.fypp} (99%) rename src/simulation/{m_cbc.fpp => m_cbc.fypp} (99%) rename src/simulation/{m_checker.fpp => m_checker.fypp} (99%) rename src/simulation/{m_compute_cbc.fpp => m_compute_cbc.fypp} (100%) rename src/simulation/{m_data_output.fpp => m_data_output.fypp} (99%) rename src/simulation/{m_fftw.fpp => m_fftw.fypp} (99%) rename src/simulation/{m_global_parameters.fpp => m_global_parameters.fypp} (99%) rename src/simulation/{m_hyperelastic.fpp => m_hyperelastic.fypp} (99%) rename src/simulation/{m_hypoelastic.fpp => m_hypoelastic.fypp} (99%) rename src/simulation/{m_ibm.fpp => m_ibm.fypp} (99%) rename src/simulation/{m_mpi_proxy.fpp => m_mpi_proxy.fypp} (99%) rename src/simulation/{m_qbmm.fpp => m_qbmm.fypp} (99%) rename src/simulation/{m_rhs.fpp => m_rhs.fypp} (99%) rename src/simulation/{m_riemann_solvers.fpp => m_riemann_solvers.fypp} (99%) rename src/simulation/{m_start_up.fpp => m_start_up.fypp} (99%) rename src/simulation/{m_surface_tension.fpp => m_surface_tension.fypp} (99%) rename src/simulation/{m_time_steppers.fpp => m_time_steppers.fypp} (99%) rename src/simulation/{m_viscous.fpp => m_viscous.fypp} (99%) rename src/simulation/{m_weno.fpp => m_weno.fypp} (99%) rename src/simulation/{p_main.fpp => p_main.fypp} (100%) rename src/syscheck/{syscheck.fpp => syscheck.fypp} (100%) diff --git a/.github/file-filter.yml b/.github/file-filter.yml index 6c8fb7216b..b3a55f78b0 100644 --- a/.github/file-filter.yml +++ b/.github/file-filter.yml @@ -3,7 +3,7 @@ fortran_src: &fortran_src - '**/*.f90' - - '**/*.fpp' + - '**/*.fypp' python_src: &python_src - '**/*.py' diff --git a/.gitignore b/.gitignore index 30393c710b..40236bf013 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ yarn.lock .venv/ /build/ .vscode/ -src/*/include/case.fpp +src/*/include/case.fypp src/*/autogen/ *.swo diff --git a/CMakeLists.txt b/CMakeLists.txt index a5835bd24e..e95add30e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,48 +253,48 @@ endif() # # * Locate all source files for of the type # -# src/[,common]/[.,include]/*.[f90,fpp]. +# src/[,common]/[.,include]/*.[f90,fypp]. # -# * For each .fpp file found with filepath /.fpp, using a +# * For each .fypp file found with filepath /.fypp, using a # custom command, instruct CMake how to generate a file with path # # src//fypp/.f90 # -# by running Fypp on /.fpp. It is important to understand +# by running Fypp on /.fypp. It is important to understand # that this does not actually run the pre-processor. Rather, it instructs # CMake what to do when it finds a src//fypp/.f90 path # in the source list for a target. Thus, an association is made from an .f90 -# file to its corresponding .fpp file (if applicable) even though the -# generation is of the form .fpp -> .f90. +# file to its corresponding .fypp file (if applicable) even though the +# generation is of the form .fypp -> .f90. # -# This design has one limitation: If an .fpp file depends on another, for +# This design has one limitation: If an .fypp file depends on another, for # example if it '#:include's it and uses a macro defined in it, then the -# dependency will not be tracked. A modification to the .fpp file it depends -# on will not trigger a re-run of Fypp on the .fpp file that depends on it. +# dependency will not be tracked. A modification to the .fypp file it depends +# on will not trigger a re-run of Fypp on the .fypp file that depends on it. # As a compromise, both in speed and complexity, all .f90 files generated -# from .fpp files are re-generated not only when their corresponding .fpp +# from .fypp files are re-generated not only when their corresponding .fypp # file is modified, but also when any file with filepath of the form # -# src/[,common]/include/*.fpp +# src/[,common]/include/*.fypp # -# is modified. This is a reasonable compromise as modifications to .fpp files +# is modified. This is a reasonable compromise as modifications to .fypp files # in the include directories will be rare - by design. Other approaches would -# have required a more complex CMakeLists.txt file (perhaps parsing the .fpp +# have required a more complex CMakeLists.txt file (perhaps parsing the .fypp # files to determine their dependencies) or the endurment of longer -# compilation times (by way of re-running Fypp on all .fpp files every time +# compilation times (by way of re-running Fypp on all .fypp files every time # one of them is modified). # -# .fpp files in src/common are treated as if they were in src/ (not +# .fypp files in src/common are treated as if they were in src/ (not # pre-processed to src/common/fypp/) so as not to clash with other targets' -# .fpp files (this has caused problems in the past). +# .fypp files (this has caused problems in the past). # # * Export, in the variable _SRCs, a list of all source files (.f90) -# that would compile to produce . If includes .fpp files, +# that would compile to produce . If includes .fypp files, # then the list will include the paths to the corresponding .f90 files that -# Fypp would generate from the .fpp files. +# Fypp would generate from the .fypp files. # # This design allows us to be flexible in our use of Fypp as we don't have to -# worry about running the pre-processor on .fpp files when we create executables +# worry about running the pre-processor on .fypp files when we create executables # and generate documentation. Instead, we can simply include the list of .f90 # files that will eventually be used to compile . @@ -316,31 +316,31 @@ macro(HANDLE_SOURCES target useCommon) endif() # Gather: - # * src/[,(common)]/*.fpp] - # * (if any) /modules//*.fpp - file(GLOB ${target}_FPPs CONFIGURE_DEPENDS "${${target}_DIR}/*.fpp" - "${CMAKE_BINARY_DIR}/modules/${target}/*.fpp") + # * src/[,(common)]/*.fypp] + # * (if any) /modules//*.fypp + file(GLOB ${target}_FYPPs CONFIGURE_DEPENDS "${${target}_DIR}/*.fypp" + "${CMAKE_BINARY_DIR}/modules/${target}/*.fypp") if (${useCommon}) - file(GLOB common_FPPs CONFIGURE_DEPENDS "${common_DIR}/*.fpp") - list(APPEND ${target}_FPPs ${common_FPPs}) + file(GLOB common_FYPPs CONFIGURE_DEPENDS "${common_DIR}/*.fypp") + list(APPEND ${target}_FYPPs ${common_FYPPs}) endif() # Gather: - # * src/[,common]/include/*.fpp - # * (if any) /include//*.fpp - file(GLOB ${target}_incs CONFIGURE_DEPENDS "${${target}_DIR}/include/*.fpp" - "${CMAKE_BINARY_DIR}/include/${target}/*.fpp") + # * src/[,common]/include/*.fypp + # * (if any) /include//*.fypp + file(GLOB ${target}_incs CONFIGURE_DEPENDS "${${target}_DIR}/include/*.fypp" + "${CMAKE_BINARY_DIR}/include/${target}/*.fypp") if (${useCommon}) - file(GLOB common_incs CONFIGURE_DEPENDS "${common_DIR}/include/*.fpp") + file(GLOB common_incs CONFIGURE_DEPENDS "${common_DIR}/include/*.fypp") list(APPEND ${target}_incs ${common_incs}) endif() - # /path/to/*.fpp (used by ) -> /fypp//*.f90 + # /path/to/*.fypp (used by ) -> /fypp//*.f90 file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/fypp/${target}") - foreach(fpp ${${target}_FPPs}) - cmake_path(GET fpp FILENAME fpp_filename) - set(f90 "${CMAKE_BINARY_DIR}/fypp/${target}/${fpp_filename}.f90") + foreach(fypp ${${target}_FYPPs}) + cmake_path(GET fypp FILENAME fypp_filename) + set(f90 "${CMAKE_BINARY_DIR}/fypp/${target}/${fypp_filename}.f90") add_custom_command( OUTPUT ${f90} @@ -356,9 +356,9 @@ macro(HANDLE_SOURCES target useCommon) -D chemistry=False --line-numbering --no-folding - "${fpp}" "${f90}" - DEPENDS "${fpp};${${target}_incs}" - COMMENT "Preprocessing (Fypp) ${fpp_filename}" + "${fypp}" "${f90}" + DEPENDS "${fypp};${${target}_incs}" + COMMENT "Preprocessing (Fypp) ${fypp_filename}" VERBATIM ) diff --git a/docs/documentation/case.md b/docs/documentation/case.md index 5b3f54b202..85e93a4821 100644 --- a/docs/documentation/case.md +++ b/docs/documentation/case.md @@ -221,8 +221,8 @@ end if Some patch configurations are not adequately handled with the above analytic variable definitions. In this case, a hard coded patch can be used. -Hard coded patches can be added by adding additional hard coded patch identifiers to `src/pre_process/include/1[2,3]dHardcodedIC.fpp`. -For example, to add a 2D Hardcoded patch with an id of 200, one would add the following to `src/pre_process/include/2dHardcodedIC.fpp` +Hard coded patches can be added by adding additional hard coded patch identifiers to `src/pre_process/include/1[2,3]dHardcodedIC.fypp`. +For example, to add a 2D Hardcoded patch with an id of 200, one would add the following to `src/pre_process/include/2dHardcodedIC.fypp` ```f90 case(200) diff --git a/misc/fpp_to_fypp.sh b/misc/fpp_to_fypp.sh index 50bb797e35..a09624f116 100644 --- a/misc/fpp_to_fypp.sh +++ b/misc/fpp_to_fypp.sh @@ -1,6 +1,6 @@ #!/bin/bash -for file in $(find src -type f | grep -Ev 'autogen' | grep -E '\.fpp$'); do +for file in $(find src -type f | grep -Ev 'autogen' | grep -E '\.fypp$'); do echo "$file" - mv "$file" "$(echo "$file" | sed s/\.fpp/\.fypp/)" + mv "$file" "$(echo "$file" | sed s/\.fypp/\.fypp/)" done diff --git a/src/common/include/case.fpp b/src/common/include/case.fpp deleted file mode 100644 index ad2e0b1a94..0000000000 --- a/src/common/include/case.fpp +++ /dev/null @@ -1,7 +0,0 @@ -! This file exists so that Fypp can be run without generating case.fpp files for -! each target. This is useful when generating documentation, for example. This -! should also let MFC be built with CMake directly, without invoking mfc.sh. - -! For pre-process. -#:def analytical() -#:enddef diff --git a/src/common/include/macros.fpp b/src/common/include/macros.fypp similarity index 100% rename from src/common/include/macros.fpp rename to src/common/include/macros.fypp diff --git a/src/common/m_checker_common.fpp b/src/common/m_checker_common.fypp similarity index 99% rename from src/common/m_checker_common.fpp rename to src/common/m_checker_common.fypp index 2a1210ab66..8f830bf28b 100644 --- a/src/common/m_checker_common.fpp +++ b/src/common/m_checker_common.fypp @@ -2,7 +2,7 @@ !!@file m_checker_common.f90 !!@brief Contains module m_checker_common -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief The purpose of the module is to check for compatible input files for. !! inputs common to pre-processing, post-processing and simulation diff --git a/src/common/m_chemistry.fpp b/src/common/m_chemistry.fypp similarity index 98% rename from src/common/m_chemistry.fpp rename to src/common/m_chemistry.fypp index a9beef0b55..46a88aff0d 100644 --- a/src/common/m_chemistry.fpp +++ b/src/common/m_chemistry.fypp @@ -3,8 +3,8 @@ !! @brief Contains module m_chemistry !! @author Henry Le Berre -#:include 'macros.fpp' -#:include 'case.fpp' +#:include 'macros.fypp' +#:include 'case.fypp' module m_chemistry diff --git a/src/common/m_constants.fpp b/src/common/m_constants.fypp similarity index 100% rename from src/common/m_constants.fpp rename to src/common/m_constants.fypp diff --git a/src/common/m_derived_types.fpp b/src/common/m_derived_types.fypp similarity index 99% rename from src/common/m_derived_types.fpp rename to src/common/m_derived_types.fypp index 64c64ac897..15cfb69e2f 100644 --- a/src/common/m_derived_types.fpp +++ b/src/common/m_derived_types.fypp @@ -2,7 +2,7 @@ !! @file m_derived_types.f90 !! @brief Contains module m_derived_types -#:include "macros.fpp" +#:include "macros.fypp" !> @brief This file contains the definitions of all of the custom-defined !! types used in the pre-process code. diff --git a/src/common/m_finite_differences.fpp b/src/common/m_finite_differences.fypp similarity index 100% rename from src/common/m_finite_differences.fpp rename to src/common/m_finite_differences.fypp diff --git a/src/common/m_helper.fpp b/src/common/m_helper.fypp similarity index 99% rename from src/common/m_helper.fpp rename to src/common/m_helper.fypp index 0d849dbf68..811dfa77c0 100644 --- a/src/common/m_helper.fpp +++ b/src/common/m_helper.fypp @@ -1,4 +1,4 @@ -#:include 'macros.fpp' +#:include 'macros.fypp' !> !! @file m_helper.f90 !! @brief Contains module m_helper diff --git a/src/common/m_mpi_common.fpp b/src/common/m_mpi_common.fypp similarity index 99% rename from src/common/m_mpi_common.fpp rename to src/common/m_mpi_common.fypp index 405da58774..24739ec705 100644 --- a/src/common/m_mpi_common.fpp +++ b/src/common/m_mpi_common.fypp @@ -1,5 +1,5 @@ -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief The module serves as a proxy to the parameters and subroutines !! available in the MPI implementation's MPI module. Specifically, diff --git a/src/common/m_phase_change.fpp b/src/common/m_phase_change.fypp similarity index 99% rename from src/common/m_phase_change.fpp rename to src/common/m_phase_change.fypp index f6a0e16665..707da19002 100644 --- a/src/common/m_phase_change.fpp +++ b/src/common/m_phase_change.fypp @@ -1,7 +1,7 @@ !> energies (6-eqn to 4-eqn) equilibrium through an infinitely fast (algebraic) !> procedure. -#:include 'macros.fpp' +#:include 'macros.fypp' module m_phase_change diff --git a/src/common/m_variables_conversion.fpp b/src/common/m_variables_conversion.fypp similarity index 99% rename from src/common/m_variables_conversion.fpp rename to src/common/m_variables_conversion.fypp index 17d644259b..fadbd2d0cd 100644 --- a/src/common/m_variables_conversion.fpp +++ b/src/common/m_variables_conversion.fypp @@ -2,8 +2,8 @@ !! @file m_variables_conversion.f90 !! @brief Contains module m_variables_conversion -#:include 'macros.fpp' -#:include 'case.fpp' +#:include 'macros.fypp' +#:include 'case.fypp' !> @brief This module consists of subroutines used in the conversion of the !! conservative variables into the primitive ones and vice versa. In diff --git a/src/post_process/m_checker.fpp b/src/post_process/m_checker.fypp similarity index 99% rename from src/post_process/m_checker.fpp rename to src/post_process/m_checker.fypp index cfe8d8ad27..088fab3731 100644 --- a/src/post_process/m_checker.fpp +++ b/src/post_process/m_checker.fypp @@ -2,7 +2,7 @@ !!@file m_checker.f90 !!@brief Contains module m_checker -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief The purpose of the module is to check for compatible input files module m_checker diff --git a/src/post_process/m_data_output.fpp b/src/post_process/m_data_output.fypp similarity index 100% rename from src/post_process/m_data_output.fpp rename to src/post_process/m_data_output.fypp diff --git a/src/post_process/m_derived_variables.fpp b/src/post_process/m_derived_variables.fypp similarity index 100% rename from src/post_process/m_derived_variables.fpp rename to src/post_process/m_derived_variables.fypp diff --git a/src/post_process/m_global_parameters.fpp b/src/post_process/m_global_parameters.fypp similarity index 99% rename from src/post_process/m_global_parameters.fpp rename to src/post_process/m_global_parameters.fypp index 974c6e3620..ebc1b1c925 100644 --- a/src/post_process/m_global_parameters.fpp +++ b/src/post_process/m_global_parameters.fypp @@ -2,7 +2,7 @@ !! @file m_global_parameters.f90 !! @brief Contains module m_global_parameters -#:include 'case.fpp' +#:include 'case.fypp' !> @brief This module contains all of the parameters characterizing the !! computational domain, simulation algorithm, stiffened equation of diff --git a/src/post_process/m_mpi_proxy.fpp b/src/post_process/m_mpi_proxy.fypp similarity index 100% rename from src/post_process/m_mpi_proxy.fpp rename to src/post_process/m_mpi_proxy.fypp diff --git a/src/post_process/p_main.fpp b/src/post_process/p_main.fypp similarity index 100% rename from src/post_process/p_main.fpp rename to src/post_process/p_main.fypp diff --git a/src/pre_process/include/1dHardcodedIC.fpp b/src/pre_process/include/1dHardcodedIC.fypp similarity index 100% rename from src/pre_process/include/1dHardcodedIC.fpp rename to src/pre_process/include/1dHardcodedIC.fypp diff --git a/src/pre_process/include/2dHardcodedIC.fpp b/src/pre_process/include/2dHardcodedIC.fypp similarity index 100% rename from src/pre_process/include/2dHardcodedIC.fpp rename to src/pre_process/include/2dHardcodedIC.fypp diff --git a/src/pre_process/include/3dHardcodedIC.fpp b/src/pre_process/include/3dHardcodedIC.fypp similarity index 100% rename from src/pre_process/include/3dHardcodedIC.fpp rename to src/pre_process/include/3dHardcodedIC.fypp diff --git a/src/pre_process/m_assign_variables.fpp b/src/pre_process/m_assign_variables.fypp similarity index 99% rename from src/pre_process/m_assign_variables.fpp rename to src/pre_process/m_assign_variables.fypp index edb636ad2b..f434ce7ccf 100644 --- a/src/pre_process/m_assign_variables.fpp +++ b/src/pre_process/m_assign_variables.fypp @@ -2,7 +2,7 @@ !! @file m_assign_variables.f90 !! @brief Contains module m_assign_variables -#:include 'case.fpp' +#:include 'case.fypp' module m_assign_variables diff --git a/src/pre_process/m_check_ib_patches.fpp b/src/pre_process/m_check_ib_patches.fypp similarity index 99% rename from src/pre_process/m_check_ib_patches.fpp rename to src/pre_process/m_check_ib_patches.fypp index 40debc4d62..f5a07806f0 100644 --- a/src/pre_process/m_check_ib_patches.fpp +++ b/src/pre_process/m_check_ib_patches.fypp @@ -1,7 +1,7 @@ !> @brief This module contains subroutines that read, and check consistency !! of, the user provided inputs and data. -#:include 'macros.fpp' +#:include 'macros.fypp' module m_check_ib_patches diff --git a/src/pre_process/m_check_patches.fpp b/src/pre_process/m_check_patches.fypp similarity index 99% rename from src/pre_process/m_check_patches.fpp rename to src/pre_process/m_check_patches.fypp index 8ff89f2254..681b12a5b8 100644 --- a/src/pre_process/m_check_patches.fpp +++ b/src/pre_process/m_check_patches.fypp @@ -1,9 +1,9 @@ -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief This module contains subroutines that read, and check consistency !! of, the user provided inputs and data. -#:include 'macros.fpp' +#:include 'macros.fypp' module m_check_patches diff --git a/src/pre_process/m_checker.fpp b/src/pre_process/m_checker.fypp similarity index 99% rename from src/pre_process/m_checker.fpp rename to src/pre_process/m_checker.fypp index ec5600c76c..19e4ee4647 100644 --- a/src/pre_process/m_checker.fpp +++ b/src/pre_process/m_checker.fypp @@ -2,7 +2,7 @@ !!@file m_checker.f90 !!@brief Contains module m_checker -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief The purpose of the module is to check for compatible input files module m_checker diff --git a/src/pre_process/m_compute_levelset.fpp b/src/pre_process/m_compute_levelset.fypp similarity index 99% rename from src/pre_process/m_compute_levelset.fpp rename to src/pre_process/m_compute_levelset.fypp index d339157be6..4ae2f4a106 100644 --- a/src/pre_process/m_compute_levelset.fpp +++ b/src/pre_process/m_compute_levelset.fypp @@ -1,8 +1,8 @@ !> -!! @file m_compute_levelset.fpp +!! @file m_compute_levelset.fypp !! @brief Contains module m_compute_levelset -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief This module is used to handle all operations related to immersed !! boundary methods (IBMs) diff --git a/src/pre_process/m_data_output.fpp b/src/pre_process/m_data_output.fypp similarity index 100% rename from src/pre_process/m_data_output.fpp rename to src/pre_process/m_data_output.fypp diff --git a/src/pre_process/m_global_parameters.fpp b/src/pre_process/m_global_parameters.fypp similarity index 99% rename from src/pre_process/m_global_parameters.fpp rename to src/pre_process/m_global_parameters.fypp index 17e1d450ea..c808fbfd5f 100644 --- a/src/pre_process/m_global_parameters.fpp +++ b/src/pre_process/m_global_parameters.fypp @@ -2,7 +2,7 @@ !! @file m_global_parameters.f90 !! @brief Contains module m_global_parameters -#:include 'case.fpp' +#:include 'case.fypp' !> @brief This module contains all of the parameters characterizing the !! computational domain, simulation algorithm, initial condition diff --git a/src/pre_process/m_initial_condition.fpp b/src/pre_process/m_initial_condition.fypp similarity index 100% rename from src/pre_process/m_initial_condition.fpp rename to src/pre_process/m_initial_condition.fypp diff --git a/src/pre_process/m_model.fpp b/src/pre_process/m_model.fypp similarity index 99% rename from src/pre_process/m_model.fpp rename to src/pre_process/m_model.fypp index bbd50e52bd..7d0e1f6d5c 100644 --- a/src/pre_process/m_model.fpp +++ b/src/pre_process/m_model.fypp @@ -1,9 +1,9 @@ !> -!! @file m_model.fpp +!! @file m_model.fypp !! @author Henry Le Berre !! @brief Contains module m_model -#:include 'macros.fpp' +#:include 'macros.fypp' module m_model diff --git a/src/pre_process/m_mpi_proxy.fpp b/src/pre_process/m_mpi_proxy.fypp similarity index 100% rename from src/pre_process/m_mpi_proxy.fpp rename to src/pre_process/m_mpi_proxy.fypp diff --git a/src/pre_process/m_patches.fpp b/src/pre_process/m_patches.fypp similarity index 99% rename from src/pre_process/m_patches.fpp rename to src/pre_process/m_patches.fypp index 2a2ef17974..c62c80534b 100644 --- a/src/pre_process/m_patches.fpp +++ b/src/pre_process/m_patches.fypp @@ -1,12 +1,12 @@ !> -!! @file m_patches.fpp +!! @file m_patches.fypp !! @brief Contains module m_patches -#:include 'case.fpp' -#:include '1dHardcodedIC.fpp' -#:include '2dHardcodedIC.fpp' -#:include '3dHardcodedIC.fpp' -#:include 'macros.fpp' +#:include 'case.fypp' +#:include '1dHardcodedIC.fypp' +#:include '2dHardcodedIC.fypp' +#:include '3dHardcodedIC.fypp' +#:include 'macros.fypp' module m_patches diff --git a/src/pre_process/m_perturbation.fpp b/src/pre_process/m_perturbation.fypp similarity index 99% rename from src/pre_process/m_perturbation.fpp rename to src/pre_process/m_perturbation.fypp index 10c5b0f149..bfa9fffe82 100644 --- a/src/pre_process/m_perturbation.fpp +++ b/src/pre_process/m_perturbation.fypp @@ -1,5 +1,5 @@ !> -!! @file m_perturbation.fpp +!! @file m_perturbation.fypp !! @brief Contains module m_perturbation !> @brief This module contains subroutines that compute perturbations to the diff --git a/src/pre_process/m_start_up.fpp b/src/pre_process/m_start_up.fypp similarity index 100% rename from src/pre_process/m_start_up.fpp rename to src/pre_process/m_start_up.fypp diff --git a/src/simulation/include/inline_capillary.fpp b/src/simulation/include/inline_capillary.fypp similarity index 100% rename from src/simulation/include/inline_capillary.fpp rename to src/simulation/include/inline_capillary.fypp diff --git a/src/simulation/include/inline_riemann.fpp b/src/simulation/include/inline_riemann.fypp similarity index 100% rename from src/simulation/include/inline_riemann.fpp rename to src/simulation/include/inline_riemann.fypp diff --git a/src/simulation/m_acoustic_src.fpp b/src/simulation/m_acoustic_src.fypp similarity index 99% rename from src/simulation/m_acoustic_src.fpp rename to src/simulation/m_acoustic_src.fypp index eea8368457..de53ef481d 100644 --- a/src/simulation/m_acoustic_src.fpp +++ b/src/simulation/m_acoustic_src.fypp @@ -1,8 +1,8 @@ !> -!! @file m_acoustic_src.fpp +!! @file m_acoustic_src.fypp !! @brief Contains module m_acoustic_src -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief The module contains the subroutines used to create a acoustic source pressure source term module m_acoustic_src diff --git a/src/simulation/m_body_forces.fpp b/src/simulation/m_body_forces.fypp similarity index 99% rename from src/simulation/m_body_forces.fpp rename to src/simulation/m_body_forces.fypp index c27ca8e017..2536f977b6 100644 --- a/src/simulation/m_body_forces.fpp +++ b/src/simulation/m_body_forces.fypp @@ -1,4 +1,4 @@ -#:include 'macros.fpp' +#:include 'macros.fypp' module m_body_forces diff --git a/src/simulation/m_boundary_conditions.fpp b/src/simulation/m_boundary_conditions.fypp similarity index 99% rename from src/simulation/m_boundary_conditions.fpp rename to src/simulation/m_boundary_conditions.fypp index 073c62d072..2928b20048 100644 --- a/src/simulation/m_boundary_conditions.fpp +++ b/src/simulation/m_boundary_conditions.fypp @@ -1,5 +1,5 @@ !> -!! @file m_boundary_conditions.fpp +!! @file m_boundary_conditions.fypp !! @brief Contains module m_boundary_conditions !> @brief The purpose of the module is to apply noncharacteristic and processor diff --git a/src/simulation/m_bubbles.fpp b/src/simulation/m_bubbles.fypp similarity index 99% rename from src/simulation/m_bubbles.fpp rename to src/simulation/m_bubbles.fypp index b7b249139d..ee03cbbbdb 100644 --- a/src/simulation/m_bubbles.fpp +++ b/src/simulation/m_bubbles.fypp @@ -2,7 +2,7 @@ !! @file m_bubbles.f90 !! @brief Contains module m_bubbles -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief This module contains the procedures shared by the ensemble-averaged and volume-averaged bubble models. module m_bubbles diff --git a/src/simulation/m_bubbles_EE.fpp b/src/simulation/m_bubbles_EE.fypp similarity index 99% rename from src/simulation/m_bubbles_EE.fpp rename to src/simulation/m_bubbles_EE.fypp index 91e8c5f30e..7db72d1ece 100644 --- a/src/simulation/m_bubbles_EE.fpp +++ b/src/simulation/m_bubbles_EE.fypp @@ -2,7 +2,7 @@ !! @file m_bubbles_EE.f90 !! @brief Contains module m_bubbles_EE -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief This module is used to compute the ensemble-averaged bubble dynamic variables module m_bubbles_EE diff --git a/src/simulation/m_bubbles_EL.fpp b/src/simulation/m_bubbles_EL.fypp similarity index 99% rename from src/simulation/m_bubbles_EL.fpp rename to src/simulation/m_bubbles_EL.fypp index b48f941a39..a0f9e3c626 100644 --- a/src/simulation/m_bubbles_EL.fpp +++ b/src/simulation/m_bubbles_EL.fypp @@ -1,8 +1,8 @@ !> -!! @file m_bubbles_EL.fpp +!! @file m_bubbles_EL.fypp !! @brief Contains module m_bubbles_EL -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief This module is used to to compute the volume-averaged bubble model module m_bubbles_EL diff --git a/src/simulation/m_bubbles_EL_kernels.fpp b/src/simulation/m_bubbles_EL_kernels.fypp similarity index 99% rename from src/simulation/m_bubbles_EL_kernels.fpp rename to src/simulation/m_bubbles_EL_kernels.fypp index 43246aad55..8d2adac2bd 100644 --- a/src/simulation/m_bubbles_EL_kernels.fpp +++ b/src/simulation/m_bubbles_EL_kernels.fypp @@ -2,7 +2,7 @@ !! @file m_bubbles_EL_kernels.f90 !! @brief Contains module m_bubbles_EL_kernels -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief This module contains kernel functions used to map the effect of the lagrangian bubbles !! in the Eulerian framework. diff --git a/src/simulation/m_cbc.fpp b/src/simulation/m_cbc.fypp similarity index 99% rename from src/simulation/m_cbc.fpp rename to src/simulation/m_cbc.fypp index 278e4c055e..6bca6b3741 100644 --- a/src/simulation/m_cbc.fpp +++ b/src/simulation/m_cbc.fypp @@ -18,7 +18,7 @@ !! 8) Supersonic Outflow !! Please refer to Thompson (1987, 1990) for detailed descriptions. -#:include 'macros.fpp' +#:include 'macros.fypp' module m_cbc @@ -52,7 +52,7 @@ module m_cbc real(wp), allocatable, dimension(:, :, :, :) :: F_rsz_vf, F_src_rsz_vf !< !! There is a CCE bug that is causing some subset of these variables to interfere - !! with variables of the same name in m_riemann_solvers.fpp, and giving this versions + !! with variables of the same name in m_riemann_solvers.fypp, and giving this versions !! unique "_l" names works around the bug. Other private module allocatable arrays !! in `acc declare create` clauses don't have this problem, so we still need to !! isolate this bug. diff --git a/src/simulation/m_checker.fpp b/src/simulation/m_checker.fypp similarity index 99% rename from src/simulation/m_checker.fpp rename to src/simulation/m_checker.fypp index a7f6665df4..c758edc293 100644 --- a/src/simulation/m_checker.fpp +++ b/src/simulation/m_checker.fypp @@ -2,8 +2,8 @@ !!@file m_start_up.f90 !!@brief Contains module m_checker -#:include 'macros.fpp' -#:include 'case.fpp' +#:include 'macros.fypp' +#:include 'case.fypp' !> @brief The purpose of the module is to check for compatible input files module m_checker diff --git a/src/simulation/m_compute_cbc.fpp b/src/simulation/m_compute_cbc.fypp similarity index 100% rename from src/simulation/m_compute_cbc.fpp rename to src/simulation/m_compute_cbc.fypp diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fypp similarity index 99% rename from src/simulation/m_data_output.fpp rename to src/simulation/m_data_output.fypp index c2e6ddba27..17e3573c56 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fypp @@ -2,7 +2,7 @@ !! @file m_data_output.f90 !! @brief Contains module m_data_output -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief The primary purpose of this module is to output the grid and the !! conservative variables data at the chosen time-step interval. In diff --git a/src/simulation/m_fftw.fpp b/src/simulation/m_fftw.fypp similarity index 99% rename from src/simulation/m_fftw.fpp rename to src/simulation/m_fftw.fypp index 4adae18b14..560d765c30 100644 --- a/src/simulation/m_fftw.fpp +++ b/src/simulation/m_fftw.fypp @@ -2,7 +2,7 @@ !! @file m_fftw.f90 !! @brief Contains module m_fftw -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief The module contains the subroutines for the FFT routines module m_fftw diff --git a/src/simulation/m_global_parameters.fpp b/src/simulation/m_global_parameters.fypp similarity index 99% rename from src/simulation/m_global_parameters.fpp rename to src/simulation/m_global_parameters.fypp index 6963d6dfe2..c8f50d59df 100644 --- a/src/simulation/m_global_parameters.fpp +++ b/src/simulation/m_global_parameters.fypp @@ -2,8 +2,8 @@ !! @file m_global_parameters.f90 !! @brief Contains module m_global_parameters -#:include 'case.fpp' -#:include 'macros.fpp' +#:include 'case.fypp' +#:include 'macros.fypp' !> @brief The module contains all of the parameters describing the program !! logistics, the computational domain and the simulation algorithm. diff --git a/src/simulation/m_hyperelastic.fpp b/src/simulation/m_hyperelastic.fypp similarity index 99% rename from src/simulation/m_hyperelastic.fpp rename to src/simulation/m_hyperelastic.fypp index 46addb7685..0ed42232f2 100644 --- a/src/simulation/m_hyperelastic.fpp +++ b/src/simulation/m_hyperelastic.fypp @@ -2,7 +2,7 @@ !! @file m_hyperelastic.f90 !! @brief Contains module m_hyperelastic -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief This module consists of subroutines used in the calculation !! of the cauchy tensor diff --git a/src/simulation/m_hypoelastic.fpp b/src/simulation/m_hypoelastic.fypp similarity index 99% rename from src/simulation/m_hypoelastic.fpp rename to src/simulation/m_hypoelastic.fypp index 2e676ba087..d09e364c89 100644 --- a/src/simulation/m_hypoelastic.fpp +++ b/src/simulation/m_hypoelastic.fypp @@ -2,7 +2,7 @@ !! @file m_hypoelastic.f90 !! @brief Contains module m_hypoelastic -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief This module is used to compute source terms for hypoelastic model module m_hypoelastic diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fypp similarity index 99% rename from src/simulation/m_ibm.fpp rename to src/simulation/m_ibm.fypp index 0b07317c67..e94e0a587f 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fypp @@ -1,8 +1,8 @@ !> -!! @file m_ibm.fpp +!! @file m_ibm.fypp !! @brief Contains module m_ibm -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief This module is used to handle all operations related to immersed !! boundary methods (IBMs) diff --git a/src/simulation/m_mpi_proxy.fpp b/src/simulation/m_mpi_proxy.fypp similarity index 99% rename from src/simulation/m_mpi_proxy.fpp rename to src/simulation/m_mpi_proxy.fypp index 1764c06832..5dc8b59ad4 100644 --- a/src/simulation/m_mpi_proxy.fpp +++ b/src/simulation/m_mpi_proxy.fypp @@ -2,8 +2,8 @@ !! @file m_mpi_proxy.f90 !! @brief Contains module m_mpi_proxy -#:include 'case.fpp' -#:include 'macros.fpp' +#:include 'case.fypp' +#:include 'macros.fypp' !> @brief The module serves as a proxy to the parameters and subroutines !! available in the MPI implementation's MPI module. Specifically, diff --git a/src/simulation/m_qbmm.fpp b/src/simulation/m_qbmm.fypp similarity index 99% rename from src/simulation/m_qbmm.fpp rename to src/simulation/m_qbmm.fypp index 11298e4f71..90eeb68a48 100644 --- a/src/simulation/m_qbmm.fpp +++ b/src/simulation/m_qbmm.fypp @@ -2,8 +2,8 @@ !! @file m_qbmm.f90 !! @brief Contains module m_qbmm -#:include 'case.fpp' -#:include 'macros.fpp' +#:include 'case.fypp' +#:include 'macros.fypp' !> @brief This module is used to compute moment inversion via qbmm module m_qbmm diff --git a/src/simulation/m_rhs.fpp b/src/simulation/m_rhs.fypp similarity index 99% rename from src/simulation/m_rhs.fpp rename to src/simulation/m_rhs.fypp index d9617f9304..c002561efc 100644 --- a/src/simulation/m_rhs.fpp +++ b/src/simulation/m_rhs.fypp @@ -2,8 +2,8 @@ !! @file m_rhs.f90 !! @brief Contains module m_rhs -#:include 'case.fpp' -#:include 'macros.fpp' +#:include 'case.fypp' +#:include 'macros.fypp' !> @brief The module contains the subroutines used to calculate the right- !! hane-side (RHS) in the quasi-conservative, shock- and interface- diff --git a/src/simulation/m_riemann_solvers.fpp b/src/simulation/m_riemann_solvers.fypp similarity index 99% rename from src/simulation/m_riemann_solvers.fpp rename to src/simulation/m_riemann_solvers.fypp index 04513e71ae..5684b41587 100644 --- a/src/simulation/m_riemann_solvers.fpp +++ b/src/simulation/m_riemann_solvers.fypp @@ -18,9 +18,9 @@ !! 2) Harten-Lax-van Leer-Contact (HLLC) !! 3) Exact -#:include 'case.fpp' -#:include 'macros.fpp' -#:include 'inline_riemann.fpp' +#:include 'case.fypp' +#:include 'macros.fypp' +#:include 'inline_riemann.fypp' module m_riemann_solvers diff --git a/src/simulation/m_start_up.fpp b/src/simulation/m_start_up.fypp similarity index 99% rename from src/simulation/m_start_up.fpp rename to src/simulation/m_start_up.fypp index 547502ff66..40fddca4be 100644 --- a/src/simulation/m_start_up.fpp +++ b/src/simulation/m_start_up.fypp @@ -2,7 +2,7 @@ !! @file m_start_up.f90 !! @brief Contains module m_start_up -#:include 'case.fpp' +#:include 'case.fypp' !> @brief The purpose of the module is primarily to read in the files that !! contain the inputs, the initial condition data and the grid data diff --git a/src/simulation/m_surface_tension.fpp b/src/simulation/m_surface_tension.fypp similarity index 99% rename from src/simulation/m_surface_tension.fpp rename to src/simulation/m_surface_tension.fypp index 06b230c60e..b82b7fb896 100644 --- a/src/simulation/m_surface_tension.fpp +++ b/src/simulation/m_surface_tension.fypp @@ -1,5 +1,5 @@ -#:include 'macros.fpp' -#:include 'inline_capillary.fpp' +#:include 'macros.fypp' +#:include 'inline_capillary.fypp' !> @brief This module is used to compute source terms for surface tension model module m_surface_tension diff --git a/src/simulation/m_time_steppers.fpp b/src/simulation/m_time_steppers.fypp similarity index 99% rename from src/simulation/m_time_steppers.fpp rename to src/simulation/m_time_steppers.fypp index 2ffbc8e58b..7c83477c69 100644 --- a/src/simulation/m_time_steppers.fpp +++ b/src/simulation/m_time_steppers.fypp @@ -2,7 +2,7 @@ !! @file m_time_steppers.f90 !! @brief Contains module m_time_steppers -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief The following module features a variety of time-stepping schemes. !! Currently, it includes the following Runge-Kutta (RK) algorithms: diff --git a/src/simulation/m_viscous.fpp b/src/simulation/m_viscous.fypp similarity index 99% rename from src/simulation/m_viscous.fpp rename to src/simulation/m_viscous.fypp index 44d6bbf62a..511094af7d 100644 --- a/src/simulation/m_viscous.fpp +++ b/src/simulation/m_viscous.fypp @@ -1,7 +1,7 @@ !> !! @file m_viscous.f90 !! @brief Contains module m_viscous -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief The module contains the subroutines used to compute viscous terms. module m_viscous diff --git a/src/simulation/m_weno.fpp b/src/simulation/m_weno.fypp similarity index 99% rename from src/simulation/m_weno.fpp rename to src/simulation/m_weno.fypp index feb182b60f..64dfd5533e 100644 --- a/src/simulation/m_weno.fpp +++ b/src/simulation/m_weno.fypp @@ -1,7 +1,7 @@ !> !! @file m_weno.f90 !! @brief Contains module m_weno -#:include 'macros.fpp' +#:include 'macros.fypp' !> @brief Weighted essentially non-oscillatory (WENO) reconstruction scheme !! that is supplemented with monotonicity preserving bounds (MPWENO) diff --git a/src/simulation/p_main.fpp b/src/simulation/p_main.fypp similarity index 100% rename from src/simulation/p_main.fpp rename to src/simulation/p_main.fypp diff --git a/src/syscheck/syscheck.fpp b/src/syscheck/syscheck.fypp similarity index 100% rename from src/syscheck/syscheck.fpp rename to src/syscheck/syscheck.fypp diff --git a/toolchain/bootstrap/format.sh b/toolchain/bootstrap/format.sh index f4baea506a..b12d9e6b52 100644 --- a/toolchain/bootstrap/format.sh +++ b/toolchain/bootstrap/format.sh @@ -17,7 +17,7 @@ done log "Formatting MFC:" -if ! find ${@:-src} -type f | grep -Ev 'autogen' | grep -E '\.(f90|fpp)$' \ +if ! find ${@:-src} -type f | grep -Ev 'autogen' | grep -E '\.(f90|fypp)$' \ | xargs -L 1 -P ${JOBS:-1} $SHELL toolchain/bootstrap/format_file.sh; then error "Formatting MFC source failed." exit 1 diff --git a/toolchain/mfc/build.py b/toolchain/mfc/build.py index 2de738986d..18febe9b03 100644 --- a/toolchain/mfc/build.py +++ b/toolchain/mfc/build.py @@ -39,7 +39,7 @@ def get_slug(self, case: Case ) -> str: m = hashlib.sha256() m.update(self.name.encode()) m.update(CFG().make_slug().encode()) - m.update(case.get_fpp(self, False).encode()) + m.update(case.get_fypp(self, False).encode()) if case.params.get('chemistry', 'F') == 'T': m.update(case.get_cantera_solution().name.encode()) @@ -150,7 +150,7 @@ def configure(self, case: Case): delete_directory(build_dirpath) create_directory(build_dirpath) - case.generate_fpp(self) + case.generate_fypp(self) if system(command).returncode != 0: raise MFCException(f"Failed to configure the [bold magenta]{self.name}[/bold magenta] target.") @@ -158,7 +158,7 @@ def configure(self, case: Case): cons.print(no_indent=True) def build(self, case: input.MFCInputFile): - case.generate_fpp(self) + case.generate_fypp(self) command = ["cmake", "--build", self.get_staging_dirpath(case), "--target", self.name, diff --git a/toolchain/mfc/case.py b/toolchain/mfc/case.py index 30f835a74b..3db2b619c6 100644 --- a/toolchain/mfc/case.py +++ b/toolchain/mfc/case.py @@ -94,7 +94,7 @@ def __is_ic_analytical(self, key: str, val: str) -> bool: return False # pylint: disable=too-many-locals - def __get_pre_fpp(self, print: bool) -> str: + def __get_pre_fypp(self, print: bool) -> str: DATA = { 1: {'ptypes': [1, 15, 16], 'sf_idx': 'i, 0, 0'}, 2: {'ptypes': [2, 3, 4, 5, 6, 7, 17, 18, 21], 'sf_idx': 'i, j, 0'}, @@ -170,7 +170,7 @@ def rhs_replace(match): return content - def __get_sim_fpp(self, print: bool) -> str: + def __get_sim_fypp(self, print: bool) -> str: if ARG("case_optimization"): if print: cons.print("Case optimization is enabled.") @@ -219,7 +219,7 @@ def __get_sim_fpp(self, print: bool) -> str: ! of --case-optimization. """ - def get_fpp(self, target, print = True) -> str: + def get_fypp(self, target, print = True) -> str: def _prepend() -> str: return f"""\ #:set chemistry = {self.params.get("chemistry", 'F') == 'T'} @@ -229,8 +229,8 @@ def _default(_) -> str: return "! This file is purposefully empty." result = { - "pre_process" : self.__get_pre_fpp, - "simulation" : self.__get_sim_fpp, + "pre_process" : self.__get_pre_fypp, + "simulation" : self.__get_sim_fypp, }.get(build.get_target(target).name, _default)(print) return _prepend() + result diff --git a/toolchain/mfc/run/input.py b/toolchain/mfc/run/input.py index 126fb032ba..d732a3ff65 100644 --- a/toolchain/mfc/run/input.py +++ b/toolchain/mfc/run/input.py @@ -24,14 +24,14 @@ def generate_inp(self, target) -> None: # Save .inp input file common.file_write(f"{self.dirpath}/{target.name}.inp", self.get_inp(target)) - def __save_fpp(self, target, contents: str) -> None: + def __save_fypp(self, target, contents: str) -> None: inc_dir = os.path.join(target.get_staging_dirpath(self), "include", target.name) common.create_directory(inc_dir) - fpp_path = os.path.join(inc_dir, "case.fpp") + fypp_path = os.path.join(inc_dir, "case.fypp") - cons.print("Writing a (new) custom case.fpp file.") - common.file_write(fpp_path, contents, True) + cons.print("Writing a (new) custom case.fypp file.") + common.file_write(fypp_path, contents, True) def get_cantera_solution(self) -> ct.Solution: if self.params.get("chemistry", 'F') == 'T': @@ -56,15 +56,15 @@ def get_cantera_solution(self) -> ct.Solution: raise common.MFCException(f"Cantera file '{cantera_file}' not found. Searched: {', '.join(candidates)}.") - def generate_fpp(self, target) -> None: + def generate_fypp(self, target) -> None: if target.isDependency: return - cons.print(f"Generating [magenta]case.fpp[/magenta].") + cons.print(f"Generating [magenta]case.fypp[/magenta].") cons.indent() - # Case FPP file - self.__save_fpp(target, self.get_fpp(target)) + # Case FYPP file + self.__save_fypp(target, self.get_fypp(target)) # (Thermo)Chemistry source file modules_dir = os.path.join(target.get_staging_dirpath(self), "modules", target.name) @@ -87,11 +87,11 @@ def generate_fpp(self, target) -> None: cons.unindent() - # Generate case.fpp & [target.name].inp + # Generate case.fypp & [target.name].inp def generate(self, target) -> None: self.generate_inp(target) cons.print() - self.generate_fpp(target) + self.generate_fypp(target) def clean(self, _targets) -> None: targets = [build.get_target(target) for target in _targets] From 519cbd78a53d4aefa873ae4c10e1a4a0441fa943 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 18:01:30 -0500 Subject: [PATCH 18/19] asdf --- misc/fpp_to_fypp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/fpp_to_fypp.sh b/misc/fpp_to_fypp.sh index a09624f116..50bb797e35 100644 --- a/misc/fpp_to_fypp.sh +++ b/misc/fpp_to_fypp.sh @@ -1,6 +1,6 @@ #!/bin/bash -for file in $(find src -type f | grep -Ev 'autogen' | grep -E '\.fypp$'); do +for file in $(find src -type f | grep -Ev 'autogen' | grep -E '\.fpp$'); do echo "$file" - mv "$file" "$(echo "$file" | sed s/\.fypp/\.fypp/)" + mv "$file" "$(echo "$file" | sed s/\.fpp/\.fypp/)" done From e9738d9e98c5e5df4003ec371b9e08ee4dede410 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 29 Dec 2024 18:15:23 -0500 Subject: [PATCH 19/19] Create case.fypp --- src/common/include/case.fypp | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/common/include/case.fypp diff --git a/src/common/include/case.fypp b/src/common/include/case.fypp new file mode 100644 index 0000000000..4216c0a7d2 --- /dev/null +++ b/src/common/include/case.fypp @@ -0,0 +1,7 @@ +! This file exists so that Fypp can be run without generating case.fypp files for +! each target. This is useful when generating documentation, for example. This +! should also let MFC be built with CMake directly, without invoking mfc.sh. + +! For pre-process. +#:def analytical() +#:enddef