Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e2af11c
Move ifs_blocking to ifs directory and ensure separate module directo…
reuterbal Aug 26, 2025
d00ede8
Add ZRGP indexing logic from IFS in radintg_zrgp_mod
reuterbal Aug 27, 2025
7b0de45
Add radiation_scheme_layer and field_api-based driver
reuterbal Aug 27, 2025
6cc1f18
Add field_api to Github Actions workflow
reuterbal Aug 27, 2025
a24bcc4
Chunking of OpenMP private clause to limit line length
reuterbal Aug 27, 2025
4e92f4c
radiation_setup: fix aerosol setup
reuterbal Aug 28, 2025
a79c1a8
Apply unallocated array fixes to field_api driver
reuterbal Sep 5, 2025
3bca074
Force smaller but odd block size in tests
reuterbal Sep 5, 2025
455ded7
radiation_scheme_layer_mod: remove duplicate argument
reuterbal Sep 5, 2025
61ecfc0
Use firstprivate in radiation_scheme_layer_mod for GFortran
reuterbal Dec 8, 2025
78ecffd
Apply renaming of yomlun in radintg_zrgp_mod
reuterbal Dec 9, 2025
094fb32
GH Actions: Update gcc to 13 and nvhpc to 25.9
reuterbal Dec 8, 2025
20a777a
FIXME: Disable field deletion on GNU to avoid double free errors
reuterbal Aug 28, 2025
4b1c6a7
Fix Makefile dependencies for radintg_zrgp_mod and ifs_blocking
reuterbal Dec 9, 2025
357edf0
Update Makefile dependencies
reuterbal Dec 9, 2025
005a390
Ignore build directories
reuterbal Dec 9, 2025
bfde15f
Introduce LACC switch to radiation_scheme
reuterbal Dec 9, 2025
7706aee
Firstprivate fix for GFortran
reuterbal Dec 9, 2025
5207f51
Add OpenACC variant support for field_api
reuterbal Dec 9, 2025
832b15c
Add gfortran build with Make to Github Actions
reuterbal Oct 28, 2025
09ce848
Enable build-hpc for master-acc feature branches
reuterbal Dec 9, 2025
b1a6bff
Ensure tstart is initialized
reuterbal Dec 9, 2025
0800014
Rename rrtm_utils to compute_laytrop_min_max and add to Makefile
reuterbal Dec 10, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/build-hpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
branches:
- master-acc
- feature/master-acc-build-hpc
- feature/master-acc*
tags-ignore:
- '**'

Expand Down
61 changes: 44 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ jobs:
matrix:
build_type: [Release,Bit,Debug]
name:
- linux gnu-12
- linux nvhpc-24.3
- linux gnu-13
- linux nvhpc-25.9
- linux intel-classic
- linux intel-llvm

include:

- name: linux gnu-12
os: ubuntu-22.04
compiler: gnu-12
compiler_cc: gcc-12
compiler_cxx: g++-12
compiler_fc: gfortran-12
- name: linux gnu-13
os: ubuntu-24.04
compiler: gnu-13
compiler_cc: gcc-13
compiler_cxx: g++-13
compiler_fc: gfortran-13
caching: true

- name: linux nvhpc-24.3
os: ubuntu-22.04
compiler: nvhpc-24.3
- name: linux nvhpc-25.9
os: ubuntu-24.04
compiler: nvhpc
compiler_cc: nvc
compiler_cxx: nvc++
compiler_fc: nvfortran
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
if: contains( matrix.compiler, 'nvhpc' )
shell: bash -eux {0}
run: |
${ECRAD_TOOLS}/install-nvhpc.sh --prefix /opt/nvhpc --version 24.3
${ECRAD_TOOLS}/install-nvhpc.sh --prefix /opt/nvhpc --version 25.9
source /opt/nvhpc/env.sh
echo "${NVHPC_DIR}/compilers/bin" >> $GITHUB_PATH
echo "NVHPC_ROOT=${NVHPC_DIR}" >> $GITHUB_ENV
Expand Down Expand Up @@ -180,14 +180,41 @@ jobs:
dependencies: |
ecmwf/ecbuild
ecmwf-ifs/fiat
ecmwf-ifs/field_api@refs/heads/main
dependency_branch: develop
dependency_cmake_options: |
ecmwf-ifs/fiat: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF"
ecmwf-ifs/field_api: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF"
cmake_options: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_options }} -DENABLE_SINGLE_PRECISION=ON -DENABLE_BITIDENTITY_TESTING=ON -DENABLE_ACC=OFF"
ctest_options: "--output-on-failure ${{ matrix.ctest_options }}"

