Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- name: Looking for junk code
run: |
! grep -iR -e '\.\.\.' -e '\-\-\-' -e '===' ./src/* | grep '!'
! grep -iR -e '\.\.\.' -e '\-\-\-' -e '===' ./src/*

- name: Looking for junk comments in examples
run: |
Expand Down
8 changes: 4 additions & 4 deletions src/common/m_checker_common.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@
if (any((/bc_${X}$%${VB2}$, bc_${X}$%${VB3}$/) /= 0._wp)) then
call s_mpi_abort("bc_${X}$%beg must be -15 if "// &
"bc_${X}$%${VB2}$ or bc_${X}$%${VB3}$ "// &
"is set. Exiting.")
"is set. Exiting.", CASE_FILE_ERROR_CODE)

Check warning on line 342 in src/common/m_checker_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_checker_common.fpp#L342

Added line #L342 was not covered by tests
end if
elseif (bc_${X}$%beg /= -16) then
call s_mpi_abort("bc_${X}$%beg must be -15 or -16 if "// &
"bc_${X}$%vb[1,2,3] is set. Exiting.")
"bc_${X}$%vb[1,2,3] is set. Exiting.", CASE_FILE_ERROR_CODE)

Check warning on line 346 in src/common/m_checker_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_checker_common.fpp#L346

Added line #L346 was not covered by tests
end if
end if
#:endfor
Expand All @@ -354,11 +354,11 @@
if (any((/bc_${X}$%${VE2}$, bc_${X}$%${VE3}$/) /= 0._wp)) then
call s_mpi_abort("bc_${X}$%end must be -15 if "// &
"bc_${X}$%${VE2}$ or bc_${X}$%${VE3}$ "// &
"is set. Exiting.")
"is set. Exiting.", CASE_FILE_ERROR_CODE)

Check warning on line 357 in src/common/m_checker_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_checker_common.fpp#L357

Added line #L357 was not covered by tests
end if
elseif (bc_${X}$%end /= -16) then
call s_mpi_abort("bc_${X}$%end must be -15 or -16 if "// &
"bc_${X}$%ve[1,2,3] is set. Exiting.")
"bc_${X}$%ve[1,2,3] is set. Exiting.", CASE_FILE_ERROR_CODE)

Check warning on line 361 in src/common/m_checker_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_checker_common.fpp#L361

Added line #L361 was not covered by tests
end if
end if
#:endfor
Expand Down
3 changes: 3 additions & 0 deletions src/common/m_constants.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,7 @@ module m_constants
real(wp), parameter :: ERRCON = 1.89e-4_wp !< Limit to slightly increase dt when truncation error is between ERRCON and 1
real(wp), parameter :: PGROW = -0.2_wp !< Factor to increase dt when truncation error is between ERRCON and 1

! System constants
integer, parameter :: CASE_FILE_ERROR_CODE = 22

end module m_constants
11 changes: 4 additions & 7 deletions src/common/m_helper.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,17 +475,14 @@
subroutine s_prohibit_abort(condition, message)
character(len=*), intent(in) :: condition, message

print *, ""
print *, "===================================================================================================="
print *, " CASE FILE ERROR "
print *, "----------------------------------------------------------------------------------------------------"
print *, "Prohibited condition: ", trim(condition)
print *, "CASE FILE ERROR"
print *, " - Prohibited condition: ", trim(condition)

Check warning on line 480 in src/common/m_helper.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_helper.fpp#L478-L480

Added lines #L478 - L480 were not covered by tests
if (len_trim(message) > 0) then
print *, "Note: ", trim(message)
print *, " - Note: ", trim(message)

Check warning on line 482 in src/common/m_helper.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_helper.fpp#L482

Added line #L482 was not covered by tests
end if
print *, "===================================================================================================="
print *, ""
call s_mpi_abort
call s_mpi_abort(code=CASE_FILE_ERROR_CODE)

Check warning on line 485 in src/common/m_helper.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_helper.fpp#L485

Added line #L485 was not covered by tests
end subroutine s_prohibit_abort

!> This function generates the unassociated legendre poynomials
Expand Down
19 changes: 12 additions & 7 deletions src/common/m_mpi_common.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,10 @@

!> The subroutine terminates the MPI execution environment.
!! @param prnt error message to be printed
subroutine s_mpi_abort(prnt)
subroutine s_mpi_abort(prnt, code)

Check warning on line 477 in src/common/m_mpi_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_mpi_common.fpp#L477

Added line #L477 was not covered by tests

character(len=*), intent(in), optional :: prnt
integer, intent(in), optional :: code

if (present(prnt)) then
print *, prnt
Expand All @@ -485,14 +486,18 @@
end if

#ifndef MFC_MPI

stop 1

if (present(code)) then
stop code
else
stop 1
end if
#else

! Terminating the MPI environment
call MPI_ABORT(MPI_COMM_WORLD, 1, ierr)

if (present(code)) then
call MPI_ABORT(MPI_COMM_WORLD, code, ierr)

Check warning on line 497 in src/common/m_mpi_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_mpi_common.fpp#L497

Added line #L497 was not covered by tests
else
call MPI_ABORT(MPI_COMM_WORLD, 1, ierr)

Check warning on line 499 in src/common/m_mpi_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_mpi_common.fpp#L499

Added line #L499 was not covered by tests
end if
#endif

end subroutine s_mpi_abort
Expand Down
5 changes: 5 additions & 0 deletions toolchain/templates/include/helpers.mako
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ END

t_${target.name}_stop=$(python3 -c 'import time; print(time.time())')

if [ $code -eq 22 ]; then
echo
error "$YELLOW CASE FILE ERROR$COLOR_RESET > $YELLOW Case file has prohibited conditions as stated above.$COLOR_RESET"
fi

if [ $code -ne 0 ]; then
echo
error ":( $MAGENTA${target.get_install_binpath(case)}$COLOR_RESET failed with exit code $MAGENTA$code$COLOR_RESET."
Expand Down
Loading