Skip to content

Commit

Permalink
Merge branch 'develop' into ci_updates_may24
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderRichert-NOAA authored Jun 4, 2024
2 parents 3978086 + 74c934f commit d5de852
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 856 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Linux_options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
CC: gcc-11
strategy:
matrix:
options: ['-DBUILD_D=OFF -DBUILD_WITH_BUFR=ON -DBUILD_WITH_EXTRA_DEPS=ON', '-DBUILD_4=OFF -DBUILD_WITH_BUFR=ON -DBUILD_WITH_EXTRA_DEPS=ON', '-DBUILD_SHARED_LIBS=ON']
options: ['-DBUILD_D=OFF -DBUILD_WITH_BUFR=ON', '-DBUILD_4=OFF -DBUILD_WITH_BUFR=ON', '-DBUILD_SHARED_LIBS=ON']

steps:

Expand Down
8 changes: 0 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,8 @@ option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(BUILD_4 "Build the 4-byte real version of the library, libw3emc_4.a" ON)
option(BUILD_D "Build the 8-byte real version of the library, libw3emc_d.a" ON)
option(BUILD_8 "Build the 8-byte integer version of the library, libsp_8.a" OFF)
option(BUILD_WITH_EXTRA_DEPS "Build w3emc with subprograms which call unknown dependencies" OFF)
option(BUILD_WITH_BUFR "Build w3emc with subprograms which call NCEPLIBS-bufr" OFF)

# If building shared, extra dependencies must be eliminated.
if(BUILD_SHARED_LIBS)
if(BUILD_WITH_EXTRA_DEPS)
message(FATAL_ERROR "Shared libraries cannot be built without setting -DBUILD_WITH_EXTRA_DEPS=OFF.")
endif()
endif()

# Figure whether user wants _4, _d, _8 kinds of library.
if(BUILD_4)
set(kinds "4")
Expand Down
2 changes: 1 addition & 1 deletion spack/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class W3emc(CMakePackage):
"extradeps",
default=False,
description="Build w3emc with subprograms which call unknown dependencies",
when="@2.10:",
when="@2.10:2.11",
)

conflicts("+shared +extradeps", msg="Shared library cannot be built with unknown dependencies")
Expand Down
62 changes: 26 additions & 36 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,38 @@
# Kyle Gerheiser, Ed Hartnett

