Changeset 5113 for LMDZ6/branches/Amaury_dev/libf/misc/lmdz_assert.f90
- Timestamp:
- Jul 24, 2024, 1:17:08 PM (2 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/misc/lmdz_assert.f90
r5112 r5113 1 1 ! $Id$ 2 MODULE assert_m2 MODULE lmdz_assert 3 3 4 implicit none4 IMPLICIT NONE 5 5 6 6 INTERFACE assert 7 MODULE PROCEDURE assert1,assert2,assert3,assert4,assert_v7 MODULE PROCEDURE assert1, assert2, assert3, assert4, assert_v 8 8 END INTERFACE 9 9 10 private assert1,assert2,assert3,assert4,assert_v10 PRIVATE assert1, assert2, assert3, assert4, assert_v 11 11 12 12 CONTAINS 13 13 14 SUBROUTINE assert1(n1, string)15 CHARACTER(LEN =*), INTENT(IN) :: string14 SUBROUTINE assert1(n1, string) 15 CHARACTER(LEN = *), INTENT(IN) :: string 16 16 LOGICAL, INTENT(IN) :: n1 17 17 if (.not. n1) then 18 write (*,*) 'nrerror: an assertion failed with this tag:', &19 string20 21 18 write (*, *) 'nrerror: an assertion failed with this tag:', & 19 string 20 print *, 'program terminated by assert1' 21 stop 1 22 22 end if 23 23 END SUBROUTINE assert1 24 24 !BL 25 SUBROUTINE assert2(n1, n2,string)26 CHARACTER(LEN =*), INTENT(IN) :: string27 LOGICAL, INTENT(IN) :: n1, n225 SUBROUTINE assert2(n1, n2, string) 26 CHARACTER(LEN = *), INTENT(IN) :: string 27 LOGICAL, INTENT(IN) :: n1, n2 28 28 if (.not. (n1 .and. n2)) then 29 write (*,*) 'nrerror: an assertion failed with this tag:', &30 string31 32 29 write (*, *) 'nrerror: an assertion failed with this tag:', & 30 string 31 print *, 'program terminated by assert2' 32 stop 1 33 33 end if 34 34 END SUBROUTINE assert2 35 35 !BL 36 SUBROUTINE assert3(n1, n2,n3,string)37 CHARACTER(LEN =*), INTENT(IN) :: string38 LOGICAL, INTENT(IN) :: n1, n2,n336 SUBROUTINE assert3(n1, n2, n3, string) 37 CHARACTER(LEN = *), INTENT(IN) :: string 38 LOGICAL, INTENT(IN) :: n1, n2, n3 39 39 if (.not. (n1 .and. n2 .and. n3)) then 40 write (*,*) 'nrerror: an assertion failed with this tag:', &41 string42 43 40 write (*, *) 'nrerror: an assertion failed with this tag:', & 41 string 42 print *, 'program terminated by assert3' 43 stop 1 44 44 end if 45 45 END SUBROUTINE assert3 46 46 !BL 47 SUBROUTINE assert4(n1, n2,n3,n4,string)48 CHARACTER(LEN =*), INTENT(IN) :: string49 LOGICAL, INTENT(IN) :: n1, n2,n3,n447 SUBROUTINE assert4(n1, n2, n3, n4, string) 48 CHARACTER(LEN = *), INTENT(IN) :: string 49 LOGICAL, INTENT(IN) :: n1, n2, n3, n4 50 50 if (.not. (n1 .and. n2 .and. n3 .and. n4)) then 51 write (*,*) 'nrerror: an assertion failed with this tag:', &52 string53 54 51 write (*, *) 'nrerror: an assertion failed with this tag:', & 52 string 53 print *, 'program terminated by assert4' 54 stop 1 55 55 end if 56 56 END SUBROUTINE assert4 57 57 !BL 58 SUBROUTINE assert_v(n, string)59 CHARACTER(LEN =*), INTENT(IN) :: string58 SUBROUTINE assert_v(n, string) 59 CHARACTER(LEN = *), INTENT(IN) :: string 60 60 LOGICAL, DIMENSION(:), INTENT(IN) :: n 61 61 if (.not. all(n)) then 62 write (*,*) 'nrerror: an assertion failed with this tag:', &63 string64 65 62 write (*, *) 'nrerror: an assertion failed with this tag:', & 63 string 64 print *, 'program terminated by assert_v' 65 stop 1 66 66 end if 67 67 END SUBROUTINE assert_v 68 68 69 END MODULE assert_m69 END MODULE lmdz_assert
Note: See TracChangeset
for help on using the changeset viewer.