Skip to content

Commit

Permalink
Update ci.yml with ecosys enabled (#284)
Browse files Browse the repository at this point in the history
* Include ecosys in build command with intel cmpiler

* Restore restart_trcrd.F90 from release-1.3

Building BLOM stand-alone without iHAMOCC is does not allow any
references to hamocc functions. For now, it's more convenient to restore
'ifdef HAMOCC' when used in BLOM.

* Disable ecosys with gnu compilers, leave placeholder

Enabling ecosys for the gnu compiler build returns lots of strange error of the type:
```Error: Function ‘glb_inventory’ at (1) has no IMPLICIT type```
It seems to be a problem for the compiler when variables are imported from modules.
  • Loading branch information
TomasTorsvik authored Oct 17, 2023
1 parent 264762e commit 17b7bb6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ jobs:
os: [ubuntu-latest, macos-latest]
mpi: [true, false]
openmp: ['enabled', 'disabled']
ecosys: [false] # ecosys==true fails with gcc, disable for now but leave placeholder
exclude:
# Do not build on macOS with MPI as that is having some dependency issues
- os: macos-latest
mpi: true
# Run test (fuk95 executed with mpi=false) fails with ecosys
- ecosys: true
mpi: false
steps:
- name: Install dependencies - Ubuntu
run: |
Expand Down Expand Up @@ -47,7 +51,7 @@ jobs:
CC: gcc-12
FC: gfortran-12
run: |
meson setup builddir -Dmpi=${{ matrix.mpi }} -Dopenmp=${{ matrix.openmp }} --buildtype=debugoptimized
meson setup builddir -Dmpi=${{ matrix.mpi }} -Dopenmp=${{ matrix.openmp }} -Decosys=${{ matrix.ecosys }} --buildtype=debugoptimized
meson compile -C builddir
- name: Test code
Expand All @@ -72,6 +76,10 @@ jobs:
mpi: [true, false]
openmp: ['enabled', 'disabled']
ecosys: [true, false]
exclude:
# Run test (fuk95 executed with mpi=false) fails with ecosys
- ecosys: true
mpi: false
# Tell Meson to use Intel compilers
env:
CC: icc
Expand Down Expand Up @@ -141,7 +149,7 @@ jobs:
- name: Build with Intel compilers
run: |
source /opt/intel/oneapi/setvars.sh
meson setup builddir -Dmpi=${{ matrix.mpi }} -Dopenmp=${{ matrix.openmp }} --buildtype=debugoptimized
meson setup builddir -Dmpi=${{ matrix.mpi }} -Dopenmp=${{ matrix.openmp }} -Decosys=${{ matrix.ecosys }} --buildtype=debugoptimized
meson compile -C builddir
- name: Test code
Expand Down
50 changes: 23 additions & 27 deletions trc/restart_trcrd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ subroutine restart_trcrd(rstfnm_ocn)

logical :: error
character(len=256) :: rstfnm_ocntrc
! HAMOCC
character(len=256) :: rstfnm_hamocc
#ifdef HAMOCC
logical :: use_hamocc = .true.
#else
logical :: use_hamocc = .false.
character(len=256) :: rstfnm_hamocc
#endif
!
! --- ------------------------------------------------------------------
Expand All @@ -52,36 +48,36 @@ subroutine restart_trcrd(rstfnm_ocn)
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
if (use_HAMOCC) then
call restart_getfile(rstfnm_ocn, 'rbgc', rstfnm_hamocc, error)
if (error) then
write(lp,*) 'restart_trcrd: could not generate rstfnm_hamocc file!'
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
end if
#ifdef HAMOCC
call restart_getfile(rstfnm_ocn, 'rbgc', rstfnm_hamocc, error)
if (error) then
write(lp,*) 'restart_trcrd: could not generate rstfnm_hamocc file!'
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
#endif
else
call restart_getfile(rstfnm_ocn, 'resttrc', rstfnm_ocntrc, error)
if (error) then
write(lp,*) 'restart_trcrd: could not generate rstfnm_ocntrc file!'
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
if (use_HAMOCC) then
call restart_getfile(rstfnm_ocn, 'restbgc', rstfnm_hamocc, error)
if (error) then
write(lp,*) 'restart_trcrd: could not generate rstfnm_hamocc file!'
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
end if
#ifdef HAMOCC
call restart_getfile(rstfnm_ocn, 'restbgc', rstfnm_hamocc, error)
if (error) then
write(lp,*) 'restart_trcrd: could not generate rstfnm_hamocc file!'
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
#endif
endif
endif

call xcbcst(rstfnm_ocntrc)
if (use_HAMOCC) then
call xcbcst(rstfnm_hamocc)
end if
#ifdef HAMOCC
call xcbcst(rstfnm_hamocc)
#endif

!
! --- ------------------------------------------------------------------
Expand All @@ -90,9 +86,9 @@ subroutine restart_trcrd(rstfnm_ocn)
!
call restart_ocntrcrd(rstfnm_ocntrc)

if (use_HAMOCC) then
call hamocc_init(1,rstfnm_hamocc)
end if
#ifdef HAMOCC
call hamocc_init(1,rstfnm_hamocc)
#endif

return
end subroutine restart_trcrd

0 comments on commit 17b7bb6

Please sign in to comment.