# This is the Fortran source code.
set(fortran_src getgbens.f isrchne.f iw3mat.f
mersenne_twister.f mova2i.f orders.f putgbens.f w3ai40.f w3ai41.f
w3ctzdat.f w3fa01.f w3fa03.f w3fa03v.f w3fa04.f w3fa06.f w3fa09.f
w3fa11.f w3fa12.f w3fa13.f w3fb00.f w3fb01.f w3fb02.f w3fb03.f
w3fb04.f w3fb05.f w3fb06.f w3fb07.f w3fb08.f w3fb09.f w3fb10.f
w3fb11.f w3fb12.f w3fc02.f w3fc05.f w3fc06.f w3fc07.f w3fc08.f
w3fi02.f w3fi03.f w3fi18.f w3fi19.f w3fi20.f w3fi32.f w3fi47.f
w3fi48.f w3fi61.f w3fi65.f w3fi66.f w3fi67.f w3fi70.f
w3fi78.f w3fi85.f w3fm07.f w3fm08.f w3fp04.f w3fp05.f w3fp06.f
w3fp10.f w3ft00.f w3ft01.f w3ft02.f w3ft03.f w3ft05.f
w3ft05v.f w3ft06.f w3ft06v.f w3ft07.f w3ft08.f w3ft09.f w3ft10.f
w3ft11.f w3ft12.f w3ft16.f w3ft17.f w3ft201.f w3ft202.f w3ft203.f
w3ft204.f w3ft205.f w3ft206.f w3ft207.f w3ft208.f w3ft209.f w3ft210.f
w3ft211.f w3ft212.f w3ft213.f w3ft214.f w3ft21.f w3ft26.f w3ft33.f
w3ft38.f w3ft39.f w3ft40.f w3ft41.f w3ft43v.f w3log.f
xdopen.f aea.f errexit.f errmsg.f fparsei.f fparser.f gbytec.f gbyte.f
gbytesc.f gbytes.f getbit.f getgb1.f getgb1re.f getgb1r.f getgb1s.f
getgbe.f getgbeh.f getgbem.f getgbemh.f getgbemn.f getgbemp.f
getgbep.f getgbex.f getgbexm.f getgb.f getgbh.f getgbm.f getgbmh.f
getgbmp.f getgbp.f getgi.f getgir.f gtbits.f idsdef.f instrument.f
iw3jdn.f iw3pds.f ixgb.f lengds.f makwmo.f mkfldsep.f
pdsens.f pdseup.f putgbe.f putgben.f putgbex.f putgb.f putgbn.f
q9ie32.f r63w72.f sbytec.f sbyte.f sbytesc.f sbytes.f skgb.f w3ai00.f
w3ai01.f w3ai08.f w3ai15.f w3ai18.f w3ai19.f w3ai24.f w3ai38.f
w3ai39.f w3aq15.f w3difdat.f w3doxdat.f w3fi01.f w3fi04.f
w3fi58.f w3fi59.f w3fi62.f w3fi63.f w3fi64.f w3fi68.f w3fi69.f
w3fi71.f w3fi72.f w3fi73.f w3fi74.f w3fi75.f w3fi76.f w3fi82.f
w3fi83.f w3fi88.f w3fi92.f w3fp11.f w3fp12.f w3fp13.f w3fs13.f
w3fs15.f w3fs21.f w3fs26.f w3ft32.f w3kind.f w3locdat.f w3movdat.f
w3nogds.f w3pradat.f w3reddat.f w3trnarg.f w3utcdat.f
w3valdat.f w3ymdh4.f xmovex.f xstore.f w3tagb.f makgds.f90)
set(fortran_src getgbens.f isrchne.f iw3mat.f mersenne_twister.f mova2i.f
orders.f putgbens.f w3ai40.f w3ai41.f w3ctzdat.f w3fa01.f w3fa03.f w3fa03v.f
w3fa04.f w3fa06.f w3fa09.f w3fa11.f w3fa12.f w3fa13.f w3fb00.f w3fb01.f w3fb02.f
w3fb03.f w3fb04.f w3fb05.f w3fb06.f w3fb07.f w3fb08.f w3fb09.f w3fb10.f w3fb11.f
w3fb12.f w3fc02.f w3fc05.f w3fc06.f w3fc07.f w3fc08.f w3fi02.f w3fi03.f w3fi18.f
w3fi19.f w3fi20.f w3fi32.f w3fi47.f w3fi48.f w3fi61.f w3fi65.f
w3fi66.f w3fi67.f w3fi70.f w3fi78.f w3fi85.f w3fm07.f w3fm08.f w3fp04.f w3fp05.f
w3fp06.f w3fp10.f w3ft00.f w3ft01.f w3ft02.f w3ft03.f w3ft05.f w3ft05v.f
w3ft06.f w3ft06v.f w3ft07.f w3ft08.f w3ft09.f w3ft10.f w3ft11.f w3ft12.f
w3ft16.f w3ft17.f w3ft201.f w3ft202.f w3ft203.f w3ft204.f w3ft205.f w3ft206.f
w3ft207.f w3ft208.f w3ft209.f w3ft210.f w3ft211.f w3ft212.f w3ft213.f w3ft214.f
w3ft21.f w3ft26.f w3ft33.f w3ft38.f w3ft39.f w3ft40.f w3ft41.f w3ft43v.f w3log.f
xdopen.f aea.f errexit.f errmsg.f fparsei.f fparser.f gbytec.f gbyte.f gbytesc.f
gbytes.f getbit.f getgb1.f getgb1re.f getgb1r.f getgb1s.f getgbe.f getgbeh.f
getgbem.f getgbemh.f getgbemn.f getgbemp.f getgbep.f getgbex.f getgbexm.f
getgb.f getgbh.f getgbm.f getgbmh.f getgbmp.f getgbp.f getgi.f getgir.f gtbits.f
idsdef.f instrument.f iw3jdn.f iw3pds.f ixgb.f lengds.f makwmo.f mkfldsep.f
pdsens.f pdseup.f putgbe.f putgben.f putgbex.f putgb.f putgbn.f q9ie32.f
r63w72.f sbytec.f sbyte.f sbytesc.f sbytes.f skgb.f w3ai00.f w3ai01.f w3ai08.f
w3ai15.f w3ai18.f w3ai19.f w3ai24.f w3ai38.f w3ai39.f w3aq15.f w3as00.f
w3difdat.f w3doxdat.f w3fi01.f w3fi04.f w3fi58.f w3fi59.f w3fi62.f w3fi63.f
w3fi64.f w3fi68.f w3fi69.f w3fi71.f w3fi72.f w3fi73.f w3fi74.f w3fi75.f w3fi76.f
w3fi82.f w3fi83.f w3fi88.f w3fi92.f w3fp11.f w3fp12.f w3fp13.f w3fs13.f w3fs15.f
w3fs21.f w3fs26.f w3ft32.f w3kind.f w3locdat.f w3movdat.f w3nogds.f w3pradat.f
w3reddat.f w3trnarg.f w3utcdat.f w3valdat.f w3ymdh4.f xmovex.f xstore.f w3tagb.f
makgds.f90)

