Skip to content

Commit

Permalink
230912.094335.HKT fortran: update atest
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Sep 12, 2023
1 parent a18ed05 commit f59b96d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_absoft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: false
matrix:
ikind: [i2]
solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa]
solver: [newuoa, lincoa, bobyqa, uobyqa] # COBYLA cannot pass the test due to internal subroutines used as arguments

steps:

Expand Down
21 changes: 17 additions & 4 deletions fortran/tests/a9src
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,30 @@ if [[ -f "$MEMORY" ]] ; then
fi

# message.f90 does not work due to the changes to string.f90, especially to real2str_vector.
cd "$DIR" && grep -R 'call .*msg' | sed 's|:.*$||' | grep -v 'debug.F90\|fmxapi.F90' | xargs sed -i "s|call .*msg.*$|write(*,*) solver|" && cd - || exit 1
cd "$DIR" && grep -R 'use.*message_mod' | sed 's|:.*$||' | xargs sed -i "/use.*message_mod/d" && cd - || exit 1
(cd "$DIR" && grep -R 'call .*msg' | sed 's|:.*$||' | grep -v 'debug.F90\|fmxapi.F90' | xargs sed -i "s|call .*msg.*$|write(*,*) solver|" && cd - || exit 1) > /dev/null
(cd "$DIR" && grep -R 'use.*message_mod' | sed 's|:.*$||' | xargs sed -i "/use.*message_mod/d" && cd - || exit 1) > /dev/null
printf "module message_mod \n end module message_mod" > "$MESSAGE"

if [[ -f "$DEBUG" ]] ; then
sed -i "s|^\s*error stop.*$|stop|" "$DEBUG"
fi

for SOL in cobyla uobyqa newuoa bobyqa lincoa ; do
sed -i "s|character(len=:), allocatable|character(len=1024)|g" "$DIR/test_$SOL.f90"
sed -i "/safealloc(testdim.*$/d" "$DIR/test_$SOL.f90"
FILE="$DIR/test_$SOL.f90"
if [[ -f $FILE ]] ; then
sed -i "s|character(len=:), allocatable|character(len=1024)|g" "$FILE"
sed -i "/safealloc(testdim.*$/d" "$FILE"
fi
done

if [[ -d "$DIR"/lincoa ]] ; then
for FILE in "$DIR"/lincoa/* ; do
if [[ -f "$FILE" ]] ; then
sed -i "s|count(xl > -REALMAX)|size(xl)|" "$FILE"
sed -i "s|count(xu < REALMAX)|size(xu)|" "$FILE"
fi
done
fi


exit 0

0 comments on commit f59b96d

Please sign in to comment.