Skip to content

Commit

Permalink
Merge branch 'develop' into feature/acollow/persistemissionsafter2019
Browse files Browse the repository at this point in the history
  • Loading branch information
acollow authored Nov 12, 2024
2 parents 4ff85a8 + ef6e5e1 commit 7bbd451
Show file tree
Hide file tree
Showing 34 changed files with 889 additions and 385 deletions.
42 changes: 36 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: 2.1

# Anchors to prevent forgetting to update a version
baselibs_version: &baselibs_version v7.7.0
bcs_version: &bcs_version v10.22.3
# Anchors in case we need to override the defaults from the orb
#baselibs_version: &baselibs_version v7.25.0
#bcs_version: &bcs_version v11.5.0

orbs:
ci: geos-esm/circleci-tools@1
ci: geos-esm/circleci-tools@2

workflows:
build-test:
Expand All @@ -18,8 +18,38 @@ workflows:
matrix:
parameters:
compiler: [gfortran, ifort]
baselibs_version: *baselibs_version
#baselibs_version: *baselibs_version
repo: GEOSgcm
checkout_fixture: true
mepodevelop: true
persist_workspace: false # Needs to be true to run fv3/gcm experiment, costs extra
persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra

# Run AMIP GCM (1 hour, no ExtData)
- ci/run_gcm:
name: run-GCM-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran, ifort]
requires:
- build-GEOSgcm-on-<< matrix.compiler >>
repo: GEOSgcm
#baselibs_version: *baselibs_version
#bcs_version: *bcs_version

# Run Coupled GCM (1 hour, no ExtData)
- ci/run_gcm:
name: run-coupled-GCM-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran, ifort]
requires:
- build-GEOSgcm-on-<< matrix.compiler >>
repo: GEOSgcm
#baselibs_version: *baselibs_version
#bcs_version: *bcs_version
gcm_ocean_type: MOM6
change_layout: false
7 changes: 5 additions & 2 deletions .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ jobs:
require-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v2
- uses: mheap/github-action-required-labels@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
mode: minimum
count: 1
labels: "0 diff,0 diff trivial,Non 0-diff,0 diff structural,0-diff trivial,Not 0-diff,0-diff,automatic,0-diff uncoupled"
add_comment: true
message: "This PR is being prevented from merging because you have not added one of our required labels: {{ provided }}. Please add one so that the PR can be merged."

blocking-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v2
- uses: mheap/github-action-required-labels@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
mode: exactly
count: 0
labels: "Contingent - DNA,Needs Lead Approval,Contingent -- Do Not Approve"
add_comment: true
message: "This PR is being prevented from merging because you have added one of our blocking labels: {{ provided }}. You'll need to remove it before this PR can be merged."
11 changes: 9 additions & 2 deletions .github/workflows/validate_yaml_files.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
---

# Based on code from https://github.com/marketplace/actions/yaml-lint

name: Yaml Lint

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

