source: LMDZ5/trunk/tools/Max_diff_nc_with_lib/NR_util/assert_eq.f90 @ 1907

Last change on this file since 1907 was 1907, checked in by lguez, 10 years ago

Added a copyright property to every file of the distribution, except
for the fcm files (which have their own copyright). Use svn propget on
a file to see the copyright. For instance:

$ svn propget copyright libf/phylmd/physiq.F90
Name of program: LMDZ
Creation date: 1984
Version: LMDZ5
License: CeCILL version 2
Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
See the license file in the root directory

Also added the files defining the CeCILL version 2 license, in French
and English, at the top of the LMDZ tree.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 1.8 KB
Line 
1MODULE assert_eq_m
2
3  implicit none
4
5  INTERFACE assert_eq
6     MODULE PROCEDURE assert_eq2,assert_eq3,assert_eq4,assert_eqn
7  END INTERFACE
8
9  private assert_eq2,assert_eq3,assert_eq4,assert_eqn
10
11CONTAINS
12
13  FUNCTION assert_eq2(n1,n2,string)
14    CHARACTER(LEN=*), INTENT(IN) :: string
15    INTEGER, INTENT(IN) :: n1,n2
16    INTEGER  assert_eq2
17    if (n1 == n2) then
18       assert_eq2=n1
19    else
20       write (*,*) 'nrerror: an assert_eq failed with this tag: ', &
21            string
22       print *, 'program terminated by assert_eq2'
23       stop 1
24    end if
25  END FUNCTION assert_eq2
26  !BL
27  FUNCTION assert_eq3(n1,n2,n3,string)
28    CHARACTER(LEN=*), INTENT(IN) :: string
29    INTEGER, INTENT(IN) :: n1,n2,n3
30    INTEGER  assert_eq3
31    if (n1 == n2 .and. n2 == n3) then
32       assert_eq3=n1
33    else
34       write (*,*) 'nrerror: an assert_eq failed with this tag: ', &
35            string
36       print *, 'program terminated by assert_eq3'
37       stop 1
38    end if
39  END FUNCTION assert_eq3
40  !BL
41  FUNCTION assert_eq4(n1,n2,n3,n4,string)
42    CHARACTER(LEN=*), INTENT(IN) :: string
43    INTEGER, INTENT(IN) :: n1,n2,n3,n4
44    INTEGER  assert_eq4
45    if (n1 == n2 .and. n2 == n3 .and. n3 == n4) then
46       assert_eq4=n1
47    else
48       write (*,*) 'nrerror: an assert_eq failed with this tag: ', &
49            string
50       print *, 'program terminated by assert_eq4'
51       stop 1
52    end if
53  END FUNCTION assert_eq4
54  !BL
55  FUNCTION assert_eqn(nn,string)
56    CHARACTER(LEN=*), INTENT(IN) :: string
57    INTEGER, DIMENSION(:), INTENT(IN) :: nn
58    INTEGER  assert_eqn
59    if (all(nn(2:) == nn(1))) then
60       assert_eqn=nn(1)
61    else
62       write (*,*) 'nrerror: an assert_eq failed with this tag: ', &
63            string
64       print *, 'program terminated by assert_eqn'
65       stop 1
66    end if
67  END FUNCTION assert_eqn
68
69END MODULE assert_eq_m
Note: See TracBrowser for help on using the repository browser.