From 89541f7b62e60c1a5ddbec2d2116ced4a66ddfdf Mon Sep 17 00:00:00 2001 From: Chris Bunney Date: Wed, 25 May 2022 15:43:50 +0000 Subject: [PATCH 1/3] Added alternaive endian support to gmake build --- model/bin/ad3.tmpl | 2 ++ model/bin/cmplr.env | 15 ++++++++++++--- model/bin/w3_setup | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/model/bin/ad3.tmpl b/model/bin/ad3.tmpl index e3cb7f616d..a70bd2e545 100755 --- a/model/bin/ad3.tmpl +++ b/model/bin/ad3.tmpl @@ -210,6 +210,8 @@ CPPFLAGS+=("-DW3_$sw") done + CPPFLAGS+=("-DENDIANNESS=''") + CPPFLAGS+=("-D__WW3_SWITCHES__='$sw_str'") "${CPPFLAGS[@]}" $path_i/$name.F90 $name.F90 diff --git a/model/bin/cmplr.env b/model/bin/cmplr.env index dee68b1cb6..75674b0945 100644 --- a/model/bin/cmplr.env +++ b/model/bin/cmplr.env @@ -36,6 +36,9 @@ err_pattern='[[:space:]]error[[:space:]]' warn_pattern='warn' +# Binary I/O defaults to native endian: +endian='native' + # disable listing done by the compiler list='no' @@ -63,9 +66,11 @@ if [ "$cmplr" == "mpt" ] || [ "$cmplr" == "mpt_debug" ] || [ "$cmplr" == "mpt_pr # OPTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # common options - optc='-c -module $path_m -no-fma -ip -g -i4 -real-size 32 -fp-model precise -assume byterecl -convert big_endian -fno-alias -fno-fnalias' + optc='-c -module $path_m -no-fma -ip -g -i4 -real-size 32 -fp-model precise -assume byterecl -fno-alias -fno-fnalias' optl='-o $prog -g' + endian='big_endian' + # list options if [ "$list" == 'yes' ] ; then optc="$optc -list"; fi @@ -145,9 +150,11 @@ if [ "$cmplr" == "intel" ] || [ "$cmplr" == "intel_debug" ] || [ "$c # OPTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # common options - optc='-c -module $path_m -no-fma -ip -g -traceback -i4 -real-size 32 -fp-model precise -assume byterecl -convert big_endian -fno-alias -fno-fnalias -sox' + optc='-c -module $path_m -no-fma -ip -g -traceback -i4 -real-size 32 -fp-model precise -assume byterecl -fno-alias -fno-fnalias -sox' optl='-o $prog -g' + endian='big_endian' + # list options if [ "$list" == 'yes' ] ; then optc="$optc -list"; fi @@ -252,9 +259,11 @@ if [ "$cmplr" == "gnu" ] || [ "$cmplr" == "gnu_debug" ] || [ "$cmplr" == "gnu_pr # OPTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # common options - optc='-c -J$path_m -g -fno-second-underscore -ffree-line-length-none -fconvert=big-endian' + optc='-c -J$path_m -g -fno-second-underscore -ffree-line-length-none' optl='-o $prog -g' + endian='big_endian' + # omp options optomp='-fopenmp' diff --git a/model/bin/w3_setup b/model/bin/w3_setup index 8334d3bbd3..790c9c23ad 100755 --- a/model/bin/w3_setup +++ b/model/bin/w3_setup @@ -394,7 +394,7 @@ then [ "$cmplr" == "ukmo_cray_gnu" ] || [ "$cmplr" == "ukmo_cray_gnu_debug" ] || \ [ "$cmplr" == "ukmo_cray_intel" ] || [ "$cmplr" == "ukmo_cray_intel_debug" ]; then source $path_b/cmplr.env - sed -e "s//$comp_seq/" -e "s//$cppad3procflag/" -e "s//$cppad3flag2/" -e "s//$cppad3flag3/" -e "s//$cppad3flag4/" $path_b/ad3.tmpl > $path_b/ad3 + sed -e "s//$comp_seq/" -e "s//$cppad3procflag/" -e "s//$cppad3flag2/" -e "s//$cppad3flag3/" -e "s//$cppad3flag4/" -e "s//${endian}/" $path_b/ad3.tmpl > $path_b/ad3 echo " sed $path_b/ad3.tmpl => $path_b/ad3" else errmsg "$path_b/ad3.$cmplr not found" From f8145580e87b7c69d6287c1ca6bc438c367b4530 Mon Sep 17 00:00:00 2001 From: "ukmo-chris.bunney" Date: Wed, 25 May 2022 16:51:02 +0100 Subject: [PATCH 2/3] Fix bad indent and add comment --- model/bin/ad3.tmpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/model/bin/ad3.tmpl b/model/bin/ad3.tmpl index a70bd2e545..713f5359f0 100755 --- a/model/bin/ad3.tmpl +++ b/model/bin/ad3.tmpl @@ -210,10 +210,11 @@ CPPFLAGS+=("-DW3_$sw") done - CPPFLAGS+=("-DENDIANNESS=''") - CPPFLAGS+=("-D__WW3_SWITCHES__='$sw_str'") + # Also set endianness: + CPPFLAGS+=("-DENDIANNESS=''") + "${CPPFLAGS[@]}" $path_i/$name.F90 $name.F90 mv $name.i $name.F90 From dddcb718e79abda0b7523fc52254380d5ef212f5 Mon Sep 17 00:00:00 2001 From: Chris Bunney Date: Thu, 26 May 2022 14:21:19 +0000 Subject: [PATCH 3/3] Fix multi input check in run_test (as per run_cmake_test) --- regtests/bin/run_test | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/regtests/bin/run_test b/regtests/bin/run_test index e9813bcc61..9b93bf9113 100755 --- a/regtests/bin/run_test +++ b/regtests/bin/run_test @@ -1259,7 +1259,14 @@ then else inputs="`ls $path_i/$prog*.inp 2>/dev/null`" fi - inputs_tmp=`( ls ${path_i}/${prog}${gu}* )` + + if [ $nml_input ] && [ ! -z "`ls ${path_i}/${prog}*.nml 2>/dev/null`" ] + then + inputs_tmp=`( ls ${path_i}/${prog}${gu}*nml)` + else + inputs_tmp=`( ls ${path_i}/${prog}${gu}*inp)` + fi + if [ ! -z "$inputs_tmp" ];then inputs=$inputs_tmp fi