Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_read_input_nml2 failure and test_diag_update_buffer.F90 seg fault : Cray #1302

Merged
merged 4 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion test_fms/diag_manager/test_diag_manager2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ test_expect_success "Unstructured grid (test $my_test_count)" '
mpirun -n 1 ../test_diag_manager
'

my_test_count=24
# test_diag_manager_time
cat <<_EOF > diag_table
test_diag_manager
Expand All @@ -478,6 +479,7 @@ test_diag_manager
"test_diag_manager_mod", "sst", "sst", "ocn_end%4yr%2mo%2dy%2hr", "all", .true., "none", 2
_EOF

my_test_count=25
rm -f input.nml && touch input.nml
test_expect_success "wildcard filenames (test $my_test_count)" '
mpirun -n 1 ../test_diag_manager_time
Expand All @@ -501,7 +503,7 @@ test_expect_success "diurnal test (test $my_test_count)" '
mpirun -n 1 ../test_diag_manager_time
'
setup_test
my_test_count=`expr $my_test_count + 1`
my_test_count=26
test_expect_success "Test the diag update_buffer (test $my_test_count)" '
mpirun -n 1 ../test_diag_update_buffer
'
Expand Down
8 changes: 4 additions & 4 deletions test_fms/diag_manager/test_diag_update_buffer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ SUBROUTINE init_field_values (field)
DO k = 1, NZ
DO j = 1, NY
DO i = 1, NX
itemp = get_array_index_from_4D(i,j,k,l,NX,NY,NZ)
SELECT TYPE ( field)
TYPE IS (real(kind=r4_kind))
itemp = get_array_index_from_4D(i,j,k,l,NX,NY,NZ)
field(i,j,k,l) = get_array_index_from_4D(i,j,k,l,NX,NY,NZ)
1 TYPE IS (integer(kind=i8_kind))
field(i,j,k,l) = get_array_index_from_4D(i,j,k,l,NX,NY,NZ)
field(i,j,k,l) = real(itemp, kind=r4_kind)
TYPE IS (integer(kind=i8_kind))
field(i,j,k,l) = int(itemp, kind=i8_kind)
END SELECT
END DO
END DO
Expand Down
2 changes: 1 addition & 1 deletion test_fms/mpp/test_read_input_nml.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ program test_read_input_nml
n = 1
do
read(1, '(A)', iostat=stat) line
if (stat.eq.-1) then
if (is_iostat_end(stat)) then
exit
end if
if (input_nml_file(n).ne.line) then
Expand Down
4 changes: 2 additions & 2 deletions test_fms/mpp/test_read_input_nml2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
# create and enter directory for in/output
output_dir

touch input.nml
touch test_numb_base.nml
echo "&test_read_input_nml_nml" > test_numb_base.nml
echo "test_numb = 0" >> test_numb_base.nml
echo "/" >> test_numb_base.nml
cp test_numb_base.nml input.nml

# Test 1
sed "s/test_numb = [0-9]/test_numb = 1/" test_numb_base.nml > test_numb.nml
Expand All @@ -45,7 +45,7 @@ test_expect_success "read input nml" '

# Test 2
sed "s/test_numb = [0-9]/test_numb = 2/" test_numb_base.nml > test_numb.nml
sed "s/1/2/" $top_srcdir/test_fms/mpp/input_base.nml > input_alternative.nml
cp input.nml input_alternative.nml
test_expect_success "read input nml with file name" '
mpirun -n 1 ../test_read_input_nml
'
Expand Down
Loading