diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml new file mode 100644 index 00000000..7c33b05b --- /dev/null +++ b/.github/workflows/mac.yml @@ -0,0 +1,39 @@ +name: Mac + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + gnu: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + gcc_version: [12, 13, 14] + build_type: [Debug, Release] + env: + FC: gfortran-${{ matrix.gcc_version }} + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: brew install netcdf netcdf-fortran + + - name: Run Cmake + run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} + + - name: Build + run: cmake --build build --verbose + + - name: Run tests + run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose + working-directory: build diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 00000000..53cf6f79 --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,42 @@ +name: Ubuntu + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + gnu: + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + gcc_version: [12, 13, 14] + build_type: [Debug, Release] + env: + FC: gfortran-${{ matrix.gcc_version }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libnetcdf-dev netcdf-bin libnetcdff-dev + + - name: Run Cmake + run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} + + - name: Build + run: cmake --build build --verbose + + - name: Run tests + run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose + working-directory: build \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..1fc812d0 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,55 @@ +name: Windows + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + gnu: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + build_type: [Debug, Release] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + update: true + install: >- + base-devel + mingw-w64-x86_64-toolchain + mingw-w64-x86_64-gcc + mingw-w64-x86_64-gcc-fortran + mingw-w64-x86_64-cmake + mingw-w64-x86_64-netcdf + mingw-w64-x86_64-netcdf-fortran + msystem: MINGW64 + + - name: Add MSYS2 mingw64 to PATH + shell: msys2 {0} + run: echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH + + - name: Configure with CMake + shell: msys2 {0} + run: cmake -G "MinGW Makefiles" -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} + + - name: Build the project + shell: msys2 {0} + run: cmake --build build --verbose + + - name: Run tests + shell: msys2 {0} + run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose + working-directory: build \ No newline at end of file diff --git a/.zenodo.json b/.zenodo.json new file mode 100644 index 00000000..3c144e8a --- /dev/null +++ b/.zenodo.json @@ -0,0 +1,22 @@ +{ + "access_right": "open", + "creators": [ + { + "name": "The International GEOS-Chem User Community" + } + ], + "description": "The Harmonized Emissions Component (HEMCO)", + "keywords": [ + "atmospheric-chemistry", + "atmospheric-composition", + "atmospheric-modeling", + "aws", + "climate-modeling", + "cloud-computing", + "geos-chem", + "atmospheric-computing", + "scientific-computing" + ], + "license": "mit-license", + "upload_type": "software" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 02cae785..ec418d6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.10.2] - 2025-03-04 +### Added +- Added `.zenodo.json` for auto-DOI generation upon version releases +- Added GitHub Actions tests to build and test HEMCO on Windows, macOS, and Ubuntu automatically with each submitted PR + +### Changed +- Bumped `jinja2` to version 3.1.5 in `docs/requirements.txt` to fix a security issue +- Turned off map_a2a pole averaging when using CESM to avoid core-dependency in 2D emissions +- Updated ReadTheDocs documentation for AWS CLI + +### Fixed +- Updated several prints to limit to root thread to reduce log redundancy when using MPI + ## [3.10.1] - 2025-01-10 ### Added - Added optional LUN argument to ConfigInit to allow external models to pass LUN of existing log file diff --git a/CMakeLists.txt b/CMakeLists.txt index 98a7e557..15bfde48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # HEMCO/CMakeLists.txt cmake_minimum_required(VERSION 3.5) -project(HEMCO VERSION 3.10.1 LANGUAGES Fortran) +project(HEMCO VERSION 3.10.2 LANGUAGES Fortran) # Reminder: Make sure to also update version in src/Core/hco_error_mod.F90 #----------------------------------------------------------------------------- @@ -62,13 +62,22 @@ set(HEMCO_Fortran_FLAGS_DEBUG_Intel -g -O0 "SHELL:-check arg_temp_created" "SHELL:-debug all" -fpe0 -ftrapuv -check,bounds -DDEBUG CACHE STRING "HEMCO compiler flags for build type debug with Intel compilers" ) - -set(HEMCO_Fortran_FLAGS_GNU - -cpp -w -std=legacy -fautomatic -fno-align-commons -fconvert=big-endian - -fno-range-check -mcmodel=medium -fbacktrace -g -DLINUX_GFORTRAN - -ffree-line-length-none - CACHE STRING "HEMCO compiler flags for all build types with GNU compilers" -) +if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") + # arm based processors only support mcmodels of large small tiny + set(HEMCO_Fortran_FLAGS_GNU + -cpp -w -std=legacy -fautomatic -fno-align-commons -fconvert=big-endian + -fno-range-check -mcmodel=small -fbacktrace -g -DLINUX_GFORTRAN + -ffree-line-length-none + CACHE STRING "HEMCO compiler flags for all build types with GNU compilers" + ) +else() + set(HEMCO_Fortran_FLAGS_GNU + -cpp -w -std=legacy -fautomatic -fno-align-commons -fconvert=big-endian + -fno-range-check -mcmodel=medium -fbacktrace -g -DLINUX_GFORTRAN + -ffree-line-length-none + CACHE STRING "HEMCO compiler flags for all build types with GNU compilers" + ) +endif() set(HEMCO_Fortran_FLAGS_RELEASE_GNU -O3 -funroll-loops CACHE STRING "HEMCO compiler flags for build type release with GNU compilers" diff --git a/README.md b/README.md index 7e83b751..d2609b02 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@

