Skip to content

Commit 43a6030

Browse files
committed
type cast to DBLE
1 parent cd401cf commit 43a6030

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

test/nf90_test/util.F90

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ logical FUNCTION INRANGE_FLOAT(VALUE, DATATYPE)
144144
MIN = 0
145145
MAX = X_UINT_MAX
146146
ELSE IF (DATATYPE .EQ. NF90_INT64) THEN
147-
MIN = X_INT8_MIN
148-
MAX = X_INT8_MAX
147+
MIN = DBLE(X_INT8_MIN)
148+
MAX = DBLE(X_INT8_MAX)
149149
ELSE IF (DATATYPE .EQ. NF90_UINT64) THEN
150150
MIN = 0
151151
MAX = X_UINT8_MAX
@@ -364,67 +364,67 @@ double precision function hash(type, rank, index)
364364
if (abs(rank) .eq. 1 .and. index(1) .le. 4) then
365365
if (index(1) .eq. 1) then
366366
if (type .eq. NF90_CHAR) then
367-
hash = X_CHAR_MIN
367+
hash = DBLE(X_CHAR_MIN)
368368
else if (type .eq. NF90_BYTE) then
369-
hash = X_BYTE_MIN
369+
hash = DBLE(X_BYTE_MIN)
370370
else if (type .eq. NF90_SHORT) then
371-
hash = X_SHORT_MIN
371+
hash = DBLE(X_SHORT_MIN)
372372
else if (type .eq. NF90_INT) then
373-
hash = X_INT_MIN
373+
hash = DBLE(X_INT_MIN)
374374
else if (type .eq. NF90_FLOAT) then
375-
hash = X_FLOAT_MIN
375+
hash = DBLE(X_FLOAT_MIN)
376376
else if (type .eq. NF90_DOUBLE) then
377-
hash = X_DOUBLE_MIN
377+
hash = DBLE(X_DOUBLE_MIN)
378378
else if (type .eq. NF90_UBYTE) then
379379
hash = 0
380380
else if (type .eq. NF90_USHORT) then
381381
hash = 0
382382
else if (type .eq. NF90_UINT) then
383383
hash = 0
384384
else if (type .eq. NF90_INT64) then
385-
hash = X_INT_MIN - 128.0
385+
hash = DBLE(X_INT_MIN - 128.0)
386386
else if (type .eq. NF90_UINT64) then
387387
hash = 0
388388
else
389389
call ud_abort
390390
end if
391391
else if (index(1) .eq. 2) then
392392
if (type .eq. NF90_CHAR) then
393-
hash = X_CHAR_MAX
393+
hash = DBLE(X_CHAR_MAX)
394394
else if (type .eq. NF90_BYTE) then
395-
hash = X_BYTE_MAX
395+
hash = DBLE(X_BYTE_MAX)
396396
else if (type .eq. NF90_SHORT) then
397-
hash = X_SHORT_MAX
397+
hash = DBLE(X_SHORT_MAX)
398398
else if (type .eq. NF90_INT) then
399-
hash = X_INT_MAX
399+
hash = DBLE(X_INT_MAX)
400400
else if (type .eq. NF90_FLOAT) then
401-
hash = X_FLOAT_MAX
401+
hash = DBLE(X_FLOAT_MAX)
402402
else if (type .eq. NF90_DOUBLE) then
403-
hash = X_DOUBLE_MAX
403+
hash = DBLE(X_DOUBLE_MAX)
404404
else if (type .eq. NF90_UBYTE) then
405-
hash = X_UCHAR_MAX
405+
hash = DBLE(X_UCHAR_MAX)
406406
else if (type .eq. NF90_USHORT) then
407-
hash = X_USHORT_MAX
407+
hash = DBLE(X_USHORT_MAX)
408408
else if (type .eq. NF90_UINT) then
409-
hash = X_UINT_MAX
409+
hash = DBLE(X_UINT_MAX)
410410
else if (type .eq. NF90_INT64) then
411-
hash = X_INT_MAX + 128.0
411+
hash = DBLE(X_INT_MAX) + 128.0
412412
else if (type .eq. NF90_UINT64) then
413-
hash = X_UINT_MAX + 128.0
413+
hash = DBLE(X_UINT_MAX) + 128.0
414414
else
415415
call ud_abort
416416
end if
417417
else if (index(1) .eq. 3) then
418418
if (type .eq. NF90_CHAR) then
419419
hash = ichar('A')
420420
else if (type .eq. NF90_BYTE) then
421-
hash = X_BYTE_MIN-1.0
421+
hash = DBLE(X_BYTE_MIN-1.0)
422422
else if (type .eq. NF90_SHORT) then
423-
hash = X_SHORT_MIN-1.0
423+
hash = DBLE(X_SHORT_MIN-1.0)
424424
else if (type .eq. NF90_INT) then
425-
hash = X_INT_MIN
425+
hash = DBLE(X_INT_MIN)
426426
else if (type .eq. NF90_FLOAT) then
427-
hash = X_FLOAT_MIN
427+
hash = DBLE(X_FLOAT_MIN)
428428
else if (type .eq. NF90_DOUBLE) then
429429
hash = -1.0
430430
else if (type .eq. NF90_UBYTE) then
@@ -444,21 +444,21 @@ double precision function hash(type, rank, index)
444444
if (type .eq. NF90_CHAR) then
445445
hash = ichar('Z')
446446
else if (type .eq. NF90_BYTE) then
447-
hash = X_BYTE_MAX+1.0
447+
hash = DBLE(X_BYTE_MAX+1.0)
448448
else if (type .eq. NF90_SHORT) then
449-
hash = X_SHORT_MAX+1.0
449+
hash = DBLE(X_SHORT_MAX+1.0)
450450
else if (type .eq. NF90_INT) then
451-
hash = X_INT_MAX+1.0
451+
hash = DBLE(X_INT_MAX)+1.0
452452
else if (type .eq. NF90_FLOAT) then
453-
hash = X_FLOAT_MAX
453+
hash = DBLE(X_FLOAT_MAX)
454454
else if (type .eq. NF90_DOUBLE) then
455455
hash = 1.0
456456
else if (type .eq. NF90_UBYTE) then
457-
hash = X_UCHAR_MAX + 1.0
457+
hash = DBLE(X_UCHAR_MAX + 1.0)
458458
else if (type .eq. NF90_USHORT) then
459-
hash = X_USHORT_MAX + 1.0
459+
hash = DBLE(X_USHORT_MAX + 1.0)
460460
else if (type .eq. NF90_UINT) then
461-
hash = X_UINT_MAX + 1.0
461+
hash = DBLE(X_UINT_MAX) + 1.0
462462
else if (type .eq. NF90_INT64) then
463463
hash = 1.0
464464
else if (type .eq. NF90_UINT64) then
@@ -1591,19 +1591,19 @@ DOUBLE PRECISION function external_min(type)
15911591
#include "tests.inc"
15921592

15931593
if (type .eq. NF90_BYTE) then
1594-
external_min = X_BYTE_MIN
1594+
external_min = DBLE(X_BYTE_MIN)
15951595
else if (type .eq. NF90_CHAR) then
1596-
external_min = X_CHAR_MIN
1596+
external_min = DBLE(X_CHAR_MIN)
15971597
else if (type .eq. NF90_SHORT) then
1598-
external_min = X_SHORT_MIN
1598+
external_min = DBLE(X_SHORT_MIN)
15991599
else if (type .eq. NF90_INT) then
1600-
external_min = X_INT_MIN
1600+
external_min = DBLE(X_INT_MIN)
16011601
else if (type .eq. NF90_FLOAT) then
1602-
external_min = X_FLOAT_MIN
1602+
external_min = DBLE(X_FLOAT_MIN)
16031603
else if (type .eq. NF90_DOUBLE) then
1604-
external_min = X_DOUBLE_MIN
1604+
external_min = DBLE(X_DOUBLE_MIN)
16051605
else if (type .eq. NF90_INT64) then
1606-
external_min = X_INT8_MIN
1606+
external_min = DBLE(X_INT8_MIN)
16071607
else
16081608
stop 'external_min(): invalid type'
16091609
end if
@@ -1620,19 +1620,19 @@ DOUBLE PRECISION function external_max(type)
16201620
#include "tests.inc"
16211621

16221622
if (type .eq. NF90_BYTE) then
1623-
external_max = X_BYTE_MAX
1623+
external_max = DBLE(X_BYTE_MAX)
16241624
else if (type .eq. NF90_CHAR) then
1625-
external_max = X_CHAR_MAX
1625+
external_max = DBLE(X_CHAR_MAX)
16261626
else if (type .eq. NF90_SHORT) then
1627-
external_max = X_SHORT_MAX
1627+
external_max = DBLE(X_SHORT_MAX)
16281628
else if (type .eq. NF90_INT) then
1629-
external_max = X_INT_MAX
1629+
external_max = DBLE(X_INT_MAX)
16301630
else if (type .eq. NF90_FLOAT) then
1631-
external_max = X_FLOAT_MAX
1631+
external_max = DBLE(X_FLOAT_MAX)
16321632
else if (type .eq. NF90_DOUBLE) then
1633-
external_max = X_DOUBLE_MAX
1633+
external_max = DBLE(X_DOUBLE_MAX)
16341634
else if (type .eq. NF90_INT64) then
1635-
external_max = X_INT8_MAX
1635+
external_max = DBLE(X_INT8_MAX)
16361636
else
16371637
stop 'external_max(): invalid type'
16381638
end if

0 commit comments

Comments
 (0)