Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEMCO 3.8.1 #14

Merged
merged 17 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "docs/source/geos-chem-shared-docs"]
[submodule "geos-chem-shared-docs"]
path = docs/source/geos-chem-shared-docs
url = https://github.com/geoschem/geos-chem-shared-docs.git
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ 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).

## [Unreleased] - TBD
## [3.8.1] - 2024-04-02
### Changed
- Now allow up to 10 nested brackets (`((( )))`) in the `HEMCO_Config.rc` file
- Now use short submodule names (i.e. w/o path) in `.gitmodules`

### Fixed
- Limit volcano climatology file read message to root core
- Updated `hco_interp_mod.F90` to handle 3D NEI emissions.

## [3.8.0] - 2024-02-07
### Changed
- Updated TOMAS_Jeagle sea salt extension

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.2 LANGUAGES Fortran)
project(HEMCO VERSION 3.8.1 LANGUAGES Fortran)
# Reminder: Make sure to also update version in src/Core/hco_error_mod.F90

#-----------------------------------------------------------------------------
Expand Down
9 changes: 6 additions & 3 deletions 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.2'
release = '3.8.1'

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

Expand Down Expand Up @@ -82,8 +82,11 @@ def format_web_refs(self, e):
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

exclude_patterns = [
'geos-chem-shared-docs/README.md',
'geos-chem-shared-docs/supplemental-guides/species-guide.rst',
'geos-chem-shared-docs/supplemental-guides/using-kpp-with-gc.rst',
]

# -- Options for HTML output -------------------------------------------------

Expand Down
3 changes: 1 addition & 2 deletions docs/source/hco-sa-guide/login-env.rst
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,7 @@ These environment variables should be defined in your

HEMCOc only requires the Fortran compiler. But you will
also need the C and C++ compilers if you plan to build other
software packages (:ref:`such as KPP <kppguide>`) or :ref:`install
libraries manually <build-libraries-with-spack>`.
software packages or :ref:`install libraries manually <spackguide>`.

Also, older Intel compiler versions used :envvar:`icc` as the name
for the C compiler and :envvar:`icpc` as the name of the C++ compiler.
Expand Down
2 changes: 1 addition & 1 deletion src/Core/hco_config_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ SUBROUTINE BracketCheck( HcoConfig, STAT, LINE, SKIP, RC )
! !LOCAL VARIABLES:
!
! Maximum number of nested brackets
INTEGER, PARAMETER :: MAXBRACKNEST = 5
INTEGER, PARAMETER :: MAXBRACKNEST = 10
INTEGER :: IDX, STRLEN, ExtNr
LOGICAL :: FOUND
LOGICAL :: UseBracket, UseThis
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.2'
CHARACTER(LEN=12), PARAMETER, PUBLIC :: HCO_VERSION = '3.8.1'

INTERFACE HCO_Error
MODULE PROCEDURE HCO_ErrorNoErr
Expand Down
73 changes: 52 additions & 21 deletions src/Core/hco_interp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -500,17 +500,17 @@ SUBROUTINE ModelLev_Check( HcoState, nLev, IsModelLev, RC )
IF ( nlev == nz .OR. nlev == nz + 1 ) THEN
IsModelLev = .TRUE.

! If input is 72 layer (or 36 layer) and output is 47 layer
! If input is 72 layer (or 3/11/36 layer) and output is 47 layer
ELSEIF ( nz == 47 ) THEN
IsModelLev = ( nlev == 72 .OR. nlev == 73 .OR. nlev == 36)
IsModelLev = ( nlev == 72 .OR. nlev == 73 .OR. nlev == 36 .OR. nlev == 3 .OR. nlev == 11)

! If input is 102 layer and output is 74 layer
ELSEIF ( nz == 74 ) THEN
IsModelLev = ( nlev == 102 .OR. nlev == 103 )

! If input is 47 layer (or 36 layer) and output is 72 layer
! If input is 47 layer (or 3/11/36 layer) and output is 72 layer
ELSEIF ( nz == 72 ) THEN
IsModelLev = ( nlev == 47 .OR. nlev == 48 .OR. nlev == 36)
IsModelLev = ( nlev == 47 .OR. nlev == 48 .OR. nlev == 36 .OR. nlev == 3 .OR. nlev == 11)

