Skip to content

Commit

Permalink
Merge pull request #284 from GEOS-ESM/feature/mmanyin/revised_lopez_l…
Browse files Browse the repository at this point in the history
…ightning

Lopez lightning revisions
  • Loading branch information
mmanyin authored Oct 30, 2024
2 parents 453771c + 14d7f22 commit ef6e5e1
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 56 deletions.
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- 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

- Updated GAAS_Gridcomp_Extdata.yaml in AMIP/ to avoid the model to crash when GAAS is turned on and AMIP emissions chosen.

### Deprecated


Expand Down
10 changes: 6 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 165300 37.5
LOPEZ_flashFactor_resvec_FREE: 37.5 37.5 37.5 37.5 165300 37.5
LOPEZ_flashFactor_resvec_REPLAY: 37.5 37.5 37.5 37.5 165300 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 Down
47 changes: 36 additions & 11 deletions GEOS_ChemEnvGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ subroutine SetServices ( GC, RC )

call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'PFI_CN', &
LONG_NAME = 'ice_convective_precipitation', &
LONG_NAME = '3D_flux_of_ice_convective_precipitation', &
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationEdge, __RC__ )
Expand Down Expand Up @@ -395,6 +395,24 @@ subroutine SetServices ( GC, RC )
VLOCATION = MAPL_VLocationNone, __RC__)


call MAPL_AddImportSpec(GC, &
SHORT_NAME='ZLCL', &
LONG_NAME ='lifting_condensation_level', &
UNITS ='m' , &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddImportSpec(GC, &
SHORT_NAME='ZLFC', &
LONG_NAME ='level_of_free_convection', &
UNITS ='m' , &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, RC=STATUS )
VERIFY_(STATUS)



! !EXPORT STATE:

! AIRDENS: Provided for Children
Expand Down Expand Up @@ -763,10 +781,10 @@ subroutine Initialize_ ( GC, impChem, expChem, clock, RC )
__RC__ )

IF(MAPL_AM_I_ROOT()) THEN
if ( flash_source_enum == FLASH_SOURCE_MOIST ) PRINT*,'MOIST_flashFactor is ',MOIST_flashFactor
if ( flash_source_enum == FLASH_SOURCE_FIT ) PRINT*,' FIT_flashFactor is ', FIT_flashFactor
if ( flash_source_enum == FLASH_SOURCE_HEMCO ) PRINT*,'HEMCO_flashFactor is ',HEMCO_flashFactor
if ( flash_source_enum == FLASH_SOURCE_LOPEZ ) PRINT*,'LOPEZ_flashFactor is ',LOPEZ_flashFactor
if ( flash_source_enum == FLASH_SOURCE_MOIST ) PRINT*,'MOIST_flashFactor is ', MOIST_flashFactor
if ( flash_source_enum == FLASH_SOURCE_FIT ) PRINT*,' FIT_flashFactor is ', FIT_flashFactor
if ( flash_source_enum == FLASH_SOURCE_HEMCO ) PRINT*,'HEMCO_flashFactor is ', HEMCO_flashFactor
if ( flash_source_enum == FLASH_SOURCE_LOPEZ ) PRINT*,'LOPEZ_flashFactor is ', LOPEZ_flashFactor

PRINT*,'usePreconCape = ', usePreconCape
ENDIF
Expand Down Expand Up @@ -825,6 +843,9 @@ subroutine Run1 ( GC, IMPORT, EXPORT, CLOCK, RC )
real, pointer, dimension(:,:) :: LWI => null()
real, pointer, dimension(:,:) :: PBLH => null()

real, pointer, dimension(:,:) :: ZLFC => null()
real, pointer, dimension(:,:) :: ZLCL => null()

real, pointer, dimension(:,:) :: TS => null()
real, pointer, dimension(:,:) :: FROCEAN => null()
real, pointer, dimension(:,:) :: FRLAND => null()
Expand Down Expand Up @@ -936,11 +957,11 @@ subroutine Run1 ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GetPointer ( IMPORT, MIDLAT_ADJ, 'MIDLAT_ADJ', __RC__ )
end if

call MAPL_GetPointer ( IMPORT, CNV_MFC, 'CNV_MFC', __RC__ )
call MAPL_GetPointer ( IMPORT, CNV_MFD, 'CNV_MFD', __RC__ )
call MAPL_GetPointer ( IMPORT, CN_PRCP, 'CN_PRCP', __RC__ )
call MAPL_GetPointer ( IMPORT, PHIS, 'PHIS', __RC__ )
call MAPL_GetPointer ( IMPORT, PFI_CN, 'PFI_CN', ALLOC=.TRUE., __RC__ ) ! ??
call MAPL_GetPointer ( IMPORT, CNV_MFC, 'CNV_MFC', __RC__ )
call MAPL_GetPointer ( IMPORT, CNV_MFD, 'CNV_MFD', __RC__ )
call MAPL_GetPointer ( IMPORT, CN_PRCP, 'CN_PRCP', __RC__ )
call MAPL_GetPointer ( IMPORT, PHIS, 'PHIS', __RC__ )
call MAPL_GetPointer ( IMPORT, PFI_CN, 'PFI_CN', __RC__ )

call MAPL_GetPointer ( IMPORT, T, 'T', __RC__ )
call MAPL_GetPointer ( IMPORT, TH, 'TH', __RC__ )
Expand All @@ -958,6 +979,10 @@ subroutine Run1 ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GetPointer ( IMPORT, INHB_PRECON, 'INHB', __RC__ )
call MAPL_GetPointer ( IMPORT, BYNCY_PRECON, 'BYNCY', __RC__ )

call MAPL_GetPointer ( IMPORT, ZLFC, 'ZLFC', __RC__ )
call MAPL_GetPointer ( IMPORT, ZLCL, 'ZLCL', __RC__ )


BYNCY(:,:,:) = real(0)
CAPE(:,:) = real(0)
LFR(:,:) = real(0)
Expand Down Expand Up @@ -986,7 +1011,7 @@ subroutine Run1 ( GC, IMPORT, EXPORT, CLOCK, RC )
minDeepCloudTop, lightNOampFactor, numberNOperFlash, &
MOIST_flashFactor, FIT_flashFactor, HEMCO_flashFactor, LOPEZ_flashFactor, &
CNV_MFD, usePreconCape, CAPE_PRECON, INHB_PRECON, BYNCY_PRECON, &
CAPE, BYNCY, LFR, LIGHT_NO_PROD, PHIS, &
CAPE, BYNCY, ZLFC, ZLCL, LFR, LIGHT_NO_PROD, PHIS, &
__RC__)

! call pmaxmin('LFR', LFR, flashRateMin, flashRateMax, nc, 1, 1.)
Expand Down
Loading

0 comments on commit ef6e5e1

Please sign in to comment.