|
5 | 5 | ! contract # NRC-HQ-60-17-C-0007
|
6 | 6 | !
|
7 | 7 | submodule(units_interface) units_implementation
|
8 |
| - use assertions_interface, only : assertions,assert |
| 8 | + use assert_m, only : assert |
9 | 9 | implicit none
|
10 | 10 |
|
11 | 11 | contains
|
|
79 | 79 | end procedure
|
80 | 80 |
|
81 | 81 | module procedure real_power
|
82 |
| - if (assertions) call assert(this%is_dimensionless(), & |
| 82 | + call assert(this%is_dimensionless(), & |
83 | 83 | & "units%real_power: an entity raised to a real power must be dimensionless")
|
84 | 84 | !! Require dimensionless operand => result is default-initialized as dimensionless
|
85 | 85 | end procedure
|
|
90 | 90 | end procedure
|
91 | 91 |
|
92 | 92 | module procedure add
|
93 |
| - if (assertions) then |
94 |
| - !! Require consistent operand units |
95 |
| - associate(preconditions => [lhs%system==rhs%system, lhs%exponents_==rhs%exponents_] ) |
96 |
| - call assert( all(preconditions), "units%add: consistent operands units") |
97 |
| - end associate |
98 |
| - end if |
| 93 | + !! Require consistent operand units |
| 94 | + associate(preconditions => [lhs%system==rhs%system, lhs%exponents_==rhs%exponents_] ) |
| 95 | + call assert( all(preconditions), "units%add: consistent operands units") |
| 96 | + end associate |
99 | 97 | total%exponents_ = lhs%exponents_
|
100 | 98 | total%system = lhs%system
|
101 | 99 | end procedure
|
102 | 100 |
|
103 | 101 | module procedure subtract
|
104 |
| - if (assertions) then |
105 |
| - !! Require consistent operand units |
106 |
| - associate(preconditions => [lhs%system==rhs%system, lhs%exponents_==rhs%exponents_] ) |
107 |
| - call assert( all(preconditions), "units%subtract: consistent operand units") |
108 |
| - end associate |
109 |
| - end if |
| 102 | + !! Require consistent operand units |
| 103 | + associate(preconditions => [lhs%system==rhs%system, lhs%exponents_==rhs%exponents_] ) |
| 104 | + call assert( all(preconditions), "units%subtract: consistent operand units") |
| 105 | + end associate |
110 | 106 | difference%exponents_ = lhs%exponents_
|
111 | 107 | difference%system = lhs%system
|
112 | 108 | end procedure
|
113 | 109 |
|
114 | 110 | module procedure multiply
|
115 | 111 |
|
116 |
| - if (assertions) call assert( lhs%system==rhs%system, "units%multiply: consistent operand units" ) |
| 112 | + call assert( lhs%system==rhs%system, "units%multiply: consistent operand units" ) |
117 | 113 |
|
118 | 114 | product_%exponents_ = lhs%exponents_ + rhs%exponents_
|
119 | 115 | product_%system = lhs%system
|
120 | 116 | end procedure
|
121 | 117 |
|
122 | 118 | module procedure divide
|
123 | 119 |
|
124 |
| - if (assertions) call assert( numerator%system==denominator%system, "units%divide: consistent operand units" ) |
| 120 | + call assert( numerator%system==denominator%system, "units%divide: consistent operand units" ) |
125 | 121 |
|
126 | 122 | ratio%exponents_ = numerator%exponents_ - denominator%exponents_
|
127 | 123 | ratio%system = merge(numerator%system,dimensionless,any(ratio%exponents_/=0))
|
|
0 commit comments