ELSE
IsModelLev = .FALSE.
Expand Down Expand Up @@ -543,18 +543,19 @@ END SUBROUTINE ModelLev_Check
! levels, this is interpreted as native data and will be collapsed onto the
! reduced GISS grid. If the input holds 47/48 input levels, this is interpreted
! as reduced GEOS-5 data and it will be inflated to the native GEOS-5 grid
! (with a warning, as this is not recommended). If the input holds 36 input levels,
! this is assumed to be the first 36 levels of the GEOS-5 grid, meaning they will be
! written as levels 1-36 of a 47 or 72 level output grid (with the remaining values
! left to be zero) (nbalasus, 8/29/2023).
! (with a warning, as this is not recommended). If the input holds N input levels,
! (where N = 3, 11, or 36 to account for NEI and AEIC emissions), this is assumed
! to be the first N levels of the GEOS-5 grid, meaning they will be written as
! levels 1-N of a 47 or 72 level output grid (with the remaining values left to
! be zero) (nbalasus, 8/29/2023).
!
!
! Currently, this routine can remap the following combinations:
!
! * Native GEOS-5 onto reduced GEOS-5 (72 --> 47 levels, 73 --> 48 edges)
! * Native GISS onto reduced GISS (102 --> 74 levels, 103 --> 75 edges)
! * Reduced GEOS-5 onto native GEOS-5 (47 --> 72 levels, 48 --> 73 edges)
! * 36 levels onto native/reduced GEOS-5 (36 --> levels 1-36 levels of 47/72 level grid, rest are 0)
! * N (N = 3/11/36) levels onto native/reduced GEOS-5 (N --> levels 1-N levels of 47/72 level grid, rest are 0)
!
! !INTERFACE:
!
Expand Down Expand Up @@ -638,8 +639,8 @@ SUBROUTINE ModelLev_Interpolate( HcoState, REGR_4D, Lct, RC )
IF ( ( ( nlev == nz ) .OR. ( nlev == nz+1 ) ) .OR. & ! write data without doing anything
( ( nz == 47 ) .AND. ( ( nlev == 72 ) .OR. ( nlev == 73 ) ) ) .OR. & ! collapse native to reduced GEOS-5
( ( nz == 74 ) .AND. ( ( nlev == 102 ) .OR. ( nlev == 103 ) ) ) .OR. & ! collapse native to reduced GISS
( ( nz == 72 ) .AND. ( ( nlev == 47 ) .OR. ( nlev == 48 ) ) ) .OR. & ! inflate reduced to native GEOS-5
( ( ( nz == 72 ) .OR. ( nz == 47 ) ) .AND. ( nlev == 36 ) ) ) THEN ! write 36 levels to reduced/native GEOS-5
( ( nz == 72 ) .AND. ( ( nlev == 47 ) .OR. ( nlev == 48 ) ) ) .OR. & ! inflate reduced to native GEOS-5
( ( ( nz == 72 ) .OR. ( nz == 47 ) ) .AND. ( ( nlev == 3 ) .OR. ( nlev == 11 ) .OR. ( nlev == 36 ) ) ) ) THEN ! write 3/11/36 levels to reduced/native GEOS-5
! do nothing
ELSE
WRITE(MSG,*) 'ModelLev_Interpolate was called but MESSy should have been used: ',TRIM(Lct%Dct%cName)
Expand Down Expand Up @@ -694,15 +695,21 @@ SUBROUTINE ModelLev_Interpolate( HcoState, REGR_4D, Lct, RC )
ELSEIF ( nlev == 73 ) THEN
NL = 37
nout = 48
ELSEIF ( nlev == 3 ) THEN
NL = 3
nout = 47
ELSEIF ( nlev == 11 ) THEN
NL = 11
nout = 47
ELSEIF ( nlev == 36 ) THEN
NL = 36
nout = 47
ELSE
MSG = 'Can only remap from native onto reduced GEOS-5 if '// &
'input data has exactly 72, 73, or 36 levels: '//TRIM(Lct%Dct%cName)
'input data has exactly 72, 73, 3, 11, or 36 levels: '//TRIM(Lct%Dct%cName)
CALL HCO_ERROR( MSG, RC )
RETURN
ENDIF ! nlev == (72,73,36,ELSE)
ENDIF ! nlev == (72,73,3,11,36ELSE)

