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

[PULL REQUEST] Allow negative pKa but skip missing values in routine CALC_HEFF (Closes #1001) #1042

Merged
merged 24 commits into from Dec 8, 2021

Conversation

yantosca
Copy link
Contributor

@yantosca yantosca commented Dec 3, 2021

This is the corresponding PR for #1001. It fixes an error that had caused pH to be neglected in the computation of Henry's law in cloud water (for heterogeneous chemistry).

LiamBindle and others added 22 commits September 25, 2020 14:50
Implemented init_rd.sh which enables automated run directory creation.
The run directory is initialized based on RDI values loaded from the
input files. See #459.
Resolved conflicts in:
	run/GCHP/ExtData.rc.templates/ExtData.rc.fullchem
	run/GCHP/createRunDir.sh
	run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.fullchem

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
The files containing environment variables for various run directory settings
will ideally be used for both GCHP and GCClassic.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
…r.sh

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
Only the GCHP run directory creation was updated for the RDI variables and
automated run directory creation. Here we begin adding RDI variables for
and an init_rd.sh script for GCClassic. The *_settings.txt files containing
RDI variables for specific simulations, met fields, and resolutions have
now been moved to the run/shared/settings/ directory with "_settings" removed
from the file names. This was done so that both GCHP and GCClassic can
access the same files.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
Resolved conflicts in:
	run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.fullchem
	run/GCClassic/HISTORY.rc.templates/HISTORY.rc.fullchem
	run/GCClassic/createRunDir.sh
	run/GCClassic/input.geos.templates/input.geos.fullchem
	run/GCHP/ExtData.rc.templates/ExtData.rc.TransportTracers
	run/GCHP/ExtData.rc.templates/ExtData.rc.fullchem
	run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.fullchem
	run/GCHP/createRunDir.sh
	run/GCHP/input.geos.templates/input.geos.TransportTracers
	run/GCHP/input.geos.templates/input.geos.fullchem
	run/GCHP/runConfig.sh.template

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
Made the following changes:

- Replaced tokens in configuration files with RDI variables
- Removed settings files for several simulation types because they
  contained RDI variables that are set in createRunDir.sh already
- Added settings file for GCAP2 (run/shared/settings/modele2.1.txt)
- Updated GCHP adjoint configuration file and files for GCHP CO2 simulation
  so they are consistent with recent updates

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
…se RDI variables instead

Recent modifications for GCAP 2.0 support added several more uses of "sed" in
createRunDir.sh. These have been removed where possible and replaced with RDI
variables that will be automatically replaced. For HEMCO settings specific
to simulations using GMAO or GCAP2 meteorology, the RDI settings have been
set in gmao_hemco.txt and gcap2_hemco.txt which are accessed in createRunDir.sh.

Similar updates were also made to setupConfigFiles.sh to remove uses of sed
from function set_common_settings. That function is still used to manually
add species and modify diagnostic output for specific simulation types.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
Run directory variables were previously prefixed with RDI (Run Directory
Initialization). It was not immediately obvious what RDI stood for, so we
have replaced RDI with the more descriptive RUNDIR. This is a simple swap
where all uses of RDI, rdi, or RDI_ have been replaced with RUNDIR, rundir,
or RUNDIR_. The run directory variables are now saved to a file named
rundir_vars.txt.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
To remove differences in run directory files made with the automated run
directory creation updates, the following fixes have been made:

1. Make sure all tokens in HEMCO_Config.rc files are replaced with
   $RUNDIR_ variables.

2. Remove unused HEMCO settings specific to GCAP 2.0 simulations from the
   top of HEMCO_Config.rc for several specialty simulations.

3. Make sure to use $GCAP2SCENARIO instead of $SCENARIO for CMIP6 fields
   consistently throughout HEMCO_Config.rc files.

4. Add dummy HEMCO_Diagn.rc file for tagO3 simulation.

5. In createRunDir.sh set default DustDead tuning factor to -999.0 for
   resolutions without a recommended scaling. Also make sure to set TOMAS
   extensions to off when not using that simulation.

6. Fixed a typo for the complexSOA_SVPOA simulation in createRunDir.sh.

7. Make sure to use ${RUNDIR_POP_SPC} instead of {POPs_SPC} in POPs
   template files.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
…rectory creation updates

1. Fix typo in createRunDir.sh for determining DustDead tuning factor used
   in 4x5 GEOS-FP benchmark and TOMAS simulations (both of which use online
   dust emissions).

2. Update commonFunctionsForTests.sh used in Integration Tests to add "NA"
   to the entries for met fields in the new HEMCO_Config.rc.gmao_metfields
   file as well as the original HEMCO_Config.rc file.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
…un directory creation updates

1. Fix typos in createRunDir.sh for GCHP.

2. Add RUNDIR_MET_DIR_NATIVE for native-resolution meteorology fields used
   by GCHP. GCClassic typically uses meteorology fields at the same
   resolution as the simulation.

3. In commonFunctionsForTests.sh only modify HEMCO_Config.rc.gmao_metfields
   if the file exists (i.e. only for GCClassic run directories). For GCHP
   runs, meteorology fields are specified in ExtData.dat and don't need to
   be modified for nested-grid simulations.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
…undir_creation

This merge brings puts feature/automated-rundir-creation on top of
the 13.4.0-alpha.2 tag.  This introduces the updates for automatic
run-directory creation, which will simplify the process of creating
integration tests.

After successful validation, this will be tagged as 13.4.0-alpha.3.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
We have restored the IF block that exits from INIT_UCX unless we are
doing either a fullchem or an aerosol simulation.  This seems to have
been clobbered by a git merge.  Now fixed.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
We now test if there are existing links to ChemDir, HcoDir, and
MetDir before unlinking.  This seems to prevent an issue with these
links not being generated.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
This merges HEMCO 3.2.2 into the automatic rundir creation branch.

We have also fixed a conflict in ExtData.rc.fullchem, so that
ExtData.rc uses the same offline dust subfolder (v2021-08) as
HEMCO_Config.rc


Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
We have now restored the correct paths for GEOS-Chem restart files
in download_data.yml.  This may have been clobbered by a Git merge.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
…osols

This fix corrects the issue first reported by Viral Shah in
geoschem/geos-chem #1034.  We only need to do HCL uptake when
SO2 chemistry is called with when FullRun=.TRUE..  The quick fix was
to add FullRun to the IF block where the computations occur.

NOTE: This issue does not occur in the new KPP sulfur chemistry code:
KPP/fullchem/fullchem_SulfurChemFuncs.F90.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
This commit fixes the issue originally raised in geoschem/geos-chem #1001.
Because missing values in the species database are -999, the condition
IF ( pKa > 0 ) in CALC_HEFF (in module GeosUtil/henry_mod.F0) basically
ignores pH in the effective Henry's law constant computations for cloud
water in heterogenous chemistry.

We have now set the condition to IF ( pKa > -100 ), which allows for
negative pKa values, but which will skip missing values.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca yantosca added the category: Bug Something isn't working label Dec 3, 2021
@yantosca yantosca added this to the 13.4.0 milestone Dec 3, 2021
@yantosca yantosca self-assigned this Dec 3, 2021
@yantosca yantosca linked an issue Dec 3, 2021 that may be closed by this pull request
@yantosca
Copy link
Contributor Author

yantosca commented Dec 6, 2021

GCHP integration tests all passed successfully

==============================================================================
GCHP: Execution Test Results

Number of execution tests: 3
==============================================================================
 
Execution tests:
------------------------------------------------------------------------------
gchp_fullchem_benchmark_merra2_c48...............Execute Simulation.....PASS
gchp_fullchem_standard_merra2_c24................Execute Simulation.....PASS
gchp_TransportTracers_geosfp_c24.................Execute Simulation.....PASS
 
Summary of execution test results:
------------------------------------------------------------------------------
Execution tests passed:        3
Execution tests failed:        0
Execution tests not completed: 0

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%  All execution tests passed!  %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

however, all of the GCC fullchem integration tests did not pass

Summary of test results:
------------------------------------------------------------------------------
Execution tests passed: 42
Execution tests failed: 38
Execution tests not yet completed: 0

I am currently investigating.

GeosUtil/henry_mod.F90:
- Bug fix: Make sure pH > 0 and thisPka > -100 before computing
  the pH adjustment for effective Henry's law constant.

KPP/fullchem/fullchem_HetStateFuncs.F90:
- Bug fix: Remove V_tot from argument list in calls to Compute_L2G_Local,
  and pass pH = H%pHCloud.  This corrects an issue where pH of the cloud
  was not being properly factored into computations.


Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
KPP/fullchem/fullchem_HetStateFuncs.F90:
- In the prior commit (4e72c59), we did not add the L2G output
  argument to the calls to Compute_L2G_Local.  Now fixed.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca
Copy link
Contributor Author

yantosca commented Dec 6, 2021

A rerun of the GCHP integration tests had all tests pass. We are waiting for a rerun of GCC integration tests to complete.

@yantosca
Copy link
Contributor Author

yantosca commented Dec 7, 2021

The GCC fullchem integration tests now all pass. See issue #1001 for details.

@yantosca yantosca merged commit b028356 into dev Dec 8, 2021
@yantosca yantosca deleted the bugfix/henry_pka branch December 8, 2021 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG/ISSUE] Bug in henry_mod/CALC_HEFF
4 participants