# - name: Codecov Upload
# if: steps.build-test.outputs.coverage_file
# uses: codecov/codecov-action@v2
# with:
# files: ${{ steps.build-test.outputs.coverage_file }}
make:
name: Makefile build

strategy:
fail-fast: false # false: try to complete all jobs

matrix:
name:
- linux gnu

include:

- name: linux gnu
os: ubuntu-24.04
profile: gfortran

runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libnetcdff-dev nco

- name: Build & Test
run: |
make PROFILE=${{ matrix.profile }} -j
make test PROFILE=${{ matrix.profile }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ config_*.nam
/mod
/practical/data
/practical/ecrad
/build
/build*
*.mod
/bin/ecrad
/bin/ecrad_ifs
Expand Down
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ if( HAVE_FIAT AND fiat_HAVE_MPI )
list( APPEND ECRAD_COMPILE_DEFINITIONS EASY_NETCDF_READ_MPI )
endif()

ecbuild_add_option(
FEATURE FIELD_API
DEFAULT ON
DESCRIPTION "Enable FIELD_API-based driver variant"
REQUIRED_PACKAGES "field_api"
)

find_program(FYPP fypp)
ecbuild_add_option(
FEATURE FYPP
DEFAULT OFF
DESCRIPTION "Use FYPP to re-generate Fortran code for FIELD_API-based driver variant"
CONDITION NOT FYPP-NOTFOUND
)

ecbuild_add_option(
FEATURE OMP
DEFAULT ON
Expand Down
51 changes: 35 additions & 16 deletions driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ ecbuild_add_library(
PUBLIC_DEFINITIONS
$<$<NOT:${HAVE_OMP}>:NO_OPENMP>
${GPU_OFFLOAD}GPU
PUBLIC_INCLUDES
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/module_driver_lib>"
PUBLIC_LIBS
ecrad.${PREC}
ecrad_base.${PREC}
$<${HAVE_OMP}:OpenMP::OpenMP_Fortran>
)
set_target_properties( driver_lib.${PREC}
PROPERTIES
Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/module_driver_lib"
)

ecbuild_add_executable(
TARGET ecrad_${PREC}
Expand All @@ -48,7 +54,6 @@ ecbuild_add_executable(
TARGET ecrad_ifs_blocked_${PREC}
SOURCES
ecrad_ifs_driver_blocked.F90
ifs_blocking.F90
LIBS
ifs.${PREC}
driver_lib.${PREC}
Expand Down Expand Up @@ -81,24 +86,38 @@ if( CMAKE_BUILD_TYPE MATCHES "Debug" )
endif()
endif()

if( HAVE_FIELD_API )
ecbuild_add_executable(
TARGET ecrad_ifs_field_api_${PREC}
SOURCES
ecrad_ifs_driver_field_api.F90
LIBS
ifs_field_api.${PREC}
driver_lib.${PREC}
LINKER_LANGUAGE Fortran
)
endif()

# Create a symlink for each driver without the precision suffix.
# The default is to link to the double precision version if it is built,
# and single precision otherwise.
if ( "${PREC}" STREQUAL "dp" OR NOT HAVE_DOUBLE_PRECISION )
foreach( tgt ecrad ecrad_ifs ecrad_ifs_blocked )
add_custom_command(
TARGET ${tgt}_${PREC}
POST_BUILD
COMMAND
"${CMAKE_COMMAND}" -E create_symlink ${tgt}_${PREC} ${tgt}
BYPRODUCTS ${tgt}
WORKING_DIRECTORY
"${CMAKE_BINARY_DIR}/bin"
COMMENT "Creating symbolic link from ${tgt} to ${tgt}_${PREC}"
)
install(
FILES ${CMAKE_BINARY_DIR}/bin/${tgt}
DESTINATION bin
)
foreach( tgt ecrad ecrad_ifs ecrad_ifs_blocked ecrad_ifs_field_api )
if( TARGET ${tgt}_${PREC} )
add_custom_command(
TARGET ${tgt}_${PREC}
POST_BUILD
COMMAND
"${CMAKE_COMMAND}" -E create_symlink ${tgt}_${PREC} ${tgt}
BYPRODUCTS ${tgt}
WORKING_DIRECTORY
"${CMAKE_BINARY_DIR}/bin"
COMMENT "Creating symbolic link from ${tgt} to ${tgt}_${PREC}"
)
install(
FILES ${CMAKE_BINARY_DIR}/bin/${tgt}
DESTINATION bin
)
endif()
endforeach()
endif()
2 changes: 1 addition & 1 deletion driver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $(IFS_EXECUTABLE): $(OBJECTS) ../lib/*.a ecrad_ifs_driver.o
$(FC) $(FCFLAGS) ecrad_ifs_driver.o $(OBJECTS) -lifs $(LIBS) -o $(IFS_EXECUTABLE)

$(IFS_BLOCKED_EXECUTABLE): $(OBJECTS) ../lib/*.a ecrad_ifs_driver_blocked.o
$(FC) $(FCFLAGS) ifs_blocking.o ecrad_ifs_driver_blocked.o $(OBJECTS) -lifs $(LIBS) -o $(IFS_BLOCKED_EXECUTABLE)
$(FC) $(FCFLAGS) ecrad_ifs_driver_blocked.o $(OBJECTS) -lifs $(LIBS) -o $(IFS_BLOCKED_EXECUTABLE)

test_%: test_%.F90 ../lib/*.a
$(FC) $(FCFLAGS) $< $(LIBS) -o $@
Expand Down
3 changes: 1 addition & 2 deletions driver/Makefile_deps
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ecrad_driver.o: ecrad_driver_config.o ecrad_driver_read_input.o
ecrad_driver_read_input.o: ecrad_driver_config.o
ecrad_ifs_driver_blocked.o: ecrad_driver_config.o ecrad_driver_read_input.o ifs_blocking.o
ecrad_ifs_driver_blocked.o: ecrad_driver_config.o ecrad_driver_read_input.o
ecrad_ifs_driver.o: ecrad_driver_config.o ecrad_driver_read_input.o
ifs_blocking.o: ecrad_driver_config.o
4 changes: 2 additions & 2 deletions driver/ecrad_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ program ecrad_driver
use ecrad_driver_config, only : driver_config_type
use ecrad_driver_read_input, only : read_input
use easy_netcdf
use print_matrix_mod, only : print_matrix
! use print_matrix_mod, only : print_matrix

implicit none

Expand Down Expand Up @@ -96,7 +96,7 @@ program ecrad_driver
integer, external :: omp_get_thread_num
real(kind=jprd), external :: omp_get_wtime
! Start/stop time in seconds
real(kind=jprd) :: tstart, tstop, t0
real(kind=jprd) :: tstart=0.0, tstop, t0
#endif

! For demonstration of get_sw_weights later on
Expand Down
6 changes: 5 additions & 1 deletion driver/ecrad_ifs_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ program ecrad_ifs_driver

call yradiation%rad_config%read(file_name=file_name)

#ifdef _OPENACC
yradiation%yrerad%lecrad_on_gpu = .true.
#endif

! Setup aerosols
if (yradiation%rad_config%use_aerosols) then
yradiation%yrerad%naermacc = 1 ! MACC-derived aerosol climatology on a NMCLAT x NMCLON grid
Expand Down Expand Up @@ -482,7 +486,7 @@ program ecrad_ifs_driver
& pcloud_overlap=cloud%overlap_param, &
& iseed=single_level%iseed &
#endif
& )
& ,lacc=yradiation%yrerad%lecrad_on_gpu)
end do
#ifndef _OPENACC
!$OMP END PARALLEL DO
Expand Down
Loading
Loading