Skip to content

Commit

Permalink
Merge branch 'develop' into as_bitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
AlysonStahl-NOAA authored Nov 13, 2024
2 parents 77d3b41 + 593ac59 commit 43eb3db
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 13 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/Linux_clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# This is a GitHub actions workflow for NCEPLIBS-g2.
#
# This builds with clang.
#
# Ed Hartnett, 8/21/24
name: Linux_clang
on:
push:
branches:
- develop
pull_request:
branches:
- develop

# Cancel in-progress workflows when pushing to a branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Linux_clang:
runs-on: ubuntu-latest
env:
FC: gfortran
CC: clang
LD_LIBRARY_PATH: /home/runner/work/NCEPLIBS-g2/NCEPLIBS-g2/nceplibs/jasper/lib/
strategy:
# fail-fast: true
matrix:
bacio-version: [2.6.0]
w3emc-version: [2.11.0]
config:
- {
options: "-DCMAKE_BUILD_TYPE=Debug"
}
- {
options: '-DCMAKE_C_Fortran_FLAGS="-g" -DLOGGING=ON'
}
- {
options: "-DBUILD_WITH_W3EMC=OFF"
}
- {
options: "-DBUILD_UTILS=ON -DBUILD_WITH_W3EMC=OFF"
}

steps:

- name: install-dependencies
run: |
sudo apt-get update
sudo apt-get install libpng-dev zlib1g-dev libjpeg-dev clang
- name: "Build dependencies"
uses: NOAA-EMC/ci-build-nceplibs@develop
with:
bacio-version: v${{ matrix.bacio-version }}
g2c-version: develop
jasper-version: version-4.0.0
w3emc-version: v${{ matrix.w3emc-version }}
w3emc-cmake-args: -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=ON
ip-version: develop

- name: checkout
uses: actions/checkout@v4
with:
path: g2

- name: cache-data
id: cache-data
uses: actions/cache@v4
with:
path: ~/data
key: data-5

