Skip to content

Commit ccecba2

Browse files
author
Damian Rouson
authored
Merge pull request #21 from sourceryinstitute/remove-assert
Remove assert
2 parents 6b925cb + 62c2244 commit ccecba2

File tree

6 files changed

+10
-116
lines changed

6 files changed

+10
-116
lines changed

fpm.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ author = ["Damian Rouson"]
55
maintainer = "[email protected]"
66
copyright = "2020 Sourcery Institute"
77

8+
[dependencies]
9+
assert = {git = "https://github.com/sourceryinstitute/assert", tag = "1.0.0"}
10+
811
[dev-dependencies]
912
vegetables = {git = "https://gitlab.com/everythingfunctional/vegetables", tag = "v6.0.1"}
1013

src/array_functions_implementation.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
! contract # NRC-HQ-60-17-C-0007
66
!
77
submodule(array_functions_interface) array_functions_implementation
8-
use assertions_interface, only : assert, assertions
8+
use assert_m, only : assert
99
implicit none
1010
contains
1111

1212
module procedure column_vectors
1313
integer i, j, k
1414

1515
associate( n => shape(vector_field) )
16-
if (assertions) call assert(size(n)==4, "3D vector field input")
16+
call assert(size(n)==4, "3D vector field input")
1717
allocate( array_of_3D_column_vectors( n(4), product(n(1:3)) ) )
1818
do concurrent( i=1:n(1), j=1:n(2), k=1:n(3) )
1919
associate( id => (k-1)*PRODUCT(n(1:2)) + (j-1)*n(1) + i )
@@ -34,7 +34,7 @@
3434
associate(cols=>size(a,2)+size(b,2))
3535
associate(a_unrolled=>reshape(a,[size(a)]))
3636
associate(b_unrolled=>reshape(b,[size(b)]))
37-
if (assertions) call assert( rows==size(b,1), "array_functions: compatible shapes")
37+
call assert( rows==size(b,1), "array_functions: compatible shapes")
3838
concatenated = reshape( [a_unrolled, b_unrolled ],[rows, cols] )
3939
end associate; end associate; end associate; end associate
4040
end procedure

src/assertions_implementation.F90

Lines changed: 0 additions & 62 deletions
This file was deleted.

src/assertions_interface.F90

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/data-partition-implementation.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
submodule(data_partition_interface) data_partition_implementation
2-
use assertions_interface, only : assert, assertions
2+
use assert_m, only : assert
33
implicit none
44

55
logical, parameter :: verbose=.false.
@@ -45,12 +45,12 @@ pure function overflow(im, excess) result(extra_datum)
4545
#endif
4646

4747
module procedure first
48-
if (assertions) call assert( allocated(first_datum), "allocated(first_datum)")
48+
call assert( allocated(first_datum), "allocated(first_datum)")
4949
first_index= first_datum( image_number )
5050
end procedure
5151

5252
module procedure last
53-
if (assertions) call assert( allocated(last_datum), "allocated(last_datum)")
53+
call assert( allocated(last_datum), "allocated(last_datum)")
5454
last_index = last_datum( image_number )
5555
end procedure
5656

src/emulated_intrinsics_implementation.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
! contract # NRC-HQ-60-17-C-0007
66
!
77
submodule(emulated_intrinsics_interface) emulated_intrinsics_implementation
8-
use assertions_interface, only : assert
8+
use assert_m, only : assert
99
implicit none
1010

1111
contains

0 commit comments

Comments
 (0)