@@ -18,6 +18,7 @@ module test_constants
18
18
STANDARD_ACCELERATION_OF_GRAVITY
19
19
implicit none
20
20
private
21
+ real (dp) :: fac
21
22
public :: collect_constants
22
23
23
24
contains
@@ -56,10 +57,10 @@ subroutine collect_constants(testsuite)
56
57
end subroutine
57
58
58
59
subroutine test_year (error )
59
- type (error_type), allocatable , intent (out ) :: error
60
-
60
+ type (error_type), allocatable , intent (out ) :: error
61
+
61
62
integer (int32) :: value, expected, diff
62
-
63
+
63
64
expected = 2022
64
65
value = YEAR
65
66
diff = expected - value
@@ -68,8 +69,8 @@ subroutine test_year(error)
68
69
end subroutine
69
70
70
71
subroutine test_ALPHA_PARTICLE_ELECTRON_MASS_RATIO (error )
71
- type (error_type), allocatable , intent (out ) :: error
72
- real (dp) :: value, expected, diff, fac
72
+ type (error_type), allocatable , intent (out ) :: error
73
+ real (dp) :: value, expected, diff
73
74
fac = 1.0d0
74
75
expected = 7294.29954171d0 * fac
75
76
value = ALPHA_PARTICLE_ELECTRON_MASS_RATIO% to_real(fac) * fac
@@ -79,8 +80,8 @@ subroutine test_ALPHA_PARTICLE_ELECTRON_MASS_RATIO(error)
79
80
end subroutine
80
81
81
82
subroutine test_ALPHA_PARTICLE_MASS (error )
82
- type (error_type), allocatable , intent (out ) :: error
83
- real (dp) :: value, expected, diff, fac
83
+ type (error_type), allocatable , intent (out ) :: error
84
+ real (dp) :: value, expected, diff
84
85
fac = 1.0d27
85
86
expected = 6.6446573450d-27 * fac
86
87
value = ALPHA_PARTICLE_MASS% to_real(fac) * fac
@@ -90,8 +91,8 @@ subroutine test_ALPHA_PARTICLE_MASS(error)
90
91
end subroutine
91
92
92
93
subroutine test_ATOMIC_MASS_CONSTANT (error )
93
- type (error_type), allocatable , intent (out ) :: error
94
- real (dp) :: value, expected, diff, fac
94
+ type (error_type), allocatable , intent (out ) :: error
95
+ real (dp) :: value, expected, diff
95
96
fac = 1.0d27
96
97
expected = 1.66053906892d-27 * fac
97
98
value = ATOMIC_MASS_CONSTANT% to_real(fac) * fac
@@ -101,8 +102,8 @@ subroutine test_ATOMIC_MASS_CONSTANT(error)
101
102
end subroutine
102
103
103
104
subroutine test_AVOGADRO_CONSTANT (error )
104
- type (error_type), allocatable , intent (out ) :: error
105
- real (dp) :: value, expected, diff, fac
105
+ type (error_type), allocatable , intent (out ) :: error
106
+ real (dp) :: value, expected, diff
106
107
fac = 1.0d-23
107
108
expected = 6.02214076d23 * fac
108
109
value = AVOGADRO_CONSTANT% to_real(fac) * fac
@@ -112,8 +113,8 @@ subroutine test_AVOGADRO_CONSTANT(error)
112
113
end subroutine
113
114
114
115
subroutine test_BOLTZMANN_CONSTANT (error )
115
- type (error_type), allocatable , intent (out ) :: error
116
- real (dp) :: value, expected, diff, fac
116
+ type (error_type), allocatable , intent (out ) :: error
117
+ real (dp) :: value, expected, diff
117
118
fac = 1.0d23
118
119
expected = 1.380649d-23 * fac
119
120
value = BOLTZMANN_CONSTANT% to_real(fac) * fac
@@ -123,8 +124,8 @@ subroutine test_BOLTZMANN_CONSTANT(error)
123
124
end subroutine
124
125
125
126
subroutine test_ELECTRON_VOLT (error )
126
- type (error_type), allocatable , intent (out ) :: error
127
- real (dp) :: value, expected, diff, fac
127
+ type (error_type), allocatable , intent (out ) :: error
128
+ real (dp) :: value, expected, diff
128
129
fac = 1.0d19
129
130
expected = 1.602176634d-19 * fac
130
131
value = ELECTRON_VOLT% to_real(fac) * fac
@@ -134,8 +135,8 @@ subroutine test_ELECTRON_VOLT(error)
134
135
end subroutine
135
136
136
137
subroutine test_ELEMENTARY_CHARGE (error )
137
- type (error_type), allocatable , intent (out ) :: error
138
- real (dp) :: value, expected, diff, fac
138
+ type (error_type), allocatable , intent (out ) :: error
139
+ real (dp) :: value, expected, diff
139
140
fac = 1.0d19
140
141
expected = 1.602176634d-19 * fac
141
142
value = ELEMENTARY_CHARGE% to_real(fac) * fac
@@ -145,8 +146,8 @@ subroutine test_ELEMENTARY_CHARGE(error)
145
146
end subroutine
146
147
147
148
subroutine test_FARADAY_CONSTANT (error )
148
- type (error_type), allocatable , intent (out ) :: error
149
- real (dp) :: value, expected, diff, fac
149
+ type (error_type), allocatable , intent (out ) :: error
150
+ real (dp) :: value, expected, diff
150
151
fac = 1.0d0
151
152
expected = 96485.33212d0 * fac
152
153
value = FARADAY_CONSTANT% to_real(fac) * fac
@@ -156,8 +157,8 @@ subroutine test_FARADAY_CONSTANT(error)
156
157
end subroutine
157
158
158
159
subroutine test_MOLAR_MASS_CONSTANT (error )
159
- type (error_type), allocatable , intent (out ) :: error
160
- real (dp) :: value, expected, diff, fac
160
+ type (error_type), allocatable , intent (out ) :: error
161
+ real (dp) :: value, expected, diff
161
162
fac = 1.0d3
162
163
expected = 1.00000000105d-3 * fac
163
164
value = MOLAR_MASS_CONSTANT% to_real(fac) * fac
@@ -167,8 +168,8 @@ subroutine test_MOLAR_MASS_CONSTANT(error)
167
168
end subroutine
168
169
169
170
subroutine test_MOLAR_VOLUME_NTP (error )
170
- type (error_type), allocatable , intent (out ) :: error
171
- real (dp) :: value, expected, diff, fac
171
+ type (error_type), allocatable , intent (out ) :: error
172
+ real (dp) :: value, expected, diff
172
173
fac = 1.0d3
173
174
expected = 22.41396954d-3 * fac
174
175
value = MOLAR_VOLUME_OF_IDEAL_GAS_273_15_K_101_325_KPA% to_real(fac) * fac
@@ -178,8 +179,8 @@ subroutine test_MOLAR_VOLUME_NTP(error)
178
179
end subroutine
179
180
180
181
subroutine test_PLANCK_CONSTANT (error )
181
- type (error_type), allocatable , intent (out ) :: error
182
- real (dp) :: value, expected, diff, fac
182
+ type (error_type), allocatable , intent (out ) :: error
183
+ real (dp) :: value, expected, diff
183
184
fac = 1.0d34
184
185
expected = 6.62607015d-34 * fac
185
186
value = PLANCK_CONSTANT% to_real(fac) * fac
@@ -189,8 +190,8 @@ subroutine test_PLANCK_CONSTANT(error)
189
190
end subroutine
190
191
191
192
subroutine test_SPEED_OF_LIGHT (error )
192
- type (error_type), allocatable , intent (out ) :: error
193
- real (dp) :: value, expected, diff, fac
193
+ type (error_type), allocatable , intent (out ) :: error
194
+ real (dp) :: value, expected, diff
194
195
fac = 1.0d0
195
196
expected = 299792458.0d0 * fac
196
197
value = SPEED_OF_LIGHT_IN_VACUUM% to_real(fac) * fac
@@ -200,19 +201,19 @@ subroutine test_SPEED_OF_LIGHT(error)
200
201
end subroutine
201
202
202
203
subroutine test_STANDARD_ACCELERATION_OF_GRAVITY (error )
203
- type (error_type), allocatable , intent (out ) :: error
204
- real (dp) :: value, expected, diff, fac
204
+ type (error_type), allocatable , intent (out ) :: error
205
+ real (dp) :: value, expected, diff
205
206
fac = 1.0d0
206
207
expected = 9.80665d0 * fac
207
- value = STANDARD_ACCELERATION_OF_GRAVITY% to_real(fac) * fac
208
+ value = STANDARD_ACCELERATION_OF_GRAVITY% to_real(fac) * fac
208
209
diff = expected - value
209
210
call check(error, diff, 0.0d0 )
210
211
if (allocated (error)) return
211
212
end subroutine
212
213
213
214
subroutine test_U_ALPHA_PARTICLE_ELECTRON_MASS_RATIO (error )
214
- type (error_type), allocatable , intent (out ) :: error
215
- real (dp) :: value, expected, diff, fac
215
+ type (error_type), allocatable , intent (out ) :: error
216
+ real (dp) :: value, expected, diff
216
217
fac = 1.0d7
217
218
expected = 0.00000017d0 * fac
218
219
value = ALPHA_PARTICLE_ELECTRON_MASS_RATIO% to_real(fac, uncertainty= .true. ) * fac
@@ -222,8 +223,8 @@ subroutine test_U_ALPHA_PARTICLE_ELECTRON_MASS_RATIO(error)
222
223
end subroutine
223
224
224
225
subroutine test_U_ALPHA_PARTICLE_MASS (error )
225
- type (error_type), allocatable , intent (out ) :: error
226
- real (dp) :: value, expected, diff, fac
226
+ type (error_type), allocatable , intent (out ) :: error
227
+ real (dp) :: value, expected, diff
227
228
fac = 1.0d36
228
229
expected = 0.0000000021d-27 * fac
229
230
value = ALPHA_PARTICLE_MASS% to_real(fac, uncertainty= .true. ) * fac
@@ -233,8 +234,8 @@ subroutine test_U_ALPHA_PARTICLE_MASS(error)
233
234
end subroutine
234
235
235
236
subroutine test_U_ATOMIC_MASS_CONSTANT (error )
236
- type (error_type), allocatable , intent (out ) :: error
237
- real (dp) :: value, expected, diff, fac
237
+ type (error_type), allocatable , intent (out ) :: error
238
+ real (dp) :: value, expected, diff
238
239
fac = 1.0d37
239
240
expected = 0.00000000052d-27 * fac
240
241
value = ATOMIC_MASS_CONSTANT% to_real(fac, uncertainty= .true. ) * fac
@@ -244,8 +245,8 @@ subroutine test_U_ATOMIC_MASS_CONSTANT(error)
244
245
end subroutine
245
246
246
247
subroutine test_U_AVOGADRO_CONSTANT (error )
247
- type (error_type), allocatable , intent (out ) :: error
248
- real (dp) :: value, expected, diff, fac
248
+ type (error_type), allocatable , intent (out ) :: error
249
+ real (dp) :: value, expected, diff
249
250
fac = 1.0d0
250
251
expected = 0.0d0 * fac
251
252
value = AVOGADRO_CONSTANT% to_real(fac, uncertainty= .true. ) * fac
@@ -255,8 +256,8 @@ subroutine test_U_AVOGADRO_CONSTANT(error)
255
256
end subroutine
256
257
257
258
subroutine test_U_BOLTZMANN_CONSTANT (error )
258
- type (error_type), allocatable , intent (out ) :: error
259
- real (dp) :: value, expected, diff, fac
259
+ type (error_type), allocatable , intent (out ) :: error
260
+ real (dp) :: value, expected, diff
260
261
fac = 1.0d0
261
262
expected = 0.0d0 * fac
262
263
value = BOLTZMANN_CONSTANT% to_real(fac, uncertainty= .true. ) * fac
@@ -266,8 +267,8 @@ subroutine test_U_BOLTZMANN_CONSTANT(error)
266
267
end subroutine
267
268
268
269
subroutine test_U_ELECTRON_VOLT (error )
269
- type (error_type), allocatable , intent (out ) :: error
270
- real (dp) :: value, expected, diff, fac
270
+ type (error_type), allocatable , intent (out ) :: error
271
+ real (dp) :: value, expected, diff
271
272
fac = 1.0d0
272
273
expected = 0.0d0 * fac
273
274
value = ELECTRON_VOLT% to_real(fac, uncertainty= .true. ) * fac
@@ -277,8 +278,8 @@ subroutine test_U_ELECTRON_VOLT(error)
277
278
end subroutine
278
279
279
280
subroutine test_U_ELEMENTARY_CHARGE (error )
280
- type (error_type), allocatable , intent (out ) :: error
281
- real (dp) :: value, expected, diff, fac
281
+ type (error_type), allocatable , intent (out ) :: error
282
+ real (dp) :: value, expected, diff
282
283
fac = 1.0d0
283
284
expected = 0.0d0 * fac
284
285
value = ELEMENTARY_CHARGE% to_real(fac, uncertainty= .true. ) * fac
@@ -288,8 +289,8 @@ subroutine test_U_ELEMENTARY_CHARGE(error)
288
289
end subroutine
289
290
290
291
subroutine test_U_FARADAY_CONSTANT (error )
291
- type (error_type), allocatable , intent (out ) :: error
292
- real (dp) :: value, expected, diff, fac
292
+ type (error_type), allocatable , intent (out ) :: error
293
+ real (dp) :: value, expected, diff
293
294
fac = 1.0d0
294
295
expected = 0.0d0 * fac
295
296
value = FARADAY_CONSTANT% to_real(fac, uncertainty= .true. ) * fac
@@ -299,8 +300,8 @@ subroutine test_U_FARADAY_CONSTANT(error)
299
300
end subroutine
300
301
301
302
subroutine test_U_MOLAR_MASS_CONSTANT (error )
302
- type (error_type), allocatable , intent (out ) :: error
303
- real (dp) :: value, expected, diff, fac
303
+ type (error_type), allocatable , intent (out ) :: error
304
+ real (dp) :: value, expected, diff
304
305
fac = 1.0d13
305
306
expected = 0.00000000031d-3 * fac
306
307
value = MOLAR_MASS_CONSTANT% to_real(fac, uncertainty= .true. ) * fac
@@ -310,8 +311,8 @@ subroutine test_U_MOLAR_MASS_CONSTANT(error)
310
311
end subroutine
311
312
312
313
subroutine test_U_MOLAR_VOLUME_NTP (error )
313
- type (error_type), allocatable , intent (out ) :: error
314
- real (dp) :: value, expected, diff, fac
314
+ type (error_type), allocatable , intent (out ) :: error
315
+ real (dp) :: value, expected, diff
315
316
fac = 1.0d0
316
317
expected = 0.0d0 * fac
317
318
value = MOLAR_VOLUME_OF_IDEAL_GAS_273_15_K_101_325_KPA% to_real(fac, uncertainty= .true. ) * fac
@@ -321,8 +322,8 @@ subroutine test_U_MOLAR_VOLUME_NTP(error)
321
322
end subroutine
322
323
323
324
subroutine test_U_PLANCK_CONSTANT (error )
324
- type (error_type), allocatable , intent (out ) :: error
325
- real (dp) :: value, expected, diff, fac
325
+ type (error_type), allocatable , intent (out ) :: error
326
+ real (dp) :: value, expected, diff
326
327
fac = 1.0d0
327
328
expected = 0.0d0 * fac
328
329
value = PLANCK_CONSTANT% to_real(fac, uncertainty= .true. ) * fac
@@ -332,8 +333,8 @@ subroutine test_U_PLANCK_CONSTANT(error)
332
333
end subroutine
333
334
334
335
subroutine test_U_SPEED_OF_LIGHT (error )
335
- type (error_type), allocatable , intent (out ) :: error
336
- real (dp) :: value, expected, diff, fac
336
+ type (error_type), allocatable , intent (out ) :: error
337
+ real (dp) :: value, expected, diff
337
338
fac = 1.0d0
338
339
expected = 0.0d0 * fac
339
340
value = SPEED_OF_LIGHT_IN_VACUUM% to_real(fac, uncertainty= .true. ) * fac
@@ -343,8 +344,8 @@ subroutine test_U_SPEED_OF_LIGHT(error)
343
344
end subroutine
344
345
345
346
subroutine test_U_STANDARD_ACCELERATION_OF_GRAVITY (error )
346
- type (error_type), allocatable , intent (out ) :: error
347
- real (dp) :: value, expected, diff, fac
347
+ type (error_type), allocatable , intent (out ) :: error
348
+ real (dp) :: value, expected, diff
348
349
fac = 1.0d0
349
350
expected = 0.0d0 * fac
350
351
value = STANDARD_ACCELERATION_OF_GRAVITY% to_real(fac, uncertainty= .true. ) * fac
@@ -378,4 +379,4 @@ program tester
378
379
error stop
379
380
end if
380
381
381
- end program
382
+ end program
0 commit comments