Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 5 additions & 9 deletions fortitude.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
[check]
exclude = ['.venv']
exclude = [
'.venv',
'fruit/fruit.f90',
'fruit/fruit_mpi.f90',
]
ignore = [
'C002', # interface-implicit-typing
'C003', # implicit-external-procedures
'C061', # missing-intent
'C071', # assumed-size
'C072', # assumed-size-character-intent
'C081', # initialisation-in-declaration
'C121', # use-all
'C141', # missing-exit-or-cycle-label
'E001', # syntax-error
'MOD011', # old-style-array-literal
'MOD021', # deprecated-relational-operator
'S061', # unnamed-end-statement
]
20 changes: 11 additions & 9 deletions fruit/fruit.f90
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function integer32Equal (number1, number2 ) result (resultValue)

resultValue = .false.

if ( number1 .eq. number2 ) then
if ( number1 == number2 ) then
resultValue = .true.
else
resultValue = .false.
Expand All @@ -243,7 +243,7 @@ function integer64Equal (number1, number2 ) result (resultValue)

resultValue = .false.

if ( number1 .eq. number2 ) then
if ( number1 == number2 ) then
resultValue = .true.
else
resultValue = .false.
Expand All @@ -256,7 +256,7 @@ function stringEqual (str1, str2 ) result (resultValue)

resultValue = .false.

if ( str1 .eq. str2 ) then
if ( str1 == str2 ) then
resultValue = .true.
end if
end function stringEqual
Expand Down Expand Up @@ -971,7 +971,8 @@ end subroutine fruit_hide_dots_
subroutine run_test_case_named_( tc, tc_name )
interface
subroutine tc()
end subroutine
implicit none
end subroutine tc
end interface
character(*), intent(in) :: tc_name

Expand All @@ -996,7 +997,7 @@ subroutine tc()

!$OMP BARRIER

if ( initial_failed_assert_count .eq. failed_assert_count ) then
if ( initial_failed_assert_count == failed_assert_count ) then
! If no additional assertions failed during the run of this test case
! then the test case was successful
successful_case_count = successful_case_count+1
Expand All @@ -1015,7 +1016,8 @@ end subroutine run_test_case_named_
subroutine run_test_case_( tc )
interface
subroutine tc()
end subroutine
implicit none
end subroutine tc
end interface

call run_test_case_named_( tc, '_unnamed_' )
Expand Down Expand Up @@ -1100,12 +1102,12 @@ end subroutine add_fail_unit_
subroutine obsolete_isAllSuccessful_(result)
logical, intent(out) :: result
call obsolete_ ('subroutine isAllSuccessful is changed to function is_all_successful.')
result = (failed_assert_count .eq. 0 )
result = (failed_assert_count == 0 )
end subroutine obsolete_isAllSuccessful_

subroutine is_all_successful(result)
logical, intent(out) :: result
result= (failed_assert_count .eq. 0 )
result= (failed_assert_count == 0 )
end subroutine is_all_successful

! Private, helper routine to wrap lines of success/failed marks
Expand All @@ -1117,7 +1119,7 @@ subroutine output_mark_( chr )

!$omp critical (FRUIT_OMP_ADD_OUTPUT_MARK)
linechar_count = linechar_count + 1
if ( linechar_count .lt. MAX_MARKS_PER_LINE ) then
if ( linechar_count < MAX_MARKS_PER_LINE ) then
write(stdout,"(A1)",ADVANCE='NO') chr
else
write(stdout,"(A1)",ADVANCE='YES') chr
Expand Down
24 changes: 22 additions & 2 deletions shum_byteswap/test/fruit_test_shum_byteswap.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,30 @@
!*******************************************************************************
MODULE fruit_test_shum_byteswap_mod

USE fruit
USE fruit, ONLY: assert_equals, assert_true, run_test_case, set_case_name
USE, INTRINSIC :: ISO_C_BINDING, ONLY: &
C_INT64_T, C_INT32_T, C_FLOAT, C_DOUBLE, C_BOOL
USE f_shum_ztables_mod
USE f_shum_ztables_mod, ONLY: &
z0000000000000040, z0000000000000840, z0000000000001040, &
z0000000000001440, z0000000000001840, z0000000000001C40, &
z0000000000002040, z0000000000002240, z0000000000002440, &
z000000000000F03F, z0000000001000000, z0000000002000000, &
z0000000003000000, z0000000004000000, z0000000005000000, &
z0000000006000000, z0000000007000000, z0000000008000000, &
z0000000009000000, z000000000A000000, z00000040, &
z0000004000000000, z00000041, z0000084000000000, &
z0000104000000000, z00001041, z0000144000000000, &
z0000184000000000, z00001C4000000000, z0000204000000000, &
z00002041, z0000224000000000, z0000244000000000, &
z00004040, z0000803F, z00008040, &
z0000A040, z0000C040, z0000E040, &
z0000F03F00000000, z01000000, z0100000000000000, &
z02000000, z0200000000000000, z03000000, &
z0300000000000000, z04000000, z0400000000000000, &
z05000000, z0500000000000000, z06000000, &
z0600000000000000, z07000000, z0700000000000000, &
z08000000, z0800000000000000, z09000000, &
z0900000000000000, z0A000000, z0A00000000000000

IMPLICIT NONE
PRIVATE
Expand Down
16 changes: 8 additions & 8 deletions shum_fieldsfile/src/f_shum_fieldsfile.f90
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ FUNCTION unique_id_to_ff(id) RESULT(ff)
! returning the last element in the list
NULLIFY(ff)