! Make sure output array is allocated
CALL FileData_ArrCheck( HcoState%Config, Lct%Dct%Dta, nx, ny, nout, nt, RC )
Expand Down Expand Up @@ -743,7 +750,15 @@ SUBROUTINE ModelLev_Interpolate( HcoState, REGR_4D, Lct, RC )
Lct%Dct%Dta%V3(T)%Val(:,:,46) = REGR_4D(:,:,65,T)
Lct%Dct%Dta%V3(T)%Val(:,:,47) = REGR_4D(:,:,69,T)
Lct%Dct%Dta%V3(T)%Val(:,:,48) = REGR_4D(:,:,73,T)
! If the input is 36 levels, levels 37-47 are set to 0
! If the input is N (N = 3/11/36) levels, levels N+1 to 47 are set to 0
ELSEIF ( nlev == 3 ) THEN
DO L = 4,47
Lct%Dct%Dta%V3(T)%Val(:,:,L) = 0.0_hp
ENDDO !L
ELSEIF ( nlev == 11 ) THEN
DO L = 12,47
Lct%Dct%Dta%V3(T)%Val(:,:,L) = 0.0_hp
ENDDO !L
ELSEIF ( nlev == 36 ) THEN
DO L = 37,47
Lct%Dct%Dta%V3(T)%Val(:,:,L) = 0.0_hp
Expand All @@ -756,8 +771,8 @@ SUBROUTINE ModelLev_Interpolate( HcoState, REGR_4D, Lct, RC )
IF ( HCO_IsVerb( HcoState%Config%Err ) ) THEN
WRITE(MSG,*) 'Mapped ', nlev, ' levels onto reduced GEOS-5 levels.'
CALL HCO_MSG(HcoState%Config%Err,MSG)
IF ( nlev == 36 ) THEN
WRITE(MSG,*) 'The input variable has 36 L, which were written to be L 1-36 on the output 47 L grid (remaining values set to 0).'
IF ( nlev == 3 .OR. nlev == 11 .OR. nlev == 36 ) THEN
WRITE(MSG,*) 'The input variable has ', nlev, 'L, which were written to be L 1-', nlev, ' on the output 47 L grid (remaining values set to 0).'
ELSE
WRITE(MSG,*) 'Pressure-weighted vertical regridding was done - consider if this is appropriate for the variable units.'
CALL HCO_MSG(HcoState%Config%Err,MSG)
Expand Down Expand Up @@ -857,15 +872,21 @@ SUBROUTINE ModelLev_Interpolate( HcoState, REGR_4D, Lct, RC )
ELSEIF ( nlev == 48 ) THEN
NL = 37
nout = 73
ELSEIF ( nlev == 3 ) THEN
NL = 3
nout = 72
ELSEIF ( nlev == 11 ) THEN
NL = 11
nout = 72
ELSEIF ( nlev == 36 ) THEN
NL = 36
nout = 72
ELSE
MSG = 'Can only remap from reduced onto native GEOS-5 if '// &
'input data has exactly 47, 48, or 36 levels: '//TRIM(Lct%Dct%cName)
'input data has exactly 47, 48, 3, 11, or 36 levels: '//TRIM(Lct%Dct%cName)
CALL HCO_ERROR( MSG, RC )
RETURN
ENDIF ! nlev == (48,48,36,ELSE)
ENDIF ! nlev == (48,48,3,11,36,ELSE)

! Make sure output array is allocated
CALL FileData_ArrCheck( HcoState%Config, Lct%Dct%Dta, nx, ny, nout, nt, RC )
Expand Down Expand Up @@ -924,20 +945,30 @@ SUBROUTINE ModelLev_Interpolate( HcoState, REGR_4D, Lct, RC )
Lct%Dct%Dta%V3(T)%Val(:,:,fineIDX) = REGR_4D(:,:,coarseIDX,T)
ENDDO ! I

ELSEIF ( nlev == 3 ) THEN
DO L = 4,72
Lct%Dct%Dta%V3(T)%Val(:,:,L) = 0.0_hp
ENDDO !L

ELSEIF ( nlev == 11 ) THEN
DO L = 12,72
Lct%Dct%Dta%V3(T)%Val(:,:,L) = 0.0_hp
ENDDO !L

ELSEIF ( nlev == 36 ) THEN
DO L = 37,72
Lct%Dct%Dta%V3(T)%Val(:,:,L) = 0.0_hp
ENDDO !L

ENDIF ! nlev == (47,48,36)
ENDIF ! nlev == (47,48,3,11,36)
ENDDO ! T

! Verbose
IF ( HCO_IsVerb(HcoState%Config%Err ) ) THEN
WRITE(MSG,*) 'Mapped ', nlev, ' levels onto native GEOS-5 levels.'
CALL HCO_MSG(HcoState%Config%Err,MSG)
IF ( nlev == 36 ) THEN
WRITE(MSG,*) 'The input variable has 36 L, which were written to be L 1-36 on the output 72 L grid (remaining values set to 0).'
IF ( nlev == 3 .OR. nlev == 11 .OR. nlev == 36 ) THEN
WRITE(MSG,*) 'The input variable has ', nlev, 'L, which were written to be L 1-', nlev, ' on the output 72 L grid (remaining values set to 0).'
ELSE
WRITE(MSG,*) 'Inflating from 47/48 to 72/73 levels is not recommended and is likely not mass-conserving.'
ENDIF
Expand Down
52 changes: 28 additions & 24 deletions src/Extensions/hcox_tomas_jeagle_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ SUBROUTINE HCOX_TOMAS_Jeagle_Run( ExtState, HcoState, RC )
! adjusting coeff