+[![Ubuntu](https://github.com/geoschem/hemco/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/geoschem/hemco/actions/workflows/ubuntu.yml) +[![Mac](https://github.com/geoschem/hemco/actions/workflows/mac.yml/badge.svg)](https://github.com/geoschem/hemco/actions/workflows/mac.yml) +[![Windows](https://github.com/geoschem/hemco/actions/workflows/windows.yml/badge.svg)](https://github.com/geoschem/hemco/actions/workflows/windows.yml) ## Description diff --git a/docs/requirements.txt b/docs/requirements.txt index 71e269de..c0752da3 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -12,4 +12,4 @@ sphinxcontrib-bibtex==2.6.2 sphinx-autobuild==2021.3.14 recommonmark==0.7.1 docutils==0.20.1 -jinja2==3.1.4 +jinja2==3.1.5 diff --git a/docs/source/conf.py b/docs/source/conf.py index f7be06e5..1b99e009 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,7 +23,7 @@ author = 'GEOS-Chem Support Team' # The full version, including alpha/beta/rc tags -release = '3.10.1' +release = '3.10.2' # -- General configuration --------------------------------------------------- diff --git a/docs/source/geos-chem-shared-docs b/docs/source/geos-chem-shared-docs index 18712bb6..c769e000 160000 --- a/docs/source/geos-chem-shared-docs +++ b/docs/source/geos-chem-shared-docs @@ -1 +1 @@ -Subproject commit 18712bb6a61caa921be73ee993996b35cfc8c0da +Subproject commit c769e0007cc02270016e68e738623ac97b1fbcb5 diff --git a/src/Core/hco_config_mod.F90 b/src/Core/hco_config_mod.F90 index 03606a34..1aa6fbc2 100644 --- a/src/Core/hco_config_mod.F90 +++ b/src/Core/hco_config_mod.F90 @@ -1512,7 +1512,7 @@ SUBROUTINE BracketCheck( HcoConfig, STAT, LINE, SKIP, RC ) ENDIF ! Verbose mode - IF ( HcoConfig%doVerbose ) THEN + IF ( HcoConfig%doVerbose .AND. HcoConfig%amIRoot ) THEN MSG = 'Opened shortcut bracket: '//TRIM(TmpBracket) CALL HCO_MSG( msg, LUN=HcoConfig%hcoLogLUN ) WRITE(MSG,*) ' - Skip content of this bracket: ', SKIP @@ -1541,7 +1541,7 @@ SUBROUTINE BracketCheck( HcoConfig, STAT, LINE, SKIP, RC ) NEST = NEST - 1 ! Verbose mode - IF ( HcoConfig%doVerbose ) THEN + IF ( HcoConfig%doVerbose .AND. HcoConfig%amIRoot ) THEN MSG = 'Closed shortcut bracket: '//TRIM(TmpBracket) CALL HCO_MSG( msg, LUN=HcoConfig%hcoLogLUN ) WRITE(MSG,*) ' - Skip following lines: ', SKIP @@ -2212,11 +2212,8 @@ SUBROUTINE ReadSettings( HcoConfig, IU_HCO, EOF, RC ) CALL HCO_MSG( msg, LUN=HcoConfig%hcoLogLUN ) ENDIF #else - ! Always write to atm.log in CESM. LogFile entry in HEMCO_Config.rc - ! is omitted in CESM HEMCO_Config.rc. If it is found it will be ignored. + ! Always write to atm.log in CESM LogFile = 'atm.log' - msg = 'WARNING: HEMCO config entry for LogFile is ignored in CESM' - CALL HCO_MSG( msg, LUN=HcoConfig%stdLogLUN) #endif ! Initialize (standard) HEMCO tokens diff --git a/src/Core/hco_error_mod.F90 b/src/Core/hco_error_mod.F90 index 24296cd5..87d0d3ee 100644 --- a/src/Core/hco_error_mod.F90 +++ b/src/Core/hco_error_mod.F90 @@ -131,7 +131,7 @@ MODULE HCO_Error_Mod #endif ! HEMCO version number. - CHARACTER(LEN=12), PARAMETER, PUBLIC :: HCO_VERSION = '3.10.1' + CHARACTER(LEN=12), PARAMETER, PUBLIC :: HCO_VERSION = '3.10.2' ! ! !REVISION HISTORY: diff --git a/src/Core/hco_readlist_mod.F90 b/src/Core/hco_readlist_mod.F90 index cee65c59..abcc1eab 100644 --- a/src/Core/hco_readlist_mod.F90 +++ b/src/Core/hco_readlist_mod.F90 @@ -802,7 +802,7 @@ SUBROUTINE ReadList_Print( HcoState, ReadLists ) ELSE WRITE(MSG,*) 'ReadList not defined yet!!' - CALL HCO_MSG( msg, SEP1='=', LUN=HcoState%Config%hcoLogLUN ) + IF ( HcoState%Config%amIRoot ) CALL HCO_MSG( msg, SEP1='=', LUN=HcoState%Config%hcoLogLUN ) ENDIF END SUBROUTINE ReadList_Print diff --git a/src/Shared/GeosUtil/hco_regrid_a2a_mod.F90 b/src/Shared/GeosUtil/hco_regrid_a2a_mod.F90 index 09e2b1ee..09e9e659 100644 --- a/src/Shared/GeosUtil/hco_regrid_a2a_mod.F90 +++ b/src/Shared/GeosUtil/hco_regrid_a2a_mod.F90 @@ -776,6 +776,7 @@ SUBROUTINE ymap_r8r8(im, jm, sin1, q1, jn, sin2, q2, ig, iv, missval ) 1000 continue !$OMP END PARALLEL DO +#ifndef MODEL_CESM !=================================================================== ! Final processing for poles !=================================================================== @@ -816,6 +817,7 @@ SUBROUTINE ymap_r8r8(im, jm, sin1, q1, jn, sin2, q2, ig, iv, missval ) endif endif +#endif END SUBROUTINE ymap_r8r8 !EOC @@ -973,6 +975,7 @@ SUBROUTINE ymap_r4r8(im, jm, sin1, q1, jn, sin2, q2, ig, iv, missval) 1000 continue !$OMP END PARALLEL DO +#ifndef MODEL_CESM !=================================================================== ! Final processing for poles !=================================================================== @@ -1013,6 +1016,7 @@ SUBROUTINE ymap_r4r8(im, jm, sin1, q1, jn, sin2, q2, ig, iv, missval) endif endif +#endif END SUBROUTINE ymap_r4r8 !EOC @@ -1171,6 +1175,7 @@ SUBROUTINE ymap_r8r4(im, jm, sin1, q1, jn, sin2, q2, ig, iv, missval) 1000 continue !$OMP END PARALLEL DO +#ifndef MODEL_CESM !=================================================================== ! Final processing for poles !=================================================================== @@ -1211,6 +1216,7 @@ SUBROUTINE ymap_r8r4(im, jm, sin1, q1, jn, sin2, q2, ig, iv, missval) endif endif +#endif END SUBROUTINE ymap_r8r4 !EOC @@ -1369,6 +1375,7 @@ SUBROUTINE ymap_r4r4(im, jm, sin1, q1, jn, sin2, q2, ig, iv, missval) 1000 continue !$OMP END PARALLEL DO +#ifndef MODEL_CESM !=================================================================== ! Final processing for poles !=================================================================== @@ -1410,6 +1417,7 @@ SUBROUTINE ymap_r4r4(im, jm, sin1, q1, jn, sin2, q2, ig, iv, missval) enddo endif endif +#endif END SUBROUTINE ymap_r4r4 !EOC