END FUNCTION
END FUNCTION unique_id_to_ff

!------------------------------------------------------------------------------!

Expand Down Expand Up @@ -1989,8 +1989,8 @@ END FUNCTION f_shum_write_fixed_length_header
FUNCTION commit_fixed_length_header(ff, message) RESULT(STATUS)
IMPLICIT NONE

TYPE(ff_type) :: ff
CHARACTER(LEN=*) :: message
TYPE(ff_type), INTENT(IN OUT) :: ff
CHARACTER(LEN=*), INTENT(OUT) :: message
INTEGER(KIND=INT64) :: STATUS

INTEGER(KIND=INT64), ALLOCATABLE :: swap_header(:)
Expand Down Expand Up @@ -2044,7 +2044,7 @@ END FUNCTION commit_fixed_length_header
FUNCTION get_next_free_position(ff) RESULT(POSITION)
IMPLICIT NONE

TYPE(ff_type) :: ff
TYPE(ff_type), INTENT(IN) :: ff
INTEGER(KIND=INT64) :: POSITION

POSITION = f_shum_fixed_length_header_len + 1
Expand Down Expand Up @@ -2133,8 +2133,8 @@ END FUNCTION get_next_free_position
FUNCTION get_next_populated_position(ff, start) RESULT(POSITION)
IMPLICIT NONE

TYPE(ff_type) :: ff
INTEGER(KIND=INT64) :: start
TYPE(ff_type), INTENT(IN) :: ff
INTEGER(KIND=INT64), INTENT(IN) :: start
INTEGER(KIND=INT64) :: POSITION

POSITION = HUGE(0_int64)
Expand Down Expand Up @@ -3059,8 +3059,8 @@ END FUNCTION f_shum_write_lookup
FUNCTION commit_lookup(ff, message) RESULT(STATUS)
IMPLICIT NONE

TYPE(ff_type) :: ff
CHARACTER(LEN=*) :: message
TYPE(ff_type), INTENT(IN OUT) :: ff
CHARACTER(LEN=*), INTENT(OUT) :: message

INTEGER(KIND=INT64) :: STATUS
INTEGER(KIND=INT64) :: start
Expand Down
17 changes: 12 additions & 5 deletions shum_fieldsfile/test/fruit_test_shum_fieldsfile.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
!*******************************************************************************
MODULE fruit_test_shum_fieldsfile_mod

USE fruit
USE fruit, ONLY: assert_equals, assert_false, assert_true, get_failed_count, &
run_test_case
USE, INTRINSIC :: ISO_C_BINDING, ONLY: &
C_INT64_T, C_INT32_T, C_FLOAT, C_DOUBLE, C_INT, C_BOOL

Expand All @@ -38,7 +39,7 @@ SUBROUTINE c_exit(status) BIND(c,NAME="exit")
IMPORT :: C_INT
IMPLICIT NONE
INTEGER(KIND=C_INT), VALUE, INTENT(IN) :: status
END SUBROUTINE
END SUBROUTINE c_exit
END INTERFACE

!------------------------------------------------------------------------------!
Expand Down Expand Up @@ -156,7 +157,7 @@ SUBROUTINE test_end_to_end_direct_write_file
IMPLICIT NONE

INTEGER(KIND=int64) :: status
CHARACTER(LEN=500) :: message = ""
CHARACTER(LEN=500) :: message
INTEGER(KIND=int64) :: ff_id

CHARACTER(LEN=*), PARAMETER :: tempfile="fruit_test_fieldsfile_direct.ff"
Expand Down Expand Up @@ -226,6 +227,8 @@ SUBROUTINE test_end_to_end_direct_write_file

LOGICAL(KIND=bool) :: check

message = ""

! Get the number of failed tests prior to this test starting
CALL get_failed_count(failures_at_entry)

Expand Down Expand Up @@ -878,7 +881,7 @@ SUBROUTINE test_end_to_end_sequential_write_file
IMPLICIT NONE

INTEGER(KIND=int64) :: status
CHARACTER(LEN=500) :: message = ""
CHARACTER(LEN=500) :: message
INTEGER(KIND=int64) :: ff_id

CHARACTER(LEN=*), PARAMETER :: tempfile="fruit_test_fieldsfile_sequential.ff"
Expand Down Expand Up @@ -948,6 +951,8 @@ SUBROUTINE test_end_to_end_sequential_write_file

LOGICAL(KIND=bool) :: check

message = ""

! Get the number of failed tests prior to this test starting
CALL get_failed_count(failures_at_entry)

Expand Down Expand Up @@ -1554,7 +1559,7 @@ SUBROUTINE test_stashmaster_read
IMPLICIT NONE

INTEGER(KIND=int64) :: status
CHARACTER(LEN=500) :: message = ""
CHARACTER(LEN=500) :: message
CHARACTER(LEN=1) :: newline
TYPE(shum_STASHmaster), ALLOCATABLE :: STASHmaster(:)

Expand All @@ -1569,6 +1574,8 @@ SUBROUTINE test_stashmaster_read
INTEGER(KIND=int64) :: packing_codes(10)
LOGICAL(KIND=bool) :: check

message = ""

! Get the number of failed tests prior to this test starting
CALL get_failed_count(failures_at_entry)

Expand Down
Loading