!### Debug
print*, 'IN HCOX_TOMAS_Jeagle_Mod.F90'
!print*, 'IN HCOX_TOMAS_Jeagle_Mod.F90'

! Init
ptr3D => NULL()
Expand Down Expand Up @@ -530,9 +530,9 @@ SUBROUTINE HCOX_TOMAS_Jeagle_Run( ExtState, HcoState, RC )
! HEMCO species ID
HcoID = HCO_GetHcoID( TRIM(SpcName), HcoState )

!### Debug
print*, 'Aerosol number AT 50, 10,: ', Inst%TC1(ii,jj,1,k)
print*, 'HCO ID: ', K, SpcName, HcoID
!### Debug - comment out print over random oceen box - update indices if needed bc, 18/12/23
!!print*, 'Aerosol number AT 1, 1,: ', Inst%TC1(ii,jj,1,k)
!!print*, 'HCO ID: ', K, SpcName, HcoID

! Add number to the HEMCO data structure
CALL HCO_EmisAdd( HcoState, Inst%TC1(:,:,:,K), HcoID, RC)
Expand Down Expand Up @@ -1052,29 +1052,33 @@ SUBROUTINE HCOX_TOMAS_Jeagle_Init( HcoState, ExtName, ExtState, RC )
4.02325d-01, 5.06898d-01, 6.38652d-01, 8.04651d-01, 1.01380d+00 /)
#endif


!bc, 10/01/24 - comment this out as coef is not being used
!=======================================================================
! Allocate quantities depending on horizontal resolution
!=======================================================================
IF ( TRIM( HcoState%Config%GridRes) == '4.0x5.0' ) THEN

!-----------------------------------------------------------------------
! TOMAS simulations at 4 x 5 global resolution
!-----------------------------------------------------------------------
Inst%TOMAS_COEF = 1.d0

ELSE IF ( TRIM( HcoState%Config%GridRes) == '2.0x2.5' ) THEN

!-----------------------------------------------------------------------
! TOMAS simulations at 2 x 2.5 global resolution
!-----------------------------------------------------------------------
Inst%TOMAS_COEF = 1.d0

ELSE

MSG = 'Adjust TOMAS_Jeagle emiss coeff (TOMAS_COEF) for your model res: SRCSALT30: hcox_TOMAS_jeagle_mod.F90'
CALL HCO_ERROR(MSG, RC )

ENDIF
! !IF ( TRIM( HcoState%Config%GridRes) == '4.0x5.0' ) THEN !comment out for
! resolution independence in code and consider implementing offline SS in
! TOMAS
!
! !-----------------------------------------------------------------------
! ! TOMAS simulations at 4 x 5 global resolution
! !-----------------------------------------------------------------------
! Inst%TOMAS_COEF = 1.d0
!
! ELSE IF ( TRIM( HcoState%Config%GridRes) == '2.0x2.5' ) THEN
!
! !-----------------------------------------------------------------------
! ! TOMAS simulations at 2 x 2.5 global resolution
! !-----------------------------------------------------------------------
! Inst%TOMAS_COEF = 1.d0
!
! ELSE
!
! MSG = 'Adjust TOMAS_Jeagle emiss coeff (TOMAS_COEF) for your model res: SRCSALT30: hcox_TOMAS_jeagle_mod.F90'
! CALL HCO_ERROR(MSG, RC )
!
! ENDIF

!=======================================================================
! Activate this module and the fields of ExtState that it uses
Expand Down
8 changes: 5 additions & 3 deletions src/Extensions/hcox_volcano_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,11 @@ SUBROUTINE ReadVolcTable( HcoState, ExtState, Inst, RC )
INQUIRE( FILE=TRIM( ThisFile ), EXIST=FileExists )

! Write message to stdout and HEMCO log
MSG = 'Attempting to read volcano climatology file'
WRITE( 6, 300 ) TRIM( MSG )
CALL HCO_MSG( HcoState%Config%Err, MSG )
IF ( Hcostate%amIRoot ) THEN
MSG = 'Attempting to read volcano climatology file'
WRITE( 6, 300 ) TRIM( MSG )
CALL HCO_MSG( HcoState%Config%Err, MSG )
ENDIF

! Create a display string based on whether or not the file is found
IF ( FileExists ) THEN
Expand Down