# These functions call NCEPLIBS-bufr.
if(BUILD_WITH_BUFR)
set(fortran_src ${fortran_src} w3miscan.f iw3unp29.f w3unpk77.f)
endif()

# These functions call external, mysterious dependencies.
if(BUILD_WITH_EXTRA_DEPS)
set(fortran_src ${fortran_src} args_mod.f w3as00.f w3fi52.f w3fq07.f)
endif()

# This is the C source code.
set(c_src summary.c)
add_library(c_obj_lib OBJECT ${c_src})
Expand Down
18 changes: 7 additions & 11 deletions src/mkfldsep.f
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
C> - 15 - 18 Marker string (****).
C> - 19 Line Feed (ASCII "0A").
C>
C>
C> Program history log:
C> - Stephen Gilbert 2002-09-16
C>
C> @param[in] iopt Flag Field Separator block option:
C> = 1: Separator block for use with alphanumeric bulletins.
C> if lenin <= 18 and lenbull <= 999999, OPTION 1 block will be generated.
Expand All @@ -55,23 +51,23 @@
C>
C> @author Stephen Gilbert @date 2002-09-16
subroutine mkfldsep(csep,iopt,lenin,lenbull,lenout)
C
C
character*(*),intent(out) :: csep
integer,intent(in) :: iopt,lenin,lenbull
integer,intent(out) :: lenout
C
C
character(len=4),parameter :: cstar='****',clb='####'
C
C
if (iopt.eq.1) then
if ( lenin .le. 18 .and. lenbull .le. 999999 ) then
! Create OPTION 1 separator block
C Create OPTION 1 separator block
csep(1:4)=clb
csep(5:7)='018'
write(csep(8:13),fmt='(I6.6)') lenbull
csep(14:17)=clb
csep(18:18)=char(10)
lenout=18
else ! Create OPTION 1a separator block
else ! Create OPTION 1a separator block
nnn=lenin
if ( nnn.lt.23 ) nnn=23
csep(1:4)=clb
Expand All @@ -82,7 +78,7 @@ subroutine mkfldsep(csep,iopt,lenin,lenbull,lenout)
csep(nnn:nnn)=char(10)
lenout=nnn
endif
elseif (iopt.eq.2) then ! Create OPTION 2 separator block
elseif (iopt.eq.2) then ! Create OPTION 2 separator block
csep(1:4)=cstar
write(csep(5:14),fmt='(I10.10)') lenbull
csep(15:18)=cstar
Expand All @@ -92,6 +88,6 @@ subroutine mkfldsep(csep,iopt,lenin,lenbull,lenout)
print *,"mkfldsep: Option ",iopt," not recognized."
csep(1:lenin)=' '
endif
C
C
return
end
9 changes: 5 additions & 4 deletions src/w3as00.f
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ subroutine W3AS00(nch_parm,cparm,iret_parm)
character*112 cwork
equivalence (jwork,cwork)

integer(4) nargsinline,iargc,iar
integer(4) nargsinline,iar
integer nchars
integer lmt_txt
integer non_parm
Expand Down Expand Up @@ -119,7 +119,7 @@ subroutine W3AS00(nch_parm,cparm,iret_parm)

narg_got = 0
C
nargsinline = iargc()
nargsinline = command_argument_count()

write(6,115) nargsinline
115 format(1h ,'W3AS00: count of args found in command line =', I3)
Expand All @@ -132,14 +132,15 @@ subroutine W3AS00(nch_parm,cparm,iret_parm)

cwork(1:) = ' '

call getarg(iar,cwork)
call get_command_argument(iar,cwork)

narg_got = narg_got + 1
nchars = lastch(cwork)

if(nchars .le. 0) then
write(6,125)iar
125 format(1h ,'W3AS00:getarg() returned an empty arg for',
125 format(1h ,'W3AS00:get_command_argument()',
A 'returned an empty arg for',
A ' no.',I3 )
else
C ... SOME TEXT EXISTS IN THIS ARG ...
Expand Down
Loading

0 comments on commit d5de852

Please sign in to comment.