# This validation is equivalent to running on the command line:
# yamllint -d relaxed --no-warnings
# and is controlled by the .yamllint.yml file
jobs:
validate-YAML:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- id: yaml-lint
name: yaml-lint
uses: ibiqlik/action-yamllint@v3
Expand All @@ -17,7 +24,7 @@ jobs:
format: colored
config_file: .yamllint.yml

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: yamllint-logfile
Expand Down
4 changes: 2 additions & 2 deletions CARMAchem_GridComp/CARMA_GridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ SUBROUTINE CARMA_GridCompRun ( gcCARMA, qa, impChem, expChem, nymd, nhms, &
! Fill the internal state with direct gas species from GMI
! Expectation is species are in VMR and needed in MMR for CARMA
! -----------
if(trim(reg%sulfuric_acid_source) == 'full_field' .and. reg%NGAS > 0) then
if(reg%sulfuric_acid_source(1:10) == 'full_field' .and. reg%NGAS > 0) then
do igas = 1, reg%NGAS
n = nCARMAbegin + reg%NBIN*reg%NELEM - 1 + igas
gasname = ESMF_UtilStringUpperCase(reg%gasname(igas))
Expand Down Expand Up @@ -1399,7 +1399,7 @@ SUBROUTINE CARMA_GridCompRun ( gcCARMA, qa, impChem, expChem, nymd, nhms, &
! Return the updated gas species to GMI from the internal state
! Expectation is species are in MMR and needed in VMR for GMI
! -----------
if(trim(reg%sulfuric_acid_source) == 'full_field' .and. reg%NGAS > 0) then
if(reg%sulfuric_acid_source(1:10) == 'full_field' .and. reg%NGAS > 0) then
do igas = 1, reg%NGAS
n = nCARMAbegin + reg%NBIN*reg%NELEM - 1 + igas
gasname = ESMF_UtilStringUpperCase(reg%gasname(igas))
Expand Down
2 changes: 1 addition & 1 deletion CARMAchem_GridComp/CARMA_UtilMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ SUBROUTINE CARMA_Emissions ( gcCARMA, qa, impChem, expChem, nymd, nhms, cdt, &
do igas = 1, reg%NGAS
n = n1 + reg%NELEM*reg%NBIN - 1 + igas
gasname = ESMF_UtilStringUpperCase(trim(reg%gasname(igas)))
if(trim(reg%sulfuric_acid_source) == 'tendency' .and. gasname == 'H2SO4') then
if(reg%sulfuric_acid_source(1:8) == 'tendency' .and. gasname == 'H2SO4') then
qa(n)%data3d = qa(n)%data3d + pso4 * dtime
endif
if( gasname == 'HNO3') then ! go to MMR
Expand Down
8 changes: 4 additions & 4 deletions CARMAchem_GridComp/CARMAchem_GridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ SUBROUTINE Initialize_ ( gc, import, export, clock, rc )
end if

! attach the aerosol optics method
call ESMF_MethodAdd(aero, label='aerosol_optics', userRoutine=aerosol_optics, __RC__)
call ESMF_MethodAdd(aero, label='run_aerosol_optics', userRoutine=run_aerosol_optics, __RC__)

end if

Expand Down Expand Up @@ -1730,7 +1730,7 @@ SUBROUTINE final_(ierr)
END SUBROUTINE final_


subroutine aerosol_optics(state, rc)
subroutine run_aerosol_optics(state, rc)

implicit none

Expand Down Expand Up @@ -1774,7 +1774,7 @@ subroutine aerosol_optics(state, rc)
real :: x
integer :: i, j, k

Iam = 'CARMA::aerosol_optics()'
Iam = 'CARMA::run_aerosol_optics()'


! Mie Table instance/index
Expand Down Expand Up @@ -1930,7 +1930,7 @@ subroutine mie_(mie_table, aerosol, nb, offset, q, rh, ext, ssa, asy, rc)

end subroutine mie_

end subroutine aerosol_optics
end subroutine run_aerosol_optics



Expand Down
2 changes: 1 addition & 1 deletion CARMAchem_GridComp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ foreach (dir ${src_directories})
list (APPEND srcs ${tmpsrcs})
endforeach()

set (dependencies Chem_Shared Chem_Base GMAO_mpeu esmf)
set (dependencies Chem_Shared Chem_Base GMAO_mpeu ESMF::ESMF)
esma_add_library (${this} SRCS ${srcs} DEPENDENCIES ${dependencies})
target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/CARMA/source/base>)

Expand Down
51 changes: 46 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,60 @@ 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]

### Added
-Connectivity added between GOCART2G and HEMCO for anthropogenic OC, BC, SO2, SO4, and NH3 in GEOS_ChemGridComp.F90. These species are now added in HEMCOgocart2g* files with diurnal and day of week scaling implemented.
-ExtData2G is used to persist anthropogenic emissions for the year 2019 after the available emissions data set ends.
### Removed
### Changed

- The file path was changed for anthropogenic CO emissions that are used by achem. Note that the previous version of the emissions have an incorrect seasonal cycle.
- Update ESMF CMake target to `ESMF::ESMF`
- Overhauled the Lopez lightning scheme, and made it the default scheme; note that lightning is used by GMI for computing NOx emissions; PCHEM does not use lightning

### Fixed

## [1.13.1] - 2023-03-02
- Updated GAAS_Gridcomp_Extdata.yaml in AMIP/ to avoid the model to crash when GAAS is turned on and AMIP emissions chosen.

### Deprecated


## [1.14.0] - 2024-06-21

### Added

- Connectivity from GMI to ACHEM (4 fields), requires GMI v1.2.0 or later to run
- Slight improvement for lightning flash rate calculation (LOPEZ and MOIST schemes). See the option UsePreconCape in ChemEnv.rc . This involves new imports from MOIST: CAPE, BYNCY and INHB. **NOTE** THIS REQUIRES GEOSgcm_GridComp develop branch (as of 12/12/23).
- Added a flag for 'strict' child timing, intended to reduce the timing bias against child GC's that employ 'gather' calls. Such calls are occasionally necessary, but can cause timers to attribute excessive time to a child, time that is actually the synchronization lag time that would eventually be spent -somewhere- in the program, but which gets attributed to the child with a 'gather' or barrier call. The new flag is for timing tests only.

### Changed

- Update CI to use v2 orb

### Fixed

- Fixed CARMA to fix radiation callback
- Fixed code in CARMA to properly check whether GMI or GOCART are providing sulfur inputs
- Fixed CARMA/GOCART2G sulfate production tendency term
- Fix a bug in GAAS where it gets the VM (global instead of the correct current)
- Fix an issue in GAAS where the `aod_?` fields were not declared as `MAPL_RestartSkip` in the Registry file.

## [1.13.1] - 2023-04-24

### Added

- Added CO2 connectivity in GEOS_ChemGridComp for GOCART-GEOS-Chem coupling
- Added a wrapper routine for the MAPL Solar Zenith Angle call, in Chem_Shared
- Added connectivity from GOCART2G aerosols to GMI chem

### Removed

- Removed the GMI routines which computed Solar Zenith Angle, in Chem_Shared; but in a later commit, this was added back temporarily, so that older versions of GMI and TR don't complain.

- Removed parallel read of PChem species file. This parallel read was causing issues at NAS at large node count, so now we just do a read-on-root followed by a broadcast

### Fixed

- Fixed a bug that had prevented GMI running with HEMCO

## [1.13.0] - 2023-03-01

Expand Down Expand Up @@ -56,7 +97,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Instead of importing a set of QQK diagnostic fields for chemical loss of stOX, TR now imports a single field: stOX_loss
- For OPS configuration: removal of links, change of QFED paths from vNRT/ to v2.5r1-nrt/
- For OPS configuration: removal of links, change of QFED paths from vNRT/ to v2.5r1-nrt/
- For AMIP configuration: update of QFED from v2.5r1 to v2.6r1 (most recent collection)
- Moved to GitHub Actions for label enforcement
- Update CircleCI to use Baselibs 7.7.0
Expand Down Expand Up @@ -104,7 +145,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Updates to emissions from galactic cosmic rays in GMI
- Minor improvement to Runtime_Registry module.
- Broke away the GMI contents from Chem_Registry.rc, into a separate file
- Broke away the GMI contents from Chem_Registry.rc, into a separate file

## [1.10.1] - 2022-08-30

Expand Down Expand Up @@ -160,7 +201,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fix YAML typo in `GEOSachem_GridComp/GEOSachem_ExtData.yaml`

## [1.9.4] - 2022-05-31
## [1.9.4] - 2022-05-31

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set (srcs
esma_add_library (${this}
SRCS ${srcs}
SUBCOMPONENTS ${alldirs}
DEPENDENCIES MAPL Chem_Shared Chem_Base GOCART_GridComp GOCART2G_GridComp TR GMI StratChem esmf)
DEPENDENCIES MAPL Chem_Shared Chem_Base GOCART_GridComp GOCART2G_GridComp TR GMI StratChem ESMF::ESMF)

install(
FILES GEOS_ChemGridComp.rc ChemEnv_ExtData.rc ChemEnv.rc ChemEnv_ExtData.yaml
Expand Down
12 changes: 8 additions & 4 deletions ChemEnv.rc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#-----------------------
# Settings for Lightning
#-----------------------
flashSource: MOIST # MOIST (default), FIT, HEMCO, LOPEZ
flashSource: LOPEZ # MOIST, FIT, HEMCO, LOPEZ (default)

# for FIT only:
ratioGlobalFile: ExtData/g5chem/x/lightning/RatioGlobal.asc
Expand All @@ -20,9 +20,11 @@ MOIST_flashFactor_resvec_REPLAY: 2.0 2.0 2.0 1.84 1.84
FIT_flashFactor_resvec_REPLAY: 1.0 1.0 1.0 1.0 1.0 1.0

# originally called 'alpha'
LOPEZ_flashFactor_resvec_CTM: 37.5 37.5 37.5 37.5 37.5 37.5
LOPEZ_flashFactor_resvec_FREE: 37.5 37.5 37.5 37.5 37.5 37.5
LOPEZ_flashFactor_resvec_REPLAY: 37.5 37.5 37.5 37.5 37.5 37.5
# 10.29.24 Manyin provided c90 and c180, FREE and REPLAY
# Assume CTM is close to REPLAY
LOPEZ_flashFactor_resvec_CTM: 6705.50 6705.50 6705.50 6941.09 6941.09 6941.09
LOPEZ_flashFactor_resvec_FREE: 5672.30 5672.30 5672.30 6495.07 6495.07 6495.07
LOPEZ_flashFactor_resvec_REPLAY: 6705.50 6705.50 6705.50 6941.09 6941.09 6941.09

# originally called 'otdLisScale'
# NOTE: testing (Nov2020) indicated c-90 value of 9.48e-3 might be better
Expand All @@ -34,3 +36,5 @@ HEMCO_flashFactor_resvec_REPLAY: 0.6 0.355 0.1 2.095e-2 7.024e-
lightNOampFactor: 1.07
numberNOperFlash: 1.50e+26
minDeepCloudTop: 7.0

usePreconCape: TRUE
2 changes: 1 addition & 1 deletion DNA_GridComp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set (srcs
DNA_GridCompMod.F90
)

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL esmf NetCDF::NetCDF_Fortran)
esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL ESMF::ESMF NetCDF::NetCDF_Fortran)
target_compile_definitions (${this} PRIVATE MAPL_MODE GEOS5)

