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

no more large ftp testing for memcheck workflow, adding interface statements #688

Merged
merged 4 commits into from
May 17, 2024
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
5 changes: 0 additions & 5 deletions .github/workflows/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ on:
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:
developer:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/memcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ jobs:
uses: actions/cache@v4
with:
path: ~/data
key: data-developer-4
key: data-memcheck-1

- name: memcheck
run: |
cd g2
mkdir build
cd build
cmake -DFTP_LARGE_TEST_FILES=ON -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -O0" -DCMAKE_C_FLAGS="-g -O0" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug ..
cmake -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -O0" -DCMAKE_C_FLAGS="-g -O0" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug ..
make -j2 VERBOSE=1

- name: test_memcheck
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "-ggdb -Wall")
set(CMAKE_Fortran_FLAGS "-g -funroll-loops ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_DEBUG "-ggdb -Wall")
set(CMAKE_Fortran_FLAGS_DEBUG "-ggdb -Wall -Wimplicit-interface")
set(fortran_d_flags "-fdefault-real-8")
endif()

Expand Down
86 changes: 86 additions & 0 deletions src/g2bytes.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ subroutine g2_gbytec(in, iout, iskip, nbits)
character*1, intent(in) :: in(*)
integer, intent(inout) :: iout(*)
integer, intent(in) :: iskip, nbits

interface
subroutine g2_gbytesc(in, iout, iskip, nbits, nskip, n)
character*1, intent(in) :: in(*)
integer, intent(out) :: iout(*)
integer, intent(in) :: iskip, nbits, nskip, n
end subroutine g2_gbytesc
end interface

call g2_gbytesc(in, iout, iskip, nbits, 0, 1)
end subroutine g2_gbytec

Expand All @@ -46,6 +55,14 @@ subroutine g2_gbytec1(in, siout, iskip, nbits)
integer, intent(inout) :: siout
integer, intent(in) :: iskip, nbits
integer (kind = 4) :: iout(1)

interface
subroutine g2_gbytesc(in, iout, iskip, nbits, nskip, n)
character*1, intent(in) :: in(*)
integer, intent(out) :: iout(*)
integer, intent(in) :: iskip, nbits, nskip, n
end subroutine g2_gbytesc
end interface

call g2_gbytesc(in, iout, iskip, nbits, 0, 1)
siout = iout(1)
Expand All @@ -71,6 +88,14 @@ subroutine g2_gbytescr(in, rout, iskip, nbits, nskip, n)
integer, intent(in) :: iskip, nbits, nskip, n
integer (kind = 4) :: iout(n)

interface
subroutine g2_gbytesc(in, iout, iskip, nbits, nskip, n)
character*1, intent(in) :: in(*)
integer, intent(out) :: iout(*)
integer, intent(in) :: iskip, nbits, nskip, n
end subroutine g2_gbytesc
end interface

! Unpack into integer array.
call g2_gbytesc(in, iout, iskip, nbits, nskip, n)

Expand Down Expand Up @@ -154,6 +179,15 @@ subroutine g2_gbytec8(in, iout, iskip, nbits)
character*1, intent(in) :: in(*)
integer (kind = 8), intent(inout) :: iout(*)
integer, intent(in) :: iskip, nbits

interface
subroutine g2_gbytesc8(in, iout, iskip, nbits, nskip, n)
character*1, intent(in) :: in(*)
integer (kind = 8), intent(out) :: iout(*)
integer, intent(in) :: iskip, nbits, nskip, n
end subroutine g2_gbytesc8
end interface

call g2_gbytesc8(in, iout, iskip, nbits, 0, 1)
end subroutine g2_gbytec8

Expand All @@ -177,6 +211,14 @@ subroutine g2_gbytec81(in, siout, iskip, nbits)
integer (kind = 8), intent(inout) :: siout
integer, intent(in) :: iskip, nbits
integer (kind = 8) :: iout(1)

interface
subroutine g2_gbytesc8(in, iout, iskip, nbits, nskip, n)
character*1, intent(in) :: in(*)
integer (kind = 8), intent(out) :: iout(*)
integer, intent(in) :: iskip, nbits, nskip, n
end subroutine g2_gbytesc8
end interface

call g2_gbytesc8(in, iout, iskip, nbits, 0, 1)
siout = iout(1)
Expand All @@ -200,6 +242,7 @@ subroutine g2_gbytesc8(in, iout, iskip, nbits, nskip, n)
character*1, intent(in) :: in(*)
integer (kind = 8), intent(out) :: iout(*)
integer, intent(in) :: iskip, nbits, nskip, n

integer :: tbit, bitcnt
integer, parameter :: ones(8) = (/ 1, 3, 7, 15, 31, 63, 127, 255 /)

Expand Down Expand Up @@ -264,6 +307,15 @@ subroutine g2_sbytec(out, in, iskip, nbits)
character*1, intent(inout) :: out(*)
integer, intent(in) :: in(*)
integer, intent(in) :: iskip, nbits

interface
subroutine g2_sbytesc(out, in, iskip, nbits, nskip, n)
character*1, intent(out) :: out(*)
integer, intent(in) :: in(n)
integer, intent(in) :: iskip, nbits, nskip, n
end subroutine g2_sbytesc
end interface

call g2_sbytesc(out, in, iskip, nbits, 0, 1)
end subroutine g2_sbytec

Expand All @@ -287,6 +339,15 @@ subroutine g2_sbytec1(out, in, iskip, nbits)
integer, intent(in) :: in
integer, intent(in) :: iskip, nbits
integer :: ain(1)

interface
subroutine g2_sbytesc(out, in, iskip, nbits, nskip, n)
character*1, intent(out) :: out(*)
integer, intent(in) :: in(n)
integer, intent(in) :: iskip, nbits, nskip, n
end subroutine g2_sbytesc
end interface

ain(1) = in
call g2_sbytesc(out, ain, iskip, nbits, 0, 1)
end subroutine g2_sbytec1
Expand All @@ -309,6 +370,14 @@ subroutine g2_sbytescr(out, rin, iskip, nbits, nskip, n)
integer, intent(in) :: iskip, nbits, nskip, n
integer :: in(n)

interface
subroutine g2_sbytesc(out, in, iskip, nbits, nskip, n)
character*1, intent(out) :: out(*)
integer, intent(in) :: in(n)
integer, intent(in) :: iskip, nbits, nskip, n
end subroutine g2_sbytesc
end interface

! Transfer real array to integer array.
in(1:n) = transfer(rin, in(1:n), n)

Expand Down Expand Up @@ -405,6 +474,15 @@ subroutine g2_sbytec8(out, in, iskip, nbits)
character*1, intent(inout) :: out(*)
integer (kind = 8), intent(in) :: in(*)
integer, intent(in) :: iskip, nbits

interface
subroutine g2_sbytesc8(out, in, iskip, nbits, nskip, n)
character*1, intent(out) :: out(*)
integer (kind = 8), intent(in) :: in(n)
integer, intent(in) :: iskip, nbits, nskip, n
end subroutine g2_sbytesc8
end interface

call g2_sbytesc8(out, in, iskip, nbits, 0, 1)
end subroutine g2_sbytec8

Expand Down Expand Up @@ -497,6 +575,14 @@ subroutine rdieeec(cieee, a, num)
integer, intent(in) :: num
real (kind = 4) :: rieee(num)

interface
subroutine rdieee(rieee, a, num)
real(4), intent(in) :: rieee(num)
real, intent(out) :: a(num)
integer, intent(in) :: num
end subroutine rdieee
end interface

rieee(1:num) = transfer(cieee(1:num * 4), rieee, num)
call rdieee(rieee, a, num)
end subroutine rdieeec
Expand Down
18 changes: 13 additions & 5 deletions src/g2get.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,14 @@ subroutine gettemplates(cgrib, lcgrib, ifldnum, igds, igdstmpl, &
logical have3, have4
integer :: igdslen, ipdslen, ipos, isecnum, j, jerr, lengrib, lensec, lensec0, numfld

interface
subroutine g2_gbytec1(in, siout, iskip, nbits)
character*1, intent(in) :: in(*)
integer, intent(inout) :: siout
integer, intent(in) :: iskip, nbits
end subroutine g2_gbytec1
end interface

have3 = .false.
have4 = .false.
ierr = 0
Expand Down Expand Up @@ -1543,12 +1551,12 @@ subroutine gettemplates(cgrib, lcgrib, ifldnum, igds, igdstmpl, &

! Unpack Section 0 - Indicator Section.
iofst = 8 * (istart + 5)
call g2_gbytec(cgrib, listsec0(1), iofst, 8) ! Discipline
call g2_gbytec1(cgrib, listsec0(1), iofst, 8) ! Discipline
iofst = iofst + 8
call g2_gbytec(cgrib, listsec0(2), iofst, 8) ! GRIB edition number
call g2_gbytec1(cgrib, listsec0(2), iofst, 8) ! GRIB edition number
iofst = iofst + 8
iofst = iofst + 32
call g2_gbytec(cgrib, lengrib, iofst, 32) ! Length of GRIB message
call g2_gbytec1(cgrib, lengrib, iofst, 32) ! Length of GRIB message
iofst = iofst + 32
lensec0 = 16
ipos = istart + lensec0
Expand Down Expand Up @@ -1578,9 +1586,9 @@ subroutine gettemplates(cgrib, lcgrib, ifldnum, igds, igdstmpl, &
endif
! Get length of Section and Section number.
iofst = (ipos - 1) * 8
call g2_gbytec(cgrib, lensec, iofst, 32) ! Get Length of Section
call g2_gbytec1(cgrib, lensec, iofst, 32) ! Get Length of Section
iofst = iofst + 32
call g2_gbytec(cgrib, isecnum, iofst, 8) ! Get Section number
call g2_gbytec1(cgrib, isecnum, iofst, 8) ! Get Section number
iofst = iofst + 8
!print *, ' lensec = ', lensec, ' secnum = ', isecnum

Expand Down
22 changes: 17 additions & 5 deletions src/g2getgb2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,17 @@ subroutine getgb2l2(lugb, idxver, cindex, gfld, iret)
integer :: mypos

interface
subroutine g2_gbytec1(in, siout, iskip, nbits)
character*1, intent(in) :: in(*)
integer, intent(inout) :: siout
integer, intent(in) :: iskip, nbits
end subroutine g2_gbytec1
subroutine g2_gbytec81(in, siout, iskip, nbits)
character*1, intent(in) :: in(*)
integer (kind = 8), intent(inout) :: siout
integer, intent(in) :: iskip, nbits
integer (kind = 8) :: iout(1)
end subroutine g2_gbytec81
subroutine gf_unpack2(cgrib, lcgrib, iofst, lencsec2, csec2, ierr)
character(len = 1), intent(in) :: cgrib(lcgrib)
integer, intent(in) :: lcgrib
Expand All @@ -384,6 +395,7 @@ subroutine gf_unpack2(cgrib, lcgrib, iofst, lencsec2, csec2, ierr)
end subroutine gf_unpack2
end interface


#ifdef LOGGING
write(g2_log_msg, '(a, i2, a, i1)') 'getgb2l2: lugb ', lugb, ' idxver ', idxver
call g2_log(1)
Expand All @@ -398,18 +410,18 @@ end subroutine gf_unpack2
! index version 2.
if (idxver .eq. 1) then
! Read bytes to skip in file before message.
call g2_gbytec(cindex, lskip, mypos, INT4_BITS)
call g2_gbytec1(cindex, lskip, mypos, INT4_BITS)
mypos = mypos + INT4_BITS
lskip8 = lskip
! Read bytes to skip in msg before local use.
call g2_gbytec(cindex, skip2, mypos, INT4_BITS)
call g2_gbytec1(cindex, skip2, mypos, INT4_BITS)
skip28 = skip2
else
! Read bytes to skip in file before message.
call g2_gbytec8(cindex, lskip8, mypos, INT8_BITS)
call g2_gbytec81(cindex, lskip8, mypos, INT8_BITS)
mypos = mypos + INT8_BITS
! Read bytes to skip in msg before local use.
call g2_gbytec8(cindex, skip28, mypos, INT8_BITS)
call g2_gbytec81(cindex, skip28, mypos, INT8_BITS)
mypos = mypos + INT8_BITS
endif

Expand All @@ -419,7 +431,7 @@ end subroutine gf_unpack2

! Get length of section.
call bareadl(lugb, iskip8, 4_8, lread8, csize)
call g2_gbytec(csize, ilen, 0, 32)
call g2_gbytec1(csize, ilen, 0, 32)
allocate(ctemp(ilen))
ilen8 = ilen

Expand Down
Loading
Loading