Skip to content

Commit

Permalink
HEMCO 3.7.2 release
Browse files Browse the repository at this point in the history
This is the official release of HEMCO 3.7.2.  Updates include:

- Add utility scripts to change version numbers before release (PR #242)
- Rename HEMCO Config.rc.sample to HEMCO_Config.rc for standalone (PR #245)
- Increase string length for netCDF variable name (PR #248)
- Turn off emission extensions when EMISSIONS logical is false (PR #250)

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Dec 1, 2023
2 parents 00aaf65 + d25147b commit a5d5169
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 11 deletions.
108 changes: 108 additions & 0 deletions .release/changeVersionNumbers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/bin/bash

#EOC
#------------------------------------------------------------------------------
# Harmonized Emissions Component (HEMCO) !
#------------------------------------------------------------------------------
#BOP
#
# !MODULE: changeVersionNumbers.sh
#
# !DESCRIPTION: Bash script to change the version numbers in the appropriate
# files in the HEMCO directory structure. Run this before releasing
# a new HEMCO version.
#\\
#\\
# !CALLING SEQUENCE:
# $ ./changeVersionNumbers.sh X.Y.Z # X.Y.Z = HEMCO version number
#EOP
#------------------------------------------------------------------------------
#BOC

function replace() {

#========================================================================
# Function to replace text in a file via sed.
#
# 1st argument: Search pattern
# 2nd argument: Replacement text
# 3rd argument: File in which to search and replace
#========================================================================

sed -i -e "s/${1}/${2}/" "${3}"
}


function exitWithError() {

#========================================================================
# Display and error message and exit
#========================================================================

echo "Could not update version numbers in ${1}... Exiting!"
exit 1
}


function main() {

#========================================================================
# Replaces the version number in the files listed.
#
# 1st argument: New version number to use
#========================================================================

# New version number
version="${1}"

# Save this directory path and change to root directory
thisDir=$(pwd -P)
cd ..

#========================================================================
# Update version numbers in various files
#========================================================================

# Pattern to match: X.Y.Z
pattern='[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'

# List of files to replace
files=( \
"CMakeLists.txt" \
"docs/source/conf.py" \
"src/Core/hco_error_mod.F90"
)

# Replace version numbers in files
for file in ${files[@]}; do
replace "${pattern}" "${version}" "${file}"
[[ $? -ne 0 ]] && exitWithError "${file}"
echo "HEMCO version updated to ${version} in ${file}"
done

#========================================================================
# Update version number and date in CHANGELOG.md
#========================================================================

# Pattern to match: "[Unreleased] - TBD"
pattern='\[.*Unreleased.*\].*'
date=$(date -Idate)
replace "${pattern}" "\[${version}\] - ${date}" "CHANGELOG.md"

# Return to the starting directory
cd "${thisDir}"
}

# ---------------------------------------------------------------------------

# Expect 1 argument, or exit with error
if [[ $# -ne 1 ]]; then
echo "Usage: ./changeVersionNumbers.sh VERSION"
exit 1
fi

# Replace version numbers
main "${1}"

# Return status
exit $?
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ 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.7.2] - 2023-12-01
### Added
- Script `.release/changeVersionNumbers.sh` to change version numbers before a new HEMCO release

### Changed
- Increased netCDF variable string length from 50 to 100

### Fixed
- Rename `HEMCO_Config.rc.sample` to `HEMCO_Config.rc` in `createRunDir.sh` if sample is used.
- Added fix to turn off emissions extensions when `EMISSIONS` logical is false

## [3.7.1] - 2023-10-10
### Changed
- Updated version numbers to 3.7.1
Expand All @@ -30,7 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add GEOSIT as an allowable meteorology directory name in HEMCO_Config.rc
- Added `.readthedocs.yaml` file to configure ReadTheDocs builds

# Changed
### Changed
- `Verbose` is now a `true/false` variable in `run/HEMCO_sa_Config.rc` and `run/HEMCO_Config.rc.sample`
- HEMCO warnings are now only generated when `Verbose: true` is found in the HEMCO configuration file (no more numerical levels)
- Updated GFED4 emission factors for VOCs to Andreae et al. (2019)
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# HEMCO/CMakeLists.txt

cmake_minimum_required(VERSION 3.5)
project(HEMCO VERSION 3.7.1 LANGUAGES Fortran)
project(HEMCO VERSION 3.7.2 LANGUAGES Fortran)
# Reminder: Make sure to also update version in src/Core/hco_error_mod.F90

#-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We use GitHub issues to support user questions. To ask a question, **[open a new

## What type of support can I expect?

We will be happy to assist you in resolving bugs and technical issues that arise when compiling or running HEMCO. User support and outreach is an important part of our mission to support the [International GEOS-Chem User Community](https://geoschem.github.io/geos-chem-people-projects-map/).
We will be happy to assist you in resolving bugs and technical issues that arise when compiling or running HEMCO. User support and outreach is an important part of our mission to support the [International GEOS-Chem User Community](https://geoschem.github.io/people.html).

Even though we can assist in several ways, we cannot possibly do everything. We rely on HEMCO users being resourceful and willing to try to resolve problems on their own to the greatest extent possible.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = 'GEOS-Chem Support Team'

# The full version, including alpha/beta/rc tags
release = '3.7.1'
release = '3.7.2'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/source/hco-ref-guide/hemco-config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ year, month, day, or hour, and to scale emissions to a given value:
If omitted, the emisison month will be set to the model simulation
hour.

.. option:: EmissScale_<species-name>
.. option:: EmisScale_<species-name>

Optional argument to define a uniform scale factor that will be
applied across all inventories, categories, hierarchies, and
Expand Down
5 changes: 5 additions & 0 deletions run/createRunDir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ while [ "$valid_path" -eq 0 ]; do
if [[ "$hco_config_file" == *".rc"* ]]; then
hco_config_dir=$(dirname $hco_config_file)
fi

if [[ "$hco_config_file" == "./HEMCO_Config.rc.sample" ]]; then
mv "./HEMCO_Config.rc.sample" "./HEMCO_Config.rc"
hco_config_file="./HEMCO_Config.rc"
fi

done

Expand Down
30 changes: 26 additions & 4 deletions src/Core/hco_config_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ SUBROUTINE Config_ReadCont( HcoConfig, IU_HCO, CFDIR, &
LOGICAL :: Found
CHARACTER(LEN= 63) :: cName
CHARACTER(LEN=255) :: srcFile
CHARACTER(LEN= 50) :: srcVar
CHARACTER(LEN=100) :: srcVar
CHARACTER(LEN= 31) :: srcTime
CHARACTER(LEN= 31) :: TmCycle
CHARACTER(LEN= 1) :: WildCard
Expand Down Expand Up @@ -1816,9 +1816,9 @@ SUBROUTINE ExtSwitch2Buffer( HcoConfig, IU_HCO, EOF, RC )
!
! !USES:
!
USE HCO_CHARPAK_Mod, ONLY : STRREPL, STRSPLIT, TRANLC
USE HCO_EXTLIST_MOD, ONLY : AddExt, AddExtOpt, HCO_GetOpt
USE HCO_EXTLIST_MOD, ONLY : GetExtNr
USE HCO_CHARPAK_Mod, ONLY : STRREPL, STRSPLIT, TRANLC
USE HCO_EXTLIST_MOD, ONLY : AddExt, AddExtOpt, HCO_GetOpt
USE HCO_EXTLIST_MOD, ONLY : GetExtNr, GetExtOpt
!
! !INPUT PARAMETERS:
!
Expand All @@ -1841,6 +1841,7 @@ SUBROUTINE ExtSwitch2Buffer( HcoConfig, IU_HCO, EOF, RC )
!
INTEGER :: I, N, Idx, ExtNr
LOGICAL :: Enabled, NewExt
LOGICAL :: DoEmis, Found, LTMP
CHARACTER(LEN=255) :: loc
CHARACTER(LEN=512) :: msg
CHARACTER(LEN=1023) :: OPTS
Expand All @@ -1857,6 +1858,10 @@ SUBROUTINE ExtSwitch2Buffer( HcoConfig, IU_HCO, EOF, RC )
loc = 'ExtSwitch2Buffer (hco_config_mod.F90)'
ExtNr = -1

! Initialize
DoEmis= .TRUE.
Found = .FALSE.

! Do until exit
DO

Expand Down Expand Up @@ -1890,6 +1895,18 @@ SUBROUTINE ExtSwitch2Buffer( HcoConfig, IU_HCO, EOF, RC )
RETURN
ENDIF
ENDIF

! Check if EMISSIONS setting is found. If so, overwrite DoEmis.
IF ( .not. Found ) THEN
CALL GetExtOpt( HcoConfig, -999, 'EMISSIONS', &
OptValBool=LTMP, FOUND=Found, RC=RC )
IF ( RC /= HCO_SUCCESS ) THEN
msg = 'Error encountered in "GetExtOpt( EMISSIONS )"!'
CALL HCO_Error( msg, RC, ThisLoc=loc )
RETURN
ENDIF
IF ( Found ) DoEmis = LTMP
ENDIF
CYCLE
ENDIF

Expand Down Expand Up @@ -1942,6 +1959,11 @@ SUBROUTINE ExtSwitch2Buffer( HcoConfig, IU_HCO, EOF, RC )
Enabled = .FALSE.
ENDIF

! Disable extension if EMISSIONS logical is false
IF ( .not. DoEmis ) THEN
Enabled = .FALSE.
ENDIF

! Register extension name, number and species
! idx is the position of the species names
idx = idx+1
Expand Down
2 changes: 1 addition & 1 deletion src/Core/hco_error_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ MODULE HCO_Error_Mod
#endif

! HEMCO version number.
CHARACTER(LEN=12), PARAMETER, PUBLIC :: HCO_VERSION = '3.7.1'
CHARACTER(LEN=12), PARAMETER, PUBLIC :: HCO_VERSION = '3.7.2'

INTERFACE HCO_Error
MODULE PROCEDURE HCO_ErrorNoErr
Expand Down
2 changes: 1 addition & 1 deletion src/Core/hco_types_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ MODULE HCO_TYPES_MOD
!-------------------------------------------------------------------------
TYPE :: FileData
CHARACTER(LEN=255) :: ncFile ! file path+name
CHARACTER(LEN= 50) :: ncPara ! file parameter
CHARACTER(LEN=100) :: ncPara ! file parameter
INTEGER :: ncYrs(2) ! year range
INTEGER :: ncMts(2) ! month range
INTEGER :: ncDys(2) ! day range
Expand Down

0 comments on commit a5d5169

Please sign in to comment.