- name: build
run: |
set -x
cd g2
mkdir build
cd build
clang --version
gfortran --version
cmake ${{ matrix.config.options }} -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data ..
make -j2 VERBOSE=1
- name: cache-data
if: steps.cache-data.outputs.cache-hit != 'true'
run: |
mkdir ~/data
cp $GITHUB_WORKSPACE/g2/build/tests/data/* ~/data
- name: test
run: |
cd $GITHUB_WORKSPACE/g2/build
ctest --verbose --rerun-failed --output-on-failure
14 changes: 7 additions & 7 deletions .github/workflows/Linux_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ jobs:
strategy:
fail-fast: true
matrix:
jasper-version: [2.0.33, 3.0.5, 4.0.0]
bacio-version: [2.4.1, 2.5.0, 2.6.0]
w3emc-version: [2.9.2, 2.9.3, 2.10.0]
jasper-version: [2.0.33, 4.0.0]
bacio-version: [2.4.1, 2.6.0]
w3emc-version: [2.9.2, 2.10.0]
g2c-version: [develop, v2.0.0]
build-utils: [ON, OFF]
exclude:
# utils require w3emc version >= 2.10.0
- w3emc-version: 2.9.2
build-utils: ON
- w3emc-version: 2.9.3
build-utils: ON
gcc-version: [12]
include:
- gcc-version: 14
jasper-version: 4.0.0
bacio-version: 2.6.0
w3emc-version: 2.10.0
g2c-version: develop

steps:

Expand All @@ -59,9 +59,9 @@ jobs:
uses: NOAA-EMC/ci-build-nceplibs@develop
with:
bacio-version: v${{ matrix.bacio-version }}
g2c-version: develop
g2c-cmake-args: -DENABLE_SHARED=ON
jasper-version: version-${{ matrix.jasper-version }}
g2c-version: ${{ matrix.g2c-version }}
g2c-cmake-args: -DENABLE_SHARED=ON
w3emc-version: v${{ matrix.w3emc-version }}
w3emc-cmake-args: -DBUILD_WITH_BUFR=OFF
ip-version: develop
Expand Down
27 changes: 23 additions & 4 deletions .github/workflows/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,22 @@ on:
branches:
- develop

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
developer:
runs-on: ubuntu-latest
env:
FC: gfortran
CC: gcc
LD_LIBRARY_PATH: /home/runner/work/NCEPLIBS-g2/NCEPLIBS-g2/nceplibs/jasper/lib/

strategy:
fail-fast: true
matrix:
config: ["asan/warning check", "docs/code coverage"]

steps:

Expand Down Expand Up @@ -51,18 +61,26 @@ jobs:
key: data-developer-5

- name: asan
if: matrix.config == 'asan/warning check'
run: |
set -x
cd g2
mkdir build
doxygen --version
cd build
cmake -DBUILD_UTILS=OFF -DG2C_COMPARE=ON -DUSE_AEC=ON -DFTP_LARGE_TEST_FILES=ON -DENABLE_DOCS=ON -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug ..
cmake -DBUILD_UTILS=OFF -DUSE_AEC=ON -DFTP_LARGE_TEST_FILES=ON -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug ..
make -j2 VERBOSE=1
ctest --verbose --output-on-failure --rerun-failed
- name: test_asan
- name: build
if: matrix.config == 'docs/code coverage'
run: |
cd $GITHUB_WORKSPACE/g2/build
set -x
cd g2
mkdir build
doxygen --version
cd build
cmake -DBUILD_UTILS=ON -DG2C_COMPARE=OFF -DUSE_AEC=ON -DFTP_LARGE_TEST_FILES=ON -DENABLE_DOCS=ON -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data ..
make -j2 VERBOSE=1
ctest --verbose --output-on-failure --rerun-failed
gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null
Expand All @@ -73,6 +91,7 @@ jobs:
cp $GITHUB_WORKSPACE/g2/build/tests/data/* ~/data
- name: upload-test-coverage
if: matrix.config == 'docs/code coverage'
uses: actions/upload-artifact@v4
with:
name: g2-test-coverage
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.1
4.0.0
1 change: 1 addition & 0 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ http://www.nws.noaa.gov/tdl/iwt/grib2/frameset_grib2.htm.

## Documentation for Previous Versions of NCEPLIBS-g2

* [NCEPLIBS-g2 Version 3.5.1](ver-3.5.1/index.html)
* [NCEPLIBS-g2 Version 3.5.0](ver-3.5.0/index.html)
* [NCEPLIBS-g2 Version 3.4.9](ver-3.4.9/index.html)
* [NCEPLIBS-g2 Version 3.4.8](ver-3.4.8/index.html)
Expand Down
4 changes: 4 additions & 0 deletions src/g2index.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ end subroutine getg2i2r
nlen, nnum, nmess, irgi)
if (irgi .gt. 1 .or. nnum .eq. 0 .or. nlen .eq. 0) then
iret = 92
if (associated(cbuf)) then
deallocate(cbuf)
nullify(cbuf)
endif
return
endif
numtot = numtot + nnum
Expand Down
2 changes: 1 addition & 1 deletion test_utils/run_degrib2_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo ""
echo "*** Running degrib2 tests"

# Confirm that degrib2 fails without any arguments.
degrib2 && exit 1
../utils/degrib2 && exit 1

# Degrib2 a GRIB2 file.
../utils/degrib2 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 &> test_gdaswave.degrib2.txt
Expand Down
3 changes: 3 additions & 0 deletions test_utils/run_tocgrib2super_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ unset FORT11
unset FORT51
../utils/tocgrib2super && exit 1

# According to George V.: "if fortran unit 11 is, 40999888 bytes long,
# then fortran unit 12 should be a single 8 character text string
# containing this integer value."
echo "*** Running tocgrib2super with input/output defined, but one missing field. It will fail."
export FORT11="../tests/data/rrfs.t12z.prslevfaa.f010.na3km.grib2"
export FORT51=out.grib2
Expand Down

0 comments on commit 43eb3db

Please sign in to comment.