set (resource_files
Expand Down
24 changes: 14 additions & 10 deletions GAAS_GridComp/AMIP/GAAS_GridComp_ExtData.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
Collections:
GAAS_d5124_m2_jan10.aod_a.sfc.%y4%m2%d2_%h2%n2z.nc4:
template: /discover/nobackup/projects/gmao/merra2/data/chem/d5124_m2_jan10/Y%y4/M%m2/d5124_m2_jan10.aod_a.sfc.%y4%m2%d2_%h2%n2z.nc4
aod_a.sfc.%y4%m2%d2_%h2%n2z.nc4:
template: das.aod_a.sfc.%y4%m2%d2_%h2%n2z.nc4
freq: PT3H
GAAS_d5124_m2_jan10.aod_f.sfc.%y4%m2%d2_%h2%n2z.nc4:
template: /discover/nobackup/projects/gmao/merra2/data/chem/d5124_m2_jan10/Y%y4/M%m2/d5124_m2_jan10.aod_f.sfc.%y4%m2%d2_%h2%n2z.nc4
aod_f.sfc.%y4%m2%d2_%h2%n2z.nc4:
template: das.aod_f.sfc.%y4%m2%d2_%h2%n2z.nc4
freq: PT3H
GAAS_d5124_m2_jan10.aod_k.sfc.%y4%m2%d2_%h2%n2z.nc4:
template: /discover/nobackup/projects/gmao/merra2/data/chem/d5124_m2_jan10/Y%y4/M%m2/d5124_m2_jan10.aod_k.sfc.%y4%m2%d2_%h2%n2z.nc4
aod_k.sfc.%y4%m2%d2_%h2%n2z.nc4:
template: das.aod_k.sfc.%y4%m2%d2_%h2%n2z.nc4
freq: PT3H

Samplings:
GAAS_sample_0:
time_interpolation: False
update_offset: PT450S
exact: True

Exports:
aod_a:
collection: GAAS_d5124_m2_jan10.aod_a.sfc.%y4%m2%d2_%h2%n2z.nc4
collection: aod_a.sfc.%y4%m2%d2_%h2%n2z.nc4
sample: GAAS_sample_0
variable: AOD
fail_on_missing_file: false
aod_f:
collection: GAAS_d5124_m2_jan10.aod_f.sfc.%y4%m2%d2_%h2%n2z.nc4
collection: aod_f.sfc.%y4%m2%d2_%h2%n2z.nc4
sample: GAAS_sample_0
variable: AOD
fail_on_missing_file: false
aod_k:
collection: GAAS_d5124_m2_jan10.aod_k.sfc.%y4%m2%d2_%h2%n2z.nc4
collection: aod_k.sfc.%y4%m2%d2_%h2%n2z.nc4
sample: GAAS_sample_0
variable: AOD
fail_on_missing_file: false

Loading

0 comments on commit 7bbd451

Please sign in to comment.