From 153835ef35476259272ab6a9e72d9f0b5ade62c5 Mon Sep 17 00:00:00 2001 From: Alain Coat <97431609+alcoat@users.noreply.github.com> Date: Fri, 3 Oct 2025 16:05:23 +0200 Subject: [PATCH 01/18] Fix missing comma #1497 --- model/src/w3gridmd.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index 30eb951f0a..ed8929a8c2 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -6342,7 +6342,7 @@ SUBROUTINE W3GRID() 2922 FORMAT ( ' &SNL1 LAMBDA =',F7.3,', NLPROP =',E10.3, & ', KDCONV =',F7.3,', KDMIN =',F7.3,','/ & ' SNLCS1 =',F7.3,', SNLCS2 =',F7.3, & - ', SNLCS3 = ',F7.3','/ & + ', SNLCS3 = ',F7.3,','/ & ' IQTYPE =',I2,', TAILNL =',F5.1,','/ & ' GQMNF1 =',I2,', GQMNT1 =',I2,',', & ' GQMNQ_OM2 =',I2,', GQMTHRSAT =',E11.4,', GQMTHRCOU =',F4.3,','/ & From 304811331de6171adc32229c2bf252d8846cc5b5 Mon Sep 17 00:00:00 2001 From: Coat Date: Thu, 16 Oct 2025 15:40:37 +0200 Subject: [PATCH 02/18] allow to compile with switches S and T --- model/src/w3adatmd.F90 | 4 ++-- model/src/w3iogrmd.F90 | 8 ++++---- model/src/w3snl1md.F90 | 8 ++++++-- model/src/ww3_prtide.F90 | 3 +++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/model/src/w3adatmd.F90 b/model/src/w3adatmd.F90 index 2daee3609b..9165519273 100644 --- a/model/src/w3adatmd.F90 +++ b/model/src/w3adatmd.F90 @@ -945,11 +945,11 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY ) !/ Local parameters !/ INTEGER :: JGRID, NXXX, NSEAL_tmp + integer :: memunit #ifdef W3_S INTEGER, SAVE :: IENT = 0 CALL STRACE (IENT, 'W3DIMA') #endif - integer :: memunit ! ! -------------------------------------------------------------------- / ! 1. Test input and module status @@ -1562,11 +1562,11 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS ) !/ Local parameters !/ INTEGER :: JGRID, NXXX, I + integer :: memunit #ifdef W3_S INTEGER, SAVE :: IENT = 0 CALL STRACE (IENT, 'W3XDMA') #endif - integer :: memunit ! ! -------------------------------------------------------------------- / ! 1. Test input and module status diff --git a/model/src/w3iogrmd.F90 b/model/src/w3iogrmd.F90 index e8302d1dd6..13ee1c2b08 100644 --- a/model/src/w3iogrmd.F90 +++ b/model/src/w3iogrmd.F90 @@ -1646,10 +1646,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & GQNQ_OM2, GQTHRSAT, GQTHRCOU, GQAMP IF (IERR.NE.0) CALL EXTIOF(NDSE,IERR,'W3IOGR','mod_def.'//FILEXT(:IEXT),51) END IF - IF ( FLTEST ) WRITE (NDST,9051) SNLC1, LAM, & - KDCON, KDMN, SNLS1, SNLS2, SNLS3, & - IQTPE, NLTAIL, GQNF1, GQNT1, GQNQ_OM2, & - GQTHRSAT, GQTHRCOU, GQAMP +! IF ( FLTEST ) WRITE (NDST,9051) SNLC1, LAM, & +! KDCON, KDMN, SNLS1, SNLS2, SNLS3, & +! IQTPE, NLTAIL, GQNF1, GQNT1, GQNQ_OM2, & +! GQTHRSAT, GQTHRCOU, GQAMP #endif ! #ifdef W3_NL2 diff --git a/model/src/w3snl1md.F90 b/model/src/w3snl1md.F90 index 1e1949367f..ab4e651fe5 100644 --- a/model/src/w3snl1md.F90 +++ b/model/src/w3snl1md.F90 @@ -1555,10 +1555,10 @@ SUBROUTINE INSNLGQM !/ ------------------------------------------------------------------- / USE CONSTANTS, ONLY: GRAV USE W3GDATMD, ONLY: NK , NTH , XFR , FR1, GQNF1, GQNT1, GQNQ_OM2, NLTAIL, GQTHRCOU - #ifdef W3_S - CALL STRACE (IENT, 'INSNLGQM') + USE W3SERVMD, ONLY: STRACE #endif + IMPLICIT NONE !.....LOCAL VARIABLES INTEGER JF , JT , JF1 , JT1 , NF1P1 , IAUX , NT , NF , IK @@ -1582,6 +1582,10 @@ SUBROUTINE INSNLGQM DOUBLE PRECISION :: FREQ(NK) DOUBLE PRECISION, ALLOCATABLE :: F1SF(:) , X_CHE_TE1(:) , X_CHE_OM2(:) , X_LEG_OM2(:) , W_LEG_OM2(:) & , MAXCLA(:) +#ifdef W3_S + INTEGER, SAVE :: IENT = 0 + CALL STRACE (IENT, 'INSNLGQM') +#endif PI = Acos(-1.) LBUF = 500 diff --git a/model/src/ww3_prtide.F90 b/model/src/ww3_prtide.F90 index 230a30b764..d0ccdb7837 100644 --- a/model/src/ww3_prtide.F90 +++ b/model/src/ww3_prtide.F90 @@ -192,6 +192,9 @@ PROGRAM W3PRTIDE ! LOGICAL :: TIDEFILL ! +#ifdef W3_S + INTEGER, SAVE :: IENT = 0 +#endif !/ !/ ------------------------------------------------------------------- / !/ From 3b6a61ad024904e31be1a71506ad9b40916190f9 Mon Sep 17 00:00:00 2001 From: Coat Date: Fri, 17 Oct 2025 14:30:41 +0200 Subject: [PATCH 03/18] enable gnu CI --- .github/workflows/gnu.yml | 109 +++++++++++++++++++++++++ .github/workflows/regtest_gnu.yml | 130 ++++++++++++++++++++++++++++++ model/ci/spack_gnu.yaml | 6 +- 3 files changed, 242 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/gnu.yml create mode 100644 .github/workflows/regtest_gnu.yml diff --git a/.github/workflows/gnu.yml b/.github/workflows/gnu.yml new file mode 100644 index 0000000000..78db170f63 --- /dev/null +++ b/.github/workflows/gnu.yml @@ -0,0 +1,109 @@ +name: GNU Linux Build +on: [push, pull_request, workflow_dispatch] + +# Cancel in-progress workflows when pushing to a branch +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + cache_key: gnu11 + CC: gcc-14 + FC: gfortran-14 + CXX: g++-14 + + +# Split into a steup step, and a WW3 build step which +# builds multiple switches in a matrix. The setup is run once and +# the environment is cached so each build of WW3 can share the dependencies. + +jobs: + setup: + runs-on: ubuntu-latest + + steps: + - name: checkout-ww3 + if: steps.cache-env.outputs.cache-hit != 'true' + uses: actions/checkout@v3 + with: + path: ww3 + # Cache spack, OASIS, and compiler + # No way to flush Action cache, so key may have # appended + - name: cache-env + id: cache-env + uses: actions/cache@v3 + with: + path: | + spack + ~/.spack + work_oasis3-mct + key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} + + # Build WW3 spack environment + - name: install-dependencies-with-spack + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + # Install NetCDF, ESMF, g2, etc using Spack + sudo apt install cmake + #git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git + git clone -c feature.manyFiles=true --depth=2 --branch=spack-stack-1.9.3 https://github.com/JCSDA/spack.git + source spack/share/spack/setup-env.sh + spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml + spack env activate ww3-gnu + spack compiler find + spack external find cmake + spack add mpich@3.4.2 + spack concretize + spack install --dirty -v + + - name: build-oasis + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + source spack/share/spack/setup-env.sh + spack env activate ww3-gnu + export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model + export OASIS_INPUT_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/oasis3-mct + export OASIS_WORK_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct + cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir + cmake . + make VERBOSE=1 + cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct ${GITHUB_WORKSPACE} + + build: + needs: setup + strategy: + matrix: + switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] + runs-on: ubuntu-latest + + steps: + - name: checkout-ww3 + uses: actions/checkout@v3 + with: + path: ww3 + + - name: cache-env + id: cache-env + uses: actions/cache@v3 + with: + path: | + spack + ~/.spack + work_oasis3-mct + key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} + + - name: build-ww3 + run: | + source spack/share/spack/setup-env.sh + spack env activate ww3-gnu + cd ww3 + export CC=mpicc + export FC=mpif90 + export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct + mkdir build && cd build + if [[ ${{ matrix.switch }} == "MULTI_ESMF" ]]; then + cmake .. -DMULTI_ESMF=ON -DSWITCH=multi_esmf + else + cmake .. -DSWITCH=${{ matrix.switch }} + fi + make -j2 VERBOSE=1 diff --git a/.github/workflows/regtest_gnu.yml b/.github/workflows/regtest_gnu.yml new file mode 100644 index 0000000000..642a1cb2d0 --- /dev/null +++ b/.github/workflows/regtest_gnu.yml @@ -0,0 +1,130 @@ +name: regtest_gnu +on: [push, pull_request, workflow_dispatch] + +# Cancel in-progress workflows when pushing to a branch +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + cache_key: gnu11-1 + CC: gcc-14 + FC: gfortran-14 + CXX: g++-14 + + +# Split into a steup step, and a WW3 build step which +# builds multiple switches in a matrix. The setup is run once and +# the environment is cached so each build of WW3 can share the dependencies. + +jobs: + setup: + runs-on: ubuntu-latest + + steps: + - name: checkout-ww3 + if: steps.cache-env.outputs.cache-hit != 'true' + uses: actions/checkout@v3 + with: + path: ww3 + # Cache spack, OASIS, and compiler + # No way to flush Action cache, so key may have # appended + - name: cache-env + id: cache-env + uses: actions/cache@v3 + with: + path: | + spack + ~/.spack + work_oasis3-mct + key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} + + # Build WW3 spack environment + - name: install-dependencies-with-spack + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + # Install NetCDF, ESMF, g2, etc using Spack + sudo apt install cmake + git clone -c feature.manyFiles=true --depth=2 --branch=spack-stack-1.9.3 https://github.com/JCSDA/spack.git + source spack/share/spack/setup-env.sh + spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml + spack env activate ww3-gnu + spack compiler find + spack external find cmake + spack add mpich@3.4.2 + spack concretize + spack install --dirty -v + + - name: build-oasis + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + source spack/share/spack/setup-env.sh + spack env activate ww3-gnu + export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model + export OASIS_INPUT_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/oasis3-mct + export OASIS_WORK_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct + cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir + cmake . + make VERBOSE=1 + cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct ${GITHUB_WORKSPACE} + + regtest_gnu: + needs: setup + runs-on: ubuntu-latest + + steps: + - name: install-dependencies + run: | + sudo apt-get update + sudo apt-get install doxygen gcovr valgrind + + - name: checkout-ww3 + uses: actions/checkout@v3 + with: + path: ww3 + + - name: cache-env + id: cache-env + uses: actions/cache@v3 + with: + path: | + spack + ~/.spack + work_oasis3-mct + key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} + + - name: build-ww3 + run: | + source spack/share/spack/setup-env.sh + spack env activate ww3-gnu + set -x + cd ww3 + export CC=mpicc + export FC=mpif90 + export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct + # mkdir build && cd build + export LD_LIBRARY_PATH="/home/runner/work/WW3/WW3/spack/var/spack/environments/ww3-gnu/.spack-env/view/:$LD_LIBRARY_PATH" + # cmake -DSWITCH=${GITHUB_WORKSPACE}/ww3/regtests/unittests/data/switch.io -DCMAKE_BUILD_TYPE=Debug .. + # make -j2 VERBOSE=1 + cd ${GITHUB_WORKSPACE}/ww3 + ls -l + ${GITHUB_WORKSPACE}/ww3/model/bin/ww3_from_ftp.sh -k + cd regtests + ./bin/run_cmake_test -o all -S -T -s PR1_MPI -w work_PR1_MPI -f -p mpirun -n 24 ../model ww3_tp2.5 + cd ww3_tp2.5 + ls -l + cd work_PR1_MPI + pwd + ls -l + # ncdump -h out_pnt.ww3.nc > ncdump_out.txt + # cat ncdump_out.txt + # pwd + # cat ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt + # cmp ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt ncdump_out.txt + + - name: cache-data + id: cache-data + uses: actions/cache@v3 + with: + path: ww3/ww3_from_ftp.v7.14.1.tar.gz + key: ww3_from_ftp.v7.14.1 diff --git a/model/ci/spack_gnu.yaml b/model/ci/spack_gnu.yaml index d2c16711aa..6003d7594d 100644 --- a/model/ci/spack_gnu.yaml +++ b/model/ci/spack_gnu.yaml @@ -7,12 +7,12 @@ spack: - metis@5.1.0~shared - parmetis@4.0.3~shared - scotch@7.0.1+mpi+metis~shared - - netcdf-c@4.7.4~dap - - netcdf-fortran@4.5.3 + - netcdf-c@4.9.2~dap + - netcdf-fortran@4.6.1 - jasper@2.0.32 - g2@3.4.5 - bacio@2.4.1 - - w3emc@2.9.2 + - w3emc@2.12.0 - parallelio@2.5.9+fortran~pnetcdf - esmf@8.4.2~debug~xerces+external-parallelio view: true From 28ace2d0b4e17d5244e0495f8e1f53f82fb1225e Mon Sep 17 00:00:00 2001 From: Coat Date: Fri, 17 Oct 2025 17:44:33 +0200 Subject: [PATCH 04/18] replace abort by extcde or extopn --- model/src/w3strkmd.F90 | 22 +++++++++++----------- model/src/ww3_systrk.F90 | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/model/src/w3strkmd.F90 b/model/src/w3strkmd.F90 index 58b637f3ab..e0a11f7180 100644 --- a/model/src/w3strkmd.F90 +++ b/model/src/w3strkmd.F90 @@ -315,7 +315,7 @@ SUBROUTINE waveTracking_NWS_V2 (intype ,tmax , & !/ reserved. WAVEWATCH III is a trademark of the NWS. !/ No unauthorized use without permission. !/ - USE W3SERVMD, ONLY: EXTIOF + USE W3SERVMD, ONLY: EXTIOF, EXTCDE #ifdef W3_MPI use mpi_f08 #endif @@ -5733,6 +5733,7 @@ RECURSIVE SUBROUTINE QSORT(ARRAY,IDX,LO,HI) ! LO INTEGER input First element ! HI INTEGER input Last element ! + USE W3SERVMD, ONLY: EXTIOF, EXTCDE IMPLICIT NONE !/ INTEGER, INTENT(IN) :: LO,HI @@ -5740,7 +5741,6 @@ RECURSIVE SUBROUTINE QSORT(ARRAY,IDX,LO,HI) !/ ! Local variables ! ---------------------------------------------------------------- - EXTERNAL :: ABORT LOGICAL :: LOOP INTEGER :: TOP, BOT REAL :: VAL, TMP @@ -5767,16 +5767,16 @@ RECURSIVE SUBROUTINE QSORT(ARRAY,IDX,LO,HI) !/ --- Check array size and bounds. --- IF ( SIZE(ARRAY).EQ. 0 ) THEN WRITE(6,199) - CALL ABORT + CALL EXTCDE(1) ELSE IF ( SIZE(ARRAY).NE.SIZE(IDX) ) THEN WRITE(6,201) - CALL ABORT + CALL EXTCDE(1) ELSE IF ( LBOUND(ARRAY,1).GT.LO ) THEN WRITE(6,203) - CALL ABORT + CALL EXTCDE(1) ELSE IF ( UBOUND(ARRAY,1).LT.HI ) THEN WRITE(6,205) - CALL ABORT + CALL EXTCDE(1) END IF ! TOP = LO @@ -5859,6 +5859,7 @@ RECURSIVE SUBROUTINE QSORT_DESC(ARRAY,IDX,LO,HI) ! LO INTEGER input First element ! HI INTEGER input Last element ! + USE W3SERVMD, ONLY: EXTIOF, EXTCDE IMPLICIT NONE !/ INTEGER, INTENT(IN) :: LO,HI @@ -5866,7 +5867,6 @@ RECURSIVE SUBROUTINE QSORT_DESC(ARRAY,IDX,LO,HI) !/ ! Local variables ! ---------------------------------------------------------------- - EXTERNAL :: ABORT INTEGER :: TOP, BOT, I REAL :: VAL, TMP LOGICAL :: LOOP @@ -5893,16 +5893,16 @@ RECURSIVE SUBROUTINE QSORT_DESC(ARRAY,IDX,LO,HI) !/ --- Check array size and bounds. --- IF ( SIZE(ARRAY).EQ. 0 ) THEN WRITE(6,199) - CALL ABORT + CALL EXTCDE(1) ELSE IF ( SIZE(ARRAY).NE.SIZE(IDX) ) THEN WRITE(6,201) - CALL ABORT + CALL EXTCDE(1) ELSE IF ( LBOUND(ARRAY,1).GT.LO ) THEN WRITE(6,203) - CALL ABORT + CALL EXTCDE(1) ELSE IF ( UBOUND(ARRAY,1).LT.HI ) THEN WRITE(6,205) - CALL ABORT + CALL EXTCDE(1) END IF ! TOP = LO diff --git a/model/src/ww3_systrk.F90 b/model/src/ww3_systrk.F90 index 6635f1e867..05b6575c7b 100644 --- a/model/src/ww3_systrk.F90 +++ b/model/src/ww3_systrk.F90 @@ -58,6 +58,7 @@ PROGRAM WW3_SYSTRK !/ USE W3STRKMD USE W3TIMEMD, ONLY: TDIFF + USE W3SERVMD, ONLY: EXTCDE, EXTOPN #ifdef W3_MPI use mpi_f08 #endif @@ -77,7 +78,6 @@ PROGRAM WW3_SYSTRK ! ! 3. Parameters : ! - EXTERNAL :: ABORT LOGICAL :: testout PARAMETER (testout = .FALSE.) CHARACTER :: filename*80, paramFile*32 @@ -210,7 +210,7 @@ PROGRAM WW3_SYSTRK IF (.NOT.file_exists) THEN WRITE(20,2000) WRITE(6,2000) - CALL ABORT + CALL EXTOPN(6,1,'W3SYSTRK','INPUT',41) END IF OPEN(unit=10,file='ww3_systrk.inp',status='old') From a2fdb2d406820404a0dce01c72aa1b917a28f72c Mon Sep 17 00:00:00 2001 From: Coat Date: Fri, 17 Oct 2025 18:01:52 +0200 Subject: [PATCH 05/18] change type mpicomm --- model/src/wmesmfmd.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/wmesmfmd.F90 b/model/src/wmesmfmd.F90 index f3206485f7..9d6f1b6bbe 100644 --- a/model/src/wmesmfmd.F90 +++ b/model/src/wmesmfmd.F90 @@ -757,7 +757,7 @@ subroutine InitializeP1 ( gcomp, impState, expState, extClock, rc ) integer, parameter :: iwt=2 real(8) :: wstime, wftime integer :: idsi, idso, idss, idst, idse - integer :: mpiComm = -99 + type(MPI_COMM) :: mpicomm = -99 logical :: configIsPresent type(ESMF_Config) :: config character(ESMF_MAXSTR) :: wrkdir = '.' From dad78b8aa45e561da34f2d42f85b763836afc012 Mon Sep 17 00:00:00 2001 From: Coat Date: Fri, 17 Oct 2025 18:06:38 +0200 Subject: [PATCH 06/18] fix mpicomm init --- model/src/wmesmfmd.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/wmesmfmd.F90 b/model/src/wmesmfmd.F90 index 9d6f1b6bbe..deac434498 100644 --- a/model/src/wmesmfmd.F90 +++ b/model/src/wmesmfmd.F90 @@ -757,7 +757,7 @@ subroutine InitializeP1 ( gcomp, impState, expState, extClock, rc ) integer, parameter :: iwt=2 real(8) :: wstime, wftime integer :: idsi, idso, idss, idst, idse - type(MPI_COMM) :: mpicomm = -99 + type(MPI_COMM) :: mpicomm = MPI_COMM_WORLD logical :: configIsPresent type(ESMF_Config) :: config character(ESMF_MAXSTR) :: wrkdir = '.' From 92d2b40ad363891b33ea13c32a6a7756687be323 Mon Sep 17 00:00:00 2001 From: Coat Date: Fri, 17 Oct 2025 18:38:17 +0200 Subject: [PATCH 07/18] just try cast --- model/src/wmesmfmd.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/wmesmfmd.F90 b/model/src/wmesmfmd.F90 index deac434498..3c9eb61617 100644 --- a/model/src/wmesmfmd.F90 +++ b/model/src/wmesmfmd.F90 @@ -887,7 +887,7 @@ subroutine InitializeP1 ( gcomp, impState, expState, extClock, rc ) call ESMF_GridCompGet(gcomp, vm=vm, rc=rc) if (ESMF_LogFoundError(rc, PASSTHRU)) return call ESMF_VMGet(vm, petCount=npet, localPet=lpet, & - mpiCommunicator=mpiComm, rc=rc) + mpiCommunicator=int(mpiComm), rc=rc) if (ESMF_LogFoundError(rc, PASSTHRU)) return nmproc = npet improc = lpet + 1 From f29212d858daf7507743d6613c829344bb19660c Mon Sep 17 00:00:00 2001 From: Coat Date: Fri, 17 Oct 2025 18:59:31 +0200 Subject: [PATCH 08/18] back --- model/src/wmesmfmd.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/wmesmfmd.F90 b/model/src/wmesmfmd.F90 index 3c9eb61617..28256306b8 100644 --- a/model/src/wmesmfmd.F90 +++ b/model/src/wmesmfmd.F90 @@ -887,7 +887,7 @@ subroutine InitializeP1 ( gcomp, impState, expState, extClock, rc ) call ESMF_GridCompGet(gcomp, vm=vm, rc=rc) if (ESMF_LogFoundError(rc, PASSTHRU)) return call ESMF_VMGet(vm, petCount=npet, localPet=lpet, & - mpiCommunicator=int(mpiComm), rc=rc) + mpiCommunicator=mpicomm, rc=rc) if (ESMF_LogFoundError(rc, PASSTHRU)) return nmproc = npet improc = lpet + 1 From 9a0e4929384dce6731604ff77a974a9080c97d85 Mon Sep 17 00:00:00 2001 From: Alain Coat <97431609+alcoat@users.noreply.github.com> Date: Sun, 19 Oct 2025 11:59:42 +0200 Subject: [PATCH 09/18] Cancel MULTI_ESMF --- .github/workflows/gnu.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gnu.yml b/.github/workflows/gnu.yml index 78db170f63..fb23889ee7 100644 --- a/.github/workflows/gnu.yml +++ b/.github/workflows/gnu.yml @@ -73,7 +73,8 @@ jobs: needs: setup strategy: matrix: - switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] + #switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] + switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO] runs-on: ubuntu-latest steps: From 7ebf7836323cf104548dad081eefa10be0b60821 Mon Sep 17 00:00:00 2001 From: Coat Date: Sun, 19 Oct 2025 17:20:20 +0200 Subject: [PATCH 10/18] cancel MULTI_ESMF and ite_pdlib --- .github/workflows/gnu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gnu.yml b/.github/workflows/gnu.yml index fb23889ee7..daa5f636a5 100644 --- a/.github/workflows/gnu.yml +++ b/.github/workflows/gnu.yml @@ -74,7 +74,7 @@ jobs: strategy: matrix: #switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] - switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO] + switch: [Ifremer1, NCEP_st2, NCEP_st4, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO] runs-on: ubuntu-latest steps: From aa866b433209081eafc9129311a8508890c314d1 Mon Sep 17 00:00:00 2001 From: Coat Date: Sun, 19 Oct 2025 17:36:31 +0200 Subject: [PATCH 11/18] comment external abort --- .github/workflows/gnu.yml | 2 +- model/src/PDLIB/yowfunction.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gnu.yml b/.github/workflows/gnu.yml index daa5f636a5..fb23889ee7 100644 --- a/.github/workflows/gnu.yml +++ b/.github/workflows/gnu.yml @@ -74,7 +74,7 @@ jobs: strategy: matrix: #switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] - switch: [Ifremer1, NCEP_st2, NCEP_st4, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO] + switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO] runs-on: ubuntu-latest steps: diff --git a/model/src/PDLIB/yowfunction.F90 b/model/src/PDLIB/yowfunction.F90 index 5e30f776e4..c3c3a7b431 100644 --- a/model/src/PDLIB/yowfunction.F90 +++ b/model/src/PDLIB/yowfunction.F90 @@ -46,7 +46,7 @@ module yowfunction !********************************************************************** SUBROUTINE PDLIB_ABORT(istat) IMPLICIT NONE - external :: ABORT + !external :: ABORT integer, intent(in) :: istat Print *, 'Error with istat=', istat CALL ABORT From 50514e82472d9e852057872fa2164f233373153e Mon Sep 17 00:00:00 2001 From: Coat Date: Sun, 19 Oct 2025 21:15:32 +0200 Subject: [PATCH 12/18] fix call to ESMF_VMGet --- .github/workflows/gnu.yml | 3 +-- model/src/wmesmfmd.F90 | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gnu.yml b/.github/workflows/gnu.yml index fb23889ee7..78db170f63 100644 --- a/.github/workflows/gnu.yml +++ b/.github/workflows/gnu.yml @@ -73,8 +73,7 @@ jobs: needs: setup strategy: matrix: - #switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] - switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO] + switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] runs-on: ubuntu-latest steps: diff --git a/model/src/wmesmfmd.F90 b/model/src/wmesmfmd.F90 index 28256306b8..9c288cbdb3 100644 --- a/model/src/wmesmfmd.F90 +++ b/model/src/wmesmfmd.F90 @@ -167,7 +167,6 @@ module WMESMFMD !/ ! --- ESMF Module use ESMF - ! --- NUOPC modules use NUOPC use NUOPC_Model, parent_SetServices => SetServices @@ -203,6 +202,7 @@ module WMESMFMD !/ #ifdef W3_MPI use mpi_f08 + use, intrinsic :: iso_c_binding, only: C_INT #endif !/ implicit none @@ -758,6 +758,7 @@ subroutine InitializeP1 ( gcomp, impState, expState, extClock, rc ) real(8) :: wstime, wftime integer :: idsi, idso, idss, idst, idse type(MPI_COMM) :: mpicomm = MPI_COMM_WORLD + integer(C_INT) :: c_int_mpicomm logical :: configIsPresent type(ESMF_Config) :: config character(ESMF_MAXSTR) :: wrkdir = '.' @@ -887,7 +888,8 @@ subroutine InitializeP1 ( gcomp, impState, expState, extClock, rc ) call ESMF_GridCompGet(gcomp, vm=vm, rc=rc) if (ESMF_LogFoundError(rc, PASSTHRU)) return call ESMF_VMGet(vm, petCount=npet, localPet=lpet, & - mpiCommunicator=mpicomm, rc=rc) + mpiCommunicator=c_int_mpicomm, rc=rc) + mpicomm = MPI_Comm(c_int_mpicomm) if (ESMF_LogFoundError(rc, PASSTHRU)) return nmproc = npet improc = lpet + 1 From 04f1d4a2ee70990342d00bcefce7a87e4151a01a Mon Sep 17 00:00:00 2001 From: Coat Date: Tue, 21 Oct 2025 09:47:07 +0200 Subject: [PATCH 13/18] upgrade netcdf --- model/ci/spack_intel.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/ci/spack_intel.yaml b/model/ci/spack_intel.yaml index c571da825d..17079194f8 100644 --- a/model/ci/spack_intel.yaml +++ b/model/ci/spack_intel.yaml @@ -5,8 +5,8 @@ spack: providers: mpi: [intel-oneapi-mpi] specs: - - netcdf-c@4.7.4~dap - - netcdf-fortran@4.5.3 + - netcdf-c@4.9.2~dap + - netcdf-fortran@4.6.1 - bacio@2.4.1 - g2@3.4.5 - metis@5.1.0~shared From b771654dc6d6232d039fd72394033d7951f010a7 Mon Sep 17 00:00:00 2001 From: Coat Date: Tue, 21 Oct 2025 09:48:11 +0200 Subject: [PATCH 14/18] activate Intel build with ubuntu 22.04: new glibc not compatible with intel 2023 --- .github/workflows/intel.yml | 137 ++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 .github/workflows/intel.yml diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml new file mode 100644 index 0000000000..bf18a8cead --- /dev/null +++ b/.github/workflows/intel.yml @@ -0,0 +1,137 @@ +# This is a GitHub actions workflow for WW3. +# +# This workflow builds with the Intel compilers. +# +# Matt Masarik, Alex Richert, Ed Hartnett +name: Intel Linux Build +on: [push, pull_request, workflow_dispatch] + +# Cancel in-progress workflows when pushing to a branch +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran +env: + cache_key: intel10-3 + CC: icc + FC: ifort + CXX: icpc + I_MPI_CC: icc + I_MPI_F90: ifort + +# Split into a dependency build step, and a WW3 build step which +# builds multiple switches in a matrix. The setup is run once and +# the environment is cached so each build of WW3 can share the dependencies. + +jobs: + setup: + runs-on: ubuntu-22.04 + + steps: + + - name: checkout-ww3 + if: steps.cache-env.outputs.cache-hit != 'true' + uses: actions/checkout@v3 + with: + path: ww3 + + # Cache spack, OASIS, and compiler + # No way to flush Action cache, so key may have # appended + - name: cache-env + id: cache-env + uses: actions/cache@v3 + with: + path: | + spack + ~/.spack + work_oasis3-mct + /opt/intel + key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_intel.yaml') }} + + - name: install-intel-compilers + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB + echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo apt-get update + sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-compiler-fortran-2023.2.1 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.1 intel-oneapi-openmp + + # Build WW3 spack environment + - name: install-dependencies-with-spack + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + sudo mv /usr/local /usr/local_mv + # Install NetCDF, ESMF, g2, etc using Spack + . /opt/intel/oneapi/setvars.sh + git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git + source spack/share/spack/setup-env.sh + ln -s $(realpath $(which gcc)) spack/lib/spack/env/intel/gcc # spack/make bug in ESMF + spack env create ww3-intel ww3/model/ci/spack_intel.yaml + spack env activate ww3-intel + spack compiler find + sudo apt install cmake + spack external find + spack config add "packages:mpi:require:'intel-oneapi-mpi'" + spack config add "packages:all:require:['%intel']" + spack concretize + spack install --dirty -v --fail-fast + spack clean --all + + - name: build-oasis + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + . /opt/intel/oneapi/setvars.sh + source spack/share/spack/setup-env.sh + spack env activate ww3-intel + export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model + export OASIS_INPUT_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/oasis3-mct + export OASIS_WORK_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct + cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir + cmake . + make + cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct ${GITHUB_WORKSPACE} + + build: + needs: setup + strategy: + matrix: + switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] + runs-on: ubuntu-latest + + steps: + - name: checkout-ww3 + uses: actions/checkout@v3 + with: + path: ww3 + + - name: cache-env + id: cache-env + uses: actions/cache@v3 + with: + path: | + spack + ~/.spack + work_oasis3-mct + /opt/intel + key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_intel.yaml') }} + + - name: build-ww3 + run: | + sudo mv /usr/local /usr/local_mv + sudo apt install cmake + . /opt/intel/oneapi/setvars.sh + source spack/share/spack/setup-env.sh + spack env activate ww3-intel + cd ww3 + export CC=mpiicc + export FC=mpiifort + export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct + mkdir build && cd build + if [[ ${{ matrix.switch }} == "MULTI_ESMF" ]]; then + cmake .. -DMULTI_ESMF=ON -DSWITCH=multi_esmf + else + cmake .. -DSWITCH=${{ matrix.switch }} + fi + make -j2 VERBOSE=1 From 00b817d85f39e58ea4ec1dc5f693aca178f93e59 Mon Sep 17 00:00:00 2001 From: Coat Date: Mon, 27 Oct 2025 14:36:13 +0100 Subject: [PATCH 15/18] replace tempdisable files --- .github/workflows/gnu.yml | 109 -------------- .github/workflows/gnu.yml.tempdisable | 9 +- .github/workflows/intel.yml | 137 ------------------ .github/workflows/intel.yml.tempdisable | 2 +- .github/workflows/regtest_gnu.yml | 130 ----------------- .github/workflows/regtest_gnu.yml.tempdisable | 8 +- 6 files changed, 10 insertions(+), 385 deletions(-) delete mode 100644 .github/workflows/gnu.yml delete mode 100644 .github/workflows/intel.yml delete mode 100644 .github/workflows/regtest_gnu.yml diff --git a/.github/workflows/gnu.yml b/.github/workflows/gnu.yml deleted file mode 100644 index 78db170f63..0000000000 --- a/.github/workflows/gnu.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: GNU Linux Build -on: [push, pull_request, workflow_dispatch] - -# Cancel in-progress workflows when pushing to a branch -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - cache_key: gnu11 - CC: gcc-14 - FC: gfortran-14 - CXX: g++-14 - - -# Split into a steup step, and a WW3 build step which -# builds multiple switches in a matrix. The setup is run once and -# the environment is cached so each build of WW3 can share the dependencies. - -jobs: - setup: - runs-on: ubuntu-latest - - steps: - - name: checkout-ww3 - if: steps.cache-env.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - path: ww3 - # Cache spack, OASIS, and compiler - # No way to flush Action cache, so key may have # appended - - name: cache-env - id: cache-env - uses: actions/cache@v3 - with: - path: | - spack - ~/.spack - work_oasis3-mct - key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} - - # Build WW3 spack environment - - name: install-dependencies-with-spack - if: steps.cache-env.outputs.cache-hit != 'true' - run: | - # Install NetCDF, ESMF, g2, etc using Spack - sudo apt install cmake - #git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git - git clone -c feature.manyFiles=true --depth=2 --branch=spack-stack-1.9.3 https://github.com/JCSDA/spack.git - source spack/share/spack/setup-env.sh - spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml - spack env activate ww3-gnu - spack compiler find - spack external find cmake - spack add mpich@3.4.2 - spack concretize - spack install --dirty -v - - - name: build-oasis - if: steps.cache-env.outputs.cache-hit != 'true' - run: | - source spack/share/spack/setup-env.sh - spack env activate ww3-gnu - export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model - export OASIS_INPUT_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/oasis3-mct - export OASIS_WORK_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct - cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir - cmake . - make VERBOSE=1 - cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct ${GITHUB_WORKSPACE} - - build: - needs: setup - strategy: - matrix: - switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] - runs-on: ubuntu-latest - - steps: - - name: checkout-ww3 - uses: actions/checkout@v3 - with: - path: ww3 - - - name: cache-env - id: cache-env - uses: actions/cache@v3 - with: - path: | - spack - ~/.spack - work_oasis3-mct - key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} - - - name: build-ww3 - run: | - source spack/share/spack/setup-env.sh - spack env activate ww3-gnu - cd ww3 - export CC=mpicc - export FC=mpif90 - export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct - mkdir build && cd build - if [[ ${{ matrix.switch }} == "MULTI_ESMF" ]]; then - cmake .. -DMULTI_ESMF=ON -DSWITCH=multi_esmf - else - cmake .. -DSWITCH=${{ matrix.switch }} - fi - make -j2 VERBOSE=1 diff --git a/.github/workflows/gnu.yml.tempdisable b/.github/workflows/gnu.yml.tempdisable index d28d1bb5b5..78db170f63 100644 --- a/.github/workflows/gnu.yml.tempdisable +++ b/.github/workflows/gnu.yml.tempdisable @@ -8,9 +8,9 @@ concurrency: env: cache_key: gnu11 - CC: gcc-10 - FC: gfortran-10 - CXX: g++-10 + CC: gcc-14 + FC: gfortran-14 + CXX: g++-14 # Split into a steup step, and a WW3 build step which @@ -45,7 +45,8 @@ jobs: run: | # Install NetCDF, ESMF, g2, etc using Spack sudo apt install cmake - git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git + #git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git + git clone -c feature.manyFiles=true --depth=2 --branch=spack-stack-1.9.3 https://github.com/JCSDA/spack.git source spack/share/spack/setup-env.sh spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml spack env activate ww3-gnu diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml deleted file mode 100644 index bf18a8cead..0000000000 --- a/.github/workflows/intel.yml +++ /dev/null @@ -1,137 +0,0 @@ -# This is a GitHub actions workflow for WW3. -# -# This workflow builds with the Intel compilers. -# -# Matt Masarik, Alex Richert, Ed Hartnett -name: Intel Linux Build -on: [push, pull_request, workflow_dispatch] - -# Cancel in-progress workflows when pushing to a branch -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran -env: - cache_key: intel10-3 - CC: icc - FC: ifort - CXX: icpc - I_MPI_CC: icc - I_MPI_F90: ifort - -# Split into a dependency build step, and a WW3 build step which -# builds multiple switches in a matrix. The setup is run once and -# the environment is cached so each build of WW3 can share the dependencies. - -jobs: - setup: - runs-on: ubuntu-22.04 - - steps: - - - name: checkout-ww3 - if: steps.cache-env.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - path: ww3 - - # Cache spack, OASIS, and compiler - # No way to flush Action cache, so key may have # appended - - name: cache-env - id: cache-env - uses: actions/cache@v3 - with: - path: | - spack - ~/.spack - work_oasis3-mct - /opt/intel - key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_intel.yaml') }} - - - name: install-intel-compilers - if: steps.cache-env.outputs.cache-hit != 'true' - run: | - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - sudo apt-get update - sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-compiler-fortran-2023.2.1 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.1 intel-oneapi-openmp - - # Build WW3 spack environment - - name: install-dependencies-with-spack - if: steps.cache-env.outputs.cache-hit != 'true' - run: | - sudo mv /usr/local /usr/local_mv - # Install NetCDF, ESMF, g2, etc using Spack - . /opt/intel/oneapi/setvars.sh - git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git - source spack/share/spack/setup-env.sh - ln -s $(realpath $(which gcc)) spack/lib/spack/env/intel/gcc # spack/make bug in ESMF - spack env create ww3-intel ww3/model/ci/spack_intel.yaml - spack env activate ww3-intel - spack compiler find - sudo apt install cmake - spack external find - spack config add "packages:mpi:require:'intel-oneapi-mpi'" - spack config add "packages:all:require:['%intel']" - spack concretize - spack install --dirty -v --fail-fast - spack clean --all - - - name: build-oasis - if: steps.cache-env.outputs.cache-hit != 'true' - run: | - . /opt/intel/oneapi/setvars.sh - source spack/share/spack/setup-env.sh - spack env activate ww3-intel - export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model - export OASIS_INPUT_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/oasis3-mct - export OASIS_WORK_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct - cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir - cmake . - make - cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct ${GITHUB_WORKSPACE} - - build: - needs: setup - strategy: - matrix: - switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] - runs-on: ubuntu-latest - - steps: - - name: checkout-ww3 - uses: actions/checkout@v3 - with: - path: ww3 - - - name: cache-env - id: cache-env - uses: actions/cache@v3 - with: - path: | - spack - ~/.spack - work_oasis3-mct - /opt/intel - key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_intel.yaml') }} - - - name: build-ww3 - run: | - sudo mv /usr/local /usr/local_mv - sudo apt install cmake - . /opt/intel/oneapi/setvars.sh - source spack/share/spack/setup-env.sh - spack env activate ww3-intel - cd ww3 - export CC=mpiicc - export FC=mpiifort - export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct - mkdir build && cd build - if [[ ${{ matrix.switch }} == "MULTI_ESMF" ]]; then - cmake .. -DMULTI_ESMF=ON -DSWITCH=multi_esmf - else - cmake .. -DSWITCH=${{ matrix.switch }} - fi - make -j2 VERBOSE=1 diff --git a/.github/workflows/intel.yml.tempdisable b/.github/workflows/intel.yml.tempdisable index f5de65dcd3..bf18a8cead 100644 --- a/.github/workflows/intel.yml.tempdisable +++ b/.github/workflows/intel.yml.tempdisable @@ -26,7 +26,7 @@ env: jobs: setup: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: diff --git a/.github/workflows/regtest_gnu.yml b/.github/workflows/regtest_gnu.yml deleted file mode 100644 index 642a1cb2d0..0000000000 --- a/.github/workflows/regtest_gnu.yml +++ /dev/null @@ -1,130 +0,0 @@ -name: regtest_gnu -on: [push, pull_request, workflow_dispatch] - -# Cancel in-progress workflows when pushing to a branch -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - cache_key: gnu11-1 - CC: gcc-14 - FC: gfortran-14 - CXX: g++-14 - - -# Split into a steup step, and a WW3 build step which -# builds multiple switches in a matrix. The setup is run once and -# the environment is cached so each build of WW3 can share the dependencies. - -jobs: - setup: - runs-on: ubuntu-latest - - steps: - - name: checkout-ww3 - if: steps.cache-env.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - path: ww3 - # Cache spack, OASIS, and compiler - # No way to flush Action cache, so key may have # appended - - name: cache-env - id: cache-env - uses: actions/cache@v3 - with: - path: | - spack - ~/.spack - work_oasis3-mct - key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} - - # Build WW3 spack environment - - name: install-dependencies-with-spack - if: steps.cache-env.outputs.cache-hit != 'true' - run: | - # Install NetCDF, ESMF, g2, etc using Spack - sudo apt install cmake - git clone -c feature.manyFiles=true --depth=2 --branch=spack-stack-1.9.3 https://github.com/JCSDA/spack.git - source spack/share/spack/setup-env.sh - spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml - spack env activate ww3-gnu - spack compiler find - spack external find cmake - spack add mpich@3.4.2 - spack concretize - spack install --dirty -v - - - name: build-oasis - if: steps.cache-env.outputs.cache-hit != 'true' - run: | - source spack/share/spack/setup-env.sh - spack env activate ww3-gnu - export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model - export OASIS_INPUT_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/oasis3-mct - export OASIS_WORK_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct - cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir - cmake . - make VERBOSE=1 - cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct ${GITHUB_WORKSPACE} - - regtest_gnu: - needs: setup - runs-on: ubuntu-latest - - steps: - - name: install-dependencies - run: | - sudo apt-get update - sudo apt-get install doxygen gcovr valgrind - - - name: checkout-ww3 - uses: actions/checkout@v3 - with: - path: ww3 - - - name: cache-env - id: cache-env - uses: actions/cache@v3 - with: - path: | - spack - ~/.spack - work_oasis3-mct - key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} - - - name: build-ww3 - run: | - source spack/share/spack/setup-env.sh - spack env activate ww3-gnu - set -x - cd ww3 - export CC=mpicc - export FC=mpif90 - export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct - # mkdir build && cd build - export LD_LIBRARY_PATH="/home/runner/work/WW3/WW3/spack/var/spack/environments/ww3-gnu/.spack-env/view/:$LD_LIBRARY_PATH" - # cmake -DSWITCH=${GITHUB_WORKSPACE}/ww3/regtests/unittests/data/switch.io -DCMAKE_BUILD_TYPE=Debug .. - # make -j2 VERBOSE=1 - cd ${GITHUB_WORKSPACE}/ww3 - ls -l - ${GITHUB_WORKSPACE}/ww3/model/bin/ww3_from_ftp.sh -k - cd regtests - ./bin/run_cmake_test -o all -S -T -s PR1_MPI -w work_PR1_MPI -f -p mpirun -n 24 ../model ww3_tp2.5 - cd ww3_tp2.5 - ls -l - cd work_PR1_MPI - pwd - ls -l - # ncdump -h out_pnt.ww3.nc > ncdump_out.txt - # cat ncdump_out.txt - # pwd - # cat ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt - # cmp ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt ncdump_out.txt - - - name: cache-data - id: cache-data - uses: actions/cache@v3 - with: - path: ww3/ww3_from_ftp.v7.14.1.tar.gz - key: ww3_from_ftp.v7.14.1 diff --git a/.github/workflows/regtest_gnu.yml.tempdisable b/.github/workflows/regtest_gnu.yml.tempdisable index d5b71673c3..642a1cb2d0 100644 --- a/.github/workflows/regtest_gnu.yml.tempdisable +++ b/.github/workflows/regtest_gnu.yml.tempdisable @@ -8,9 +8,9 @@ concurrency: env: cache_key: gnu11-1 - CC: gcc-10 - FC: gfortran-10 - CXX: g++-10 + CC: gcc-14 + FC: gfortran-14 + CXX: g++-14 # Split into a steup step, and a WW3 build step which @@ -45,7 +45,7 @@ jobs: run: | # Install NetCDF, ESMF, g2, etc using Spack sudo apt install cmake - git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git + git clone -c feature.manyFiles=true --depth=2 --branch=spack-stack-1.9.3 https://github.com/JCSDA/spack.git source spack/share/spack/setup-env.sh spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml spack env activate ww3-gnu From 7764cb473cd617d8ddd60ea6ee77a52c5bce7651 Mon Sep 17 00:00:00 2001 From: Coat Date: Mon, 27 Oct 2025 14:37:34 +0100 Subject: [PATCH 16/18] rename workflow files --- .github/workflows/{gnu.yml.tempdisable => gnu.yml} | 0 .github/workflows/{intel.yml.tempdisable => intel.yml} | 0 .../workflows/{regtest_gnu.yml.tempdisable => regtest_gnu.yml} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{gnu.yml.tempdisable => gnu.yml} (100%) rename .github/workflows/{intel.yml.tempdisable => intel.yml} (100%) rename .github/workflows/{regtest_gnu.yml.tempdisable => regtest_gnu.yml} (100%) diff --git a/.github/workflows/gnu.yml.tempdisable b/.github/workflows/gnu.yml similarity index 100% rename from .github/workflows/gnu.yml.tempdisable rename to .github/workflows/gnu.yml diff --git a/.github/workflows/intel.yml.tempdisable b/.github/workflows/intel.yml similarity index 100% rename from .github/workflows/intel.yml.tempdisable rename to .github/workflows/intel.yml diff --git a/.github/workflows/regtest_gnu.yml.tempdisable b/.github/workflows/regtest_gnu.yml similarity index 100% rename from .github/workflows/regtest_gnu.yml.tempdisable rename to .github/workflows/regtest_gnu.yml From 5b4eb3fc336bc843ba07ec7f53afa632ad63eec2 Mon Sep 17 00:00:00 2001 From: Coat Date: Sun, 2 Nov 2025 13:29:10 +0100 Subject: [PATCH 17/18] fix trace for switch NL1 --- model/src/w3iogrmd.F90 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/model/src/w3iogrmd.F90 b/model/src/w3iogrmd.F90 index b3ee57cd6c..61e14b3711 100644 --- a/model/src/w3iogrmd.F90 +++ b/model/src/w3iogrmd.F90 @@ -1646,10 +1646,13 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & GQNQ_OM2, GQTHRSAT, GQTHRCOU, GQAMP IF (IERR.NE.0) CALL EXTIOF(NDSE,IERR,'W3IOGR','mod_def.'//FILEXT(:IEXT),51) END IF -! IF ( FLTEST ) WRITE (NDST,9051) SNLC1, LAM, & -! KDCON, KDMN, SNLS1, SNLS2, SNLS3, & -! IQTPE, NLTAIL, GQNF1, GQNT1, GQNQ_OM2, & -! GQTHRSAT, GQTHRCOU, GQAMP + IF ( FLTEST ) WRITE (NDST,*) & + 'SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3, & + IQTPE, NLTAIL, GQNF1, GQNT1, & + GQNQ_OM2, GQTHRSAT, GQTHRCOU, GQAMP:', & + SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3, & + IQTPE, NLTAIL, GQNF1, GQNT1, & + GQNQ_OM2, GQTHRSAT, GQTHRCOU, GQAMP #endif ! #ifdef W3_NL2 From 5a2aeab4d347094c300d5e698fb905677fb8b5a0 Mon Sep 17 00:00:00 2001 From: Coat Date: Wed, 5 Nov 2025 17:59:10 +0100 Subject: [PATCH 18/18] remove not needed EXTCDE --- model/src/w3strkmd.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/w3strkmd.F90 b/model/src/w3strkmd.F90 index 0ee1159f0b..97796dfda1 100644 --- a/model/src/w3strkmd.F90 +++ b/model/src/w3strkmd.F90 @@ -315,7 +315,7 @@ SUBROUTINE waveTracking_NWS_V2 (intype ,tmax , & !/ reserved. WAVEWATCH III is a trademark of the NWS. !/ No unauthorized use without permission. !/ - USE W3SERVMD, ONLY: EXTIOF, EXTCDE + USE W3SERVMD, ONLY: EXTIOF #ifdef W3_MPI use mpi_f08 #endif