Skip to content
Snippets Groups Projects
Commit 0a8ef8e6 authored by RIETTE Sébastien's avatar RIETTE Sébastien
Browse files

S. Riette 28 nov 2022: testprogs output enhancement

parent 101a6452
No related branches found
No related tags found
No related merge requests found
...@@ -31,20 +31,20 @@ IF (LLCHECK) THEN ...@@ -31,20 +31,20 @@ IF (LLCHECK) THEN
IF (SUM (ABS (POUT) + ABS (PREF)) > 0) THEN IF (SUM (ABS (POUT) + ABS (PREF)) > 0) THEN
WRITE (*, '(A4)', ADVANCE='NO') "" WRITE (*, '(A4)', ADVANCE='NO') ""
DO JLON = 1, NPROMA DO JLON = 1, NPROMA
WRITE (*, '("|",I12,A12)', ADVANCE='NO') JLON, "" WRITE (*, '("|",I12,"..",A12)', ADVANCE='NO') JLON, ""
ENDDO ENDDO
WRITE (*, '("|")') WRITE (*, '("|")')
DO JLEV = 1, KLEV DO JLEV = 1, KLEV
WRITE (*, '(I4)', ADVANCE='NO') JLEV WRITE (*, '(I4)', ADVANCE='NO') JLEV
DO JLON = 1, NPROMA DO JLON = 1, NPROMA
IF (ABS (PREF (JLON, 1, JLEV)) + ABS (POUT (JLON, 1, JLEV)) == 0.) THEN IF (ABS (PREF (JLON, 1, JLEV)) + ABS (POUT (JLON, 1, JLEV)) == 0.) THEN
WRITE (*, '("|",2A12)', ADVANCE='NO') "", "" WRITE (*, '("|",A12,"..",A12)', ADVANCE='NO') "", ""
ELSE ELSE
!IF(ABS(POUT (JLON, 1, JLEV)-PREF (JLON, 1, JLEV))>0.001 * ABS(PREF (JLON, 1, JLEV))) THEN IF(ABS(POUT (JLON, 1, JLEV)-PREF (JLON, 1, JLEV))>0.001 * ABS(PREF (JLON, 1, JLEV))) THEN
! WRITE (*, '("|",E12.5,"!=",E12.5)', ADVANCE='NO') PREF (JLON, 1, JLEV), POUT (JLON, 1, JLEV) WRITE (*, '("|",E12.5,"!=",E12.5)', ADVANCE='NO') PREF (JLON, 1, JLEV), POUT (JLON, 1, JLEV)
!ELSE ELSE
WRITE (*, '("|",2E12.5)', ADVANCE='NO') PREF (JLON, 1, JLEV), POUT (JLON, 1, JLEV) WRITE (*, '("|",E12.5,"~=",E12.5)', ADVANCE='NO') PREF (JLON, 1, JLEV), POUT (JLON, 1, JLEV)
!ENDIF ENDIF
ENDIF ENDIF
ENDDO ENDDO
WRITE (*, '("|")') WRITE (*, '("|")')
......
...@@ -9,7 +9,12 @@ set -e ...@@ -9,7 +9,12 @@ set -e
#ice_adjust: the ice adjust test case #ice_adjust: the ice adjust test case
#ref is commit 855b8f8 for ice_adjust, rain_ice, turb and shallow_mf #ref is commit 855b8f8 for ice_adjust, rain_ice
#ref is commit 4171c53 for turb
#Commit 4171c53 can be used for turb (ref commit for this testprogs), and for
#rain_ice and ice_adjust (as it gives the same results as commit 855b8f8
#for these test cases).
specialName="ref" specialName="ref"
availTests="ice_adjust,rain_ice,turb" availTests="ice_adjust,rain_ice,turb"
...@@ -258,9 +263,13 @@ if [ $check -eq 1 ]; then ...@@ -258,9 +263,13 @@ if [ $check -eq 1 ]; then
fi fi
if [ $te -eq 0 ]; then if [ $te -eq 0 ]; then
set +e set +e
mess=$(cmp $file1 $file2 246 246 2>&1) mess=$(cmp <(cat $file1 | sed 's/\.\.//g' | sed 's/~=//g' | sed 's/!=//g') \
<(cat $file2 | sed 's/\.\.//g' | sed 's/~=//g' | sed 's/!=//g') 246 246 2>&1)
te=$? te=$?
set -e set -e
#The use of "<()" bash syntax replaces the actual file name seen by cmp
#We modify the cmp output to display the actual file names
mess=$(echo $mess | sed "s#^.*differ# $file1 $file2 differ#")
fi fi
[ $te -ne 0 ] && message="$message $mess \n" [ $te -ne 0 ] && message="$message $mess \n"
alltests=$(($alltests+$te)) alltests=$(($alltests+$te))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment