From d885552814c13f498554db3031894445546063e2 Mon Sep 17 00:00:00 2001 From: Ryan Mulhall <35538242+rem1776@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:57:35 -0500 Subject: [PATCH] ci: add debug flags to GNU workflow and fix remaining failures (#1579) --- .github/workflows/github_autotools_gnu.yml | 5 +++-- test_fms/data_override/test_data_override2_mono.sh | 2 ++ time_interp/time_interp_external2.F90 | 11 ++--------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/github_autotools_gnu.yml b/.github/workflows/github_autotools_gnu.yml index 7be75bbe6..c290944e4 100644 --- a/.github/workflows/github_autotools_gnu.yml +++ b/.github/workflows/github_autotools_gnu.yml @@ -25,6 +25,7 @@ jobs: TEST_VERBOSE: 1 DISTCHECK_CONFIGURE_FLAGS: "${{ matrix.conf-flag }} ${{ matrix.input-flag }} ${{ matrix.io-flag }}" SKIP_TESTS: "test_horiz_interp2.[23-24]" # TODO (couldn't reproduce outside CI) + DEBUG_FLAGS: "-O0 -g -fbounds-check -ffpe-trap=invalid,zero,overflow" # debug compiler flags taken from the mkmf template steps: - name: Checkout code uses: actions/checkout@v4 @@ -32,10 +33,10 @@ jobs: run: autoreconf -if - name: Configure the build if: ${{ matrix.conf-flag != '--disable-setting-flags' }} - run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} || cat config.log + run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} FCFLAGS="$FCFLAGS $DEBUG_FLAGS" - name: Configure the build with compiler flags if: ${{ matrix.conf-flag == '--disable-setting-flags' }} - run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} FCFLAGS="-fdefault-real-8 -fdefault-double-8 -fcray-pointer -ffree-line-length-none -I/usr/include $FCFLAGS" || cat config.log + run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} FCFLAGS="-fdefault-real-8 -fdefault-double-8 -fcray-pointer -ffree-line-length-none -I/usr/include $FCFLAGS $DEBUG_FLAGS" || cat config.log - name: Build the library run: make distcheck if: ${{ matrix.conf-flag != '--with-mpi=no' }} diff --git a/test_fms/data_override/test_data_override2_mono.sh b/test_fms/data_override/test_data_override2_mono.sh index 05c833389..5e5addcf3 100755 --- a/test_fms/data_override/test_data_override2_mono.sh +++ b/test_fms/data_override/test_data_override2_mono.sh @@ -51,6 +51,8 @@ do test_expect_success "test_data_override with monotonically increasing and decreasing data sets (${KIND})" ' mpirun -n 6 ../test_data_override_ongrid_${KIND} ' + rm -f INPUT/* + sync done rm -rf data_table diff --git a/time_interp/time_interp_external2.F90 b/time_interp/time_interp_external2.F90 index 0e5386ab3..5f7bc25bb 100644 --- a/time_interp/time_interp_external2.F90 +++ b/time_interp/time_interp_external2.F90 @@ -768,7 +768,6 @@ subroutine load_record(field, rec, interp, is_in, ie_in, js_in, je_in, window_id real(r8_kind), allocatable :: mask_out(:,:,:) real(r4_kind), allocatable :: hi_tmp_data(:,:,:,:) !< used to hold a copy of field%domain_data if using r4_kind real(r4_kind), allocatable :: hi_tmp_msk_out(:,:,:) !< used return the field mask if using r4_kind - real(r4_kind), allocatable :: hi_tmp_src_data(:,:,:,:) !< used return the field mask if using r4_kind window_id = 1 if( PRESENT(window_id_in) ) window_id = window_id_in @@ -848,15 +847,10 @@ subroutine load_record(field, rec, interp, is_in, ie_in, js_in, je_in, window_id LBOUND(field%domain_data,2):UBOUND(field%domain_data,2), & LBOUND(field%domain_data,3):UBOUND(field%domain_data,3), & LBOUND(field%domain_data,4):UBOUND(field%domain_data,4))) - allocate(hi_tmp_src_data(LBOUND(field%src_data,1):UBOUND(field%src_data,1), & - LBOUND(field%src_data,2):UBOUND(field%src_data,2), & - LBOUND(field%src_data,3):UBOUND(field%src_data,3), & - LBOUND(field%src_data,4):UBOUND(field%src_data,4))) - ! assign if needed + ! copy over to r4 hi_tmp_data = real(field%domain_data, r4_kind) - hi_tmp_src_data = real(field%src_data, r4_kind) ! do interpolation - call horiz_interp(interp, hi_tmp_src_data(:,:,:,ib), hi_tmp_data(isw:iew,jsw:jew,:,ib), & + call horiz_interp(interp, real(field%src_data(:,:,:,ib),r4_kind), hi_tmp_data(isw:iew,jsw:jew,:,ib), & mask_in=real(mask_in,r4_kind), mask_out=hi_tmp_msk_out) ! assign any output field%domain_data = real(hi_tmp_data, r8_kind) @@ -864,7 +858,6 @@ subroutine load_record(field, rec, interp, is_in, ie_in, js_in, je_in, window_id if(allocated(hi_tmp_data)) deallocate(hi_tmp_data) if(allocated(hi_tmp_msk_out)) deallocate(hi_tmp_msk_out) - if(allocated(hi_tmp_src_data)) deallocate(hi_tmp_src_data) else allocate(mask_out(isw:iew,jsw:jew, size(field%src_data,3))) call horiz_interp(interp, field%src_data(:,:,:,ib),field%domain_data(isw:iew,jsw:jew,:,ib), &