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

cam6_3_147: GEOS-Chem chemistry and four new compsets that use it #484

Merged
merged 194 commits into from
Feb 2, 2024

Conversation

lizziel
Copy link
Collaborator

@lizziel lizziel commented Dec 15, 2021

IMPORTANT ------ Requires ESMCI/cime#4497 which has been removed from cime due it breaking CAM until this PR is brought in

Description updated on 11/17/22 when switched from draft to ready-for-review

This pull request contains changes needed to integrate GEOS-Chem chemistry into CAM. The goal of implementing GEOS-Chem chemistry inside CAM is to provide an additional chemistry option alongside CAM-Chem. This PR includes five new compsets that are analogous to existing compsets that use CAM-Chem but that use GEOS-Chem chemistry instead.

Thibaud Fritz (@fritzt) originally did the bulk of the work for implementing the GEOS-Chem chemistry module by incorporating GEOS-Chem 13.2 into CESM2.1.1. That version of CESM is designated CESM2-GC and libraries needed for it, including CAM and a download package, are available at https://github.com/CESM-GC.

CESM2-GC was built on the tag for CESM2.1 release 29 of the now stale branch for CESM 2.1, and was previously submitted in the now closed PR #378. This new PR features CESM2-GC CAM changes after a rebase onto CAM 6.0.034, plus many additional updates implemented by myself and Haipeng Lin (@jimmielin).

GEOS-Chem in CESM relies heavily on the implementation of HEMCO in CESM2 (https://github.com/ESCOMP/HEMCO_CESM) developed by @jimmielin, and we do not expect the GEOS-Chem option to run until HEMCO_CESM is integrated into CESM as well. HEMCO is an ESMF-compatible interface to perform I/O (e.g. loading emission inventories) in atmospheric models. Note that HEMCO has been implemented in CAM for GEOS-Chem development and lives at a higher level than GEOS-Chem. This allows HEMCO to feed data (e.g. emission fluxes) to either GEOS-Chem or CAM-Chem. Compiling with HEMCO requires the use of ESMF libraries (USE_ESMF_LIB).

The CESM2-GC implementation originally came with a few modifications in CIME and CLM and changes were submitted previously with these updates (see ESCOMP/CTSM#1475, ESCOMP/CTSM#1377, and ESMCI/cime#3974). Due to a combination of incompatibility with the new CESM version and change of design, those PRs were not merged and are now closed. Here I will go over a brief history and current status of those updates.

First, we wanted to have the option to let GEOS-Chem compute its own dry deposition velocities. This required the coupler to pass land types from CLM to CAM and CLM, CIME, and CAM were modified accordingly. After discussion with NCAR we decided to use dry deposition velocities calculated in CLM for gas phase species over land instead. GEOS-Chem computes dry deposition velocity over ocean. CAM changes for this are included in this PR.

Second, we needed coefficients such as Henry's Law added GEOS-Chem species. Due to changes in how CESM handles these coefficients the previous work for including them was no longer applicable. With guidance from @fvitt I instead created a NetCDF file containing molecular weights, Henry's Law coefficients, and reactivities for all GEOS-Chem dry-deposited gases. This file is used for dep_data_file if using GEOS-Chem. The file is located on Cheyenne in my home directory.

Third, not all files in the GEOS-Chem subdirectories should be compiled. To deal with this we introduced a feature that can exclude files from the compilation process (ESMCI/cime#3366). This feature has been incorporated and built upon in separate PRs that have already been merged into CIME.

We are now looking for feedback from NCAR developers on this work. As mentioned earlier, HEMCO_CESM should be merged in before these updates for GEOS-Chem. Please let me know what the next steps are.

closes #424

fritzt and others added 16 commits December 7, 2021 12:57
(1) This introduces an option to compile GEOS-Chem src files.

(2) Interface is inexistant so far

(3) CAM still uses the Terminator chem package to satisfy dependencies

Reproducing commit from MSL - Jan 19, 2018
Feat: Update config files to include GEOS-Chem option for CAM
 (1) Update config files in cam/bld/
 (2) Update config files in cam/cime_config
Feat: Add customized chemistry.F90 for GEOS-Chem:
  *Reproducing commit from MSL - Mar 6, 2018
Feat: Initial implementation of compilable code
 (1) The code can now be compiled using a CAM 4.0 + "dummy" GEOS-Chem
     component set (compset FGC). This is based on the "tropospheric
     mozart" set.
  *Reproducing commit from SDE - May 17, 2018
Feat: Make radiatively-active species into chemical constituants
 (1) Added N2O, CH4, CFC11, CFC12
Feat: Get tracers and species from input.geos and KPP
 (1) Tracer lists are now acquired from the input files and from the
     pre-built KPP mechanism
  *Reproducing commit from SDE - May 19, 2018
Feat: Add additional flags when compiling GEOS-Chem
Fix: Update folder name following version 12.6.0
Feat: Allocate major state variables (Input, Met, Chem)
 (1) Allocating GEOS-Chem state variables
 (2) Setting input.geos path as a module variable
  *Reproducing commit from SDE - May 19, 2018
Chore: Cleanup and capitalization
Feat: Initialize core GEOS-Chem modules
 (1) Initializes ChmState, GrdState and MetState objects
 (2) Grid objects are currently initialized identically. However, they
     should be chunk-dependent. The grids are set based on the lat/lon
     edges for now, using GEOS-Chem's SetGridFromCtrEdges subroutine
 (3) Initializes Input_Opt
 (4) Added subroutine to update time-steps within GEOS-Chem
 (5) Added error trapping statements
Feat: Add initialization of Linoz module and passing CHEM_INPUTS
 (1) Initializing Linoz module
 (2) Passing CHEM_INPUTS to Input_Opt
 (3) Remove incorrect overwrite of NTracers
Feat: Initialize and cleanup State_Chm and State_Met
Feat: Initialize Drydep_Mod
 (1) Initialize Drydep_Mod
 (2) Update .exclude file to include GeosCore/drydep_mod.F
Feat: Add Init_Error to chem_init for GEOS-Chem
Feat: Initialize and cleanup GEOS-Chem modules
 (1) Add calls to module initialization and cleanup subroutines
 (2) Update .exclude file
Feat: Get grid area and Ap and Bp values from CAM
 (1) Get grid area from CAM interface
 (2) Pass CAM's Ap and Bp values to GEOS-Chem's Pressure_Mod
 (3) Call to Cleanup_Pressure
Feat: Affect data to State_Chm
Feat: Initialize chemistry, add missing cleanup routines
Feat: Initialize pressure transfer
Feat: Add first call to chemistry
Feat: Register all tracers using species database
 (1) Register species
 (2) Initial step towards the update of State_Met
Feat: Fill key variables in State_Met
Feat: Add PBL height transfer capability
 (1) Enforce lat/lonMidArr to be R4 not FP
Feat: Enforce correct tracer registration
Feat: Add initialization of short-lived species
Feat: Update surface area during chemistry loop
Feat: Use reference MMRs when queried for ICs
 (1) Zero reference MMRs at initialization
 (2) Use reference MMRs when queried for initial conditions
Feat: Groundwork for correctly reporing H2O tendencies
 (1) Add indices to key species
Feat: Add all advected species to output
 (1) Add advected species to output
 (2) Force precision of H2O to be r8
 (3) Fixed capitalization of variables
Feat: Make short-lived species persist between time steps
Feat: Set GEOS-Chem data from CAM
 (1) Date information is now propagated to GEOS-Chem. Algorithm needs
     tweaking (seems to give a date 1 minute earlier than it should).
     Also currently force the year to be 2000 as the default CAM year
     is 0000.
Feat: Disable stratospheric aerosols in GEOS-Chem
Feat: Progate more met fields to State_Met using CAM data
Feat: Change NY to PCOLS for consistency and add step count tracking
Feat: Increased default list of diagnostics for GEOS-Chem
Feat: Implement GEOS-Chem wet deposition + Estimate of 2D cloudiness
 (1) Implemented GEOS-Chem wet deposition
 (2) CAM does not provide an estimate of 2D cloud cover, so we use an
     estimate (maximum 3D cloudiness in vertical column). This matches
     the technique originally used for GCAP in GEOS-Chem.
 (3) Fix Z0 not being assigned
Feat: Move SLS information to chem_mods + Emission module
 (1) Move tracer and SLS information out to chem_mods
 (2) Added temporary NO source to provide useful output
 (3) Initial code stub for an emissions module
Fix: Fix reading of tracers in input.geos
 (1) Tracers in input.geos
 (2) Fix indentation
Chore: Now compiling GEOS-Chem with -DMODEL_
Feat: Added wet/(dry) deposition. See more comments below!
 (01) Added definition of MaxTropLev, MaxStratLev and MaxChemLev. This
      will require some additional thought
 (02) As of right now, Linoz is turned off as the current grid doesn't
      extend past 30 km, causing segmentation when running with Linoz
      turned on
 (03) Added code that's commented out right now for future development
       (HEMCO, Olson landmap, convection, ...)
 (04) Added field descrition and unit of State_Met variables when
      converted from CESM to State_Met
 (05) Updated compution of cloud optical depth. Following what MOZART
      does.
 (06) Now correctly initializing InChemGrid to .True. everywhere
 (07) Added newDay, newMonth variables
 (08) Added wet deposition
 (09) Added dry deposition. However, it is purely a software right now,
      as it runs without initializing land types
 (10) Uniformization of variables
Chore: Remove debug
Feat: Deal with compile-time definition of GEOS-Chem dry dep. species
 (1) Update ChemNamelist to be able to read deposition species from .xml
     files and filtering these with the species list from mo_sim_dat.F90.
     This last file lists all GEOS-Chem species and is only read at
     compile time and is not compiled since GEOS-Chem tracers and species
     are defined at run time from input.geos and KPP files.
 (2) Update geoschem.xml to now list dry and wet deposition species
Feat: Implement dry deposition in CESM/GC
 (1) Different options are available to compute dry deposition
     velocities:
    1. All deposition velocities are computed from GEOS-Chem using data
       from HEMCO
    2. CLM passes dry deposition velocities over land and ocean and ice
       velocities are computed from GEOS-Chem using data from HEMCO
    3. CLM passes dry deposition velocities over land and ocean and ice
       velocities are computed in a similar way as MOZART
Feat: Add missing file from last commit to replicate MOZART's dry dep. calculations
Feat: Add Externals to download GEOS-Chem source code
Feat: Add mo_chem_utils.F90 required for mo_drydep_mod
Feat: Update .exclude
Feat: Import CLM4.0/4.5/5.0 data and use it for GEOS-Chem
 (1) Import data from CLM
 (2) Add compset to run GEOS-Chem with CLM4.5/5.0
 (3) Add routine getLandTypes to convert CLM to OlsonLandMaps. More work
     is needed to convert CLM4.5 land types
 (4) CAM's building procedure has been modified to include the right
     version of CLM
 (5) Modify .exclude
Style: Fix typos that got introduced when converting commits to fork
Feat: Modify Externals_CAM.cfg to download GEOS-Chem code
Revert "Feat: Modify Externals_CAM.cfg to download GEOS-Chem code"
Feat: Update .gitignore to ignore GEOS-Chem repo
Feat: Implement HEMCO_CESM within CESM-GC (Initial attempt in syncing CAM sources)
Feat: HEMCO_CESM code integration (full). Add mo_sim_dat and mo_tracname
Fix: Call set_sim_dat from chemistry.F90 to pass solsym to HEMCO_CESM.
Fix: Do not assign other variables within mo_sim_dat -- to discuss
Fix: Comment out mo_sim_dat except solsym, expand solsym size to nTracersMax
*This might not be needed after all as HEMCO_CESM now reads tracer names from chem_mods. But fixing this so it doesn't infinite loop.
Feat: Add Olson / CLM land type mapping for CLM4.5/5.0
Feat: Add FAST_JX_DIR in Input_Opt. Remove hard-wired paths in fast_jx
Change GEOS-Chem source to CESM-GC GitHub organization and branch name
Use GEOS-Chem branch feature/13.0.0+CESM
Update HEMCO interfaces directory name in configure
Partial updates to enable GEOS-Chem dev/13.0.0 to build in CESM

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Feat: Increase nchem_adv
Feat: Define GEOS-Chem deposition species in geoschem.xml
Feat: Update solsym based on gckpp_Monitor
 (1) solsym needs to be defined explicitely, as it is parsed at compile
     time.
Feat: Update .exclude to now include input_mod and pops_mod.F90
Feat: Changes required to make GEOS-Chem 13.0 work with CESM
Feat: Set State_Met%Salinity and Iodide to 0. Will be read from HEMCO
Feat: Compute isLand/Water/Ice/Snow after AirQnt + Get fields from HEMCO
 (1) Get IODIDE surface concentration and SALINITY from HEMCO
Feat: Kludge gaseous species names to match CESM restart file:
 (1) Bromine, chlorine, iodine and lumped species are not in CESM restart
     file. We can choose to load these from a GEOS-Chem restart file but
     this is future work.
Feat: Rename CAM's drydep_mod to aer_drydep_mod
Feat: Print dep. lists when getting from namelist
Feat: Allow MAM to compile with CESM-GC
Feat: Remove unused use statement
Feat: Updates to make MAM4 interchange data with CESM-GC
 Compile time changes:
 (1) prescribe_aerosols is set to FALSE when $chem contains geoschem
 (2) Replace aerosol deposition species with MAM4 aerosols in nml files
 (3) Remove pp_geoschem/aero_model. Currently, GEOS-Chem only works
     with MAM(4) turned on. If MAM is to be switched off in the future,
     then the compiler should choose to compile pp_geoschem/aero_model
     (which is just a dummy, almost empty file) over
     modal_aero/aero_model.F90
 Code changes:
 (1) Make xname_massptr a public and protected variable. It is used to
     establish a mapping between MAM4 and GEOS-Chem aerosols
 (2) Add map2MAM4(:,:) in chem_mods and set number of fixed species to
     6 rather than 4
 (3) Add dummy constituents for GEOS-Chem aerosols. Ideally, aerosols
     that are inherited from MAM should not need to be defined as a
     constituent. For instance, BCPI is inherited from bc_a* whereas
     NIT is not included and needs to be defined as a constituent (in
     order to be advected)
 (4) Establish mapping between MAM4 and GEOS-Chem aerosols. Currently,
     POM and SOA are not mapped. More work is needed here to figure out
     which GEOS-Chem aerosols should be used to map those.
 (5) Reverse mapping (aka from GEOS-Chem back to MAM) is not established
     yet.
 (6) Clip QI and QL to 1.0E-05 as low values (I have found values as low
     as 1.0E-141) can make GEOS-Chem blow up in sulfate_mod.
 (7) Add empty m_spc_id.F90, required by MAM4
 (8) In mo_chem_utils, replace tracerNames by tracname. This is required
     as MAM aerosols are not in tracerNames (which only includes
     GEOS-Chem species). Add get_inv_ndx. I believe that this change
     temporarily breaks dry deposition as performed by MOZART. More
     investigation is needed here.
 (9) Add subroutine in mo_drydep to load in land types which is required
     for MAM4 to perform its own dry deposition
 (10) Add MAM4 aerosols to solsym and define inv_lst (list of fixed
      species)
 ----
 TODOs:
 (1) Establish reverse mappings (GEOS-Chem -> MAM4)
 (2) Check MOZART's dry deposition routines.
 (3) As of right now, MAM4 performs dry deposition. Would it be possible
     to let GEOS-Chem perform dry deposition of aerosols?
 (4) What to do regarding pure GEOS-Chem aerosols (e.g. NIT)?
Chore: Fix indentation + capitalization
Feat: Add option to get land types from HEMCO
Fix: Aerosol mapping requires more indices in MMR_Beg.
Remove custom emissions
Feat: Add emissions to CESM-GC
Fix: Prevent emissions from adding up in CESM-GC. Reset cam_in%cflx
Feat: Modify aero_model.F90 to let GEOS-Chem handle its own aerosols
Fix: Resolve circular dependency
Feat: Rename HCO_surf_salinity to HCO_salinity
 (1) The physics buffer does not allow to store strings as long as
     `HCO_surf_salinity` and would, for instance, store
     `HCO_surf_salinit`. To avoid confusion, we rename it to
     `HCO_salinity`, same for `HCO_iodide`.
Feat: Allow CESM-GC to output dry deposition velocity used by GEOS-Chem
 (1) Add addfld and outfld statements for each dry deposition species,
     using State_Chm%DryDepVel
 (2) Fix to let chemistry.F90 when LANDTYPE_HEMCO is 1.
Feat: Uncomment call to DO_MIXING to allow for dry deposition
Feat: Change IC condition file
 (1) Renamed some species into their GEOS-Chem equivalent. This new IC
     file is a mere copy of the default file, with some species renamed
Fix: Replace species number with `gas_pcnst`
Feat: Reindexed GEOS-Chem species: tracers, MAM aerosols, SL species
 (1) This reindexing is necessary as MAM requires that there is a linear
     mapping (constant offset) between solsym and constituents.
 (2) adv_mass is now properly defined in mo_sim_dat, using GEOS-Chem
     values for all species, except MAM aerosols.
Feat: Add runtime option to using GEOS-Chem wet deposition
Feat: Add files to allow for NEU wet deposition scheme
 (1) Add mo_neu_wetdep (copied from MOZART)
 (2) Add additional files (mo_mean_mass, mo_setinv, gas_wetdep_opts)
 (3) Add new field in mo_neu_wetdep (WDRATE), corresponding to the wet
     removal rate in kg/s
Feat: Add NEU WD routines + MAM gas-aerosol exchange
 ( 1) Added NEU wet deposition routines. Option to choose between NEU and
      GEOS-Chem wet deposition scheme is available at runtime. See commit
      #a8d642c
 ( 2) Added diagnostic fields for wet deposition. These match the names
      of the same quantities in MOZART
 ( 3) Added MAM gas-aerosol exchange
 ( 4) Rename field DDVel and SurfFlux into DepVel and DepFlux. Might need
      to change those in the future to match those in MOZART
 ( 5) Established MAM4 aerosol to GEOS-Chem species mapping based on
      discussion with Louisa Emmons
 ( 6) Added inverse mapping map2GCinv hat maps tracers onto constituent.
      This is now used in chem_emissions.
 ( 7) Added map2chm which maps solsym onto GEOS-Chem species and
      constituents
 ( 8) Remove special handlings when defining constituents. Variable names
      are now changed in the IC file.
 ( 9) Compute CSZAmid field
 (10) Fix bug where qH2O was flipped vertically
Feat: Get UVALBEDO from HEMCO
 *CAM only defines albedo during daytime. However, UVALBEDO is only used
 for photolysis, which should be fine.
Feat: Define MaxTrop/StratLev from grid + Add Set_H2O_Trac
Feat: Add OH and JRates diagnostics.
Feat: Get H2O mmr from specific humidity
 (1) GEOS-Chem's water mass mixing ratio is derived from CAM's specific
     humidity
 (2) Additionally, the JRates diagnostics are only computed if they are
     an output field
Chore: Remove unnecessary comment
Fix: Unit check failed because 'kg/ kg dry' /= 'kg/kg dry'
Feat: Remove special handlings as we now use GEOS-Chem IC
 (1) Previously GEOS-Chem species were modified to account for the
     species in the CAM restart file (e.g. HNO2 vs HONO). Now, we just
     use GEOS-Chem initial conditions that have been regridded to
     ~0.9x1.25
Feat: Add option to pass H2O tendency to Q + change some addfld
Feat: Set State_Met%OMEGA equal to state%omega
Feat: Allow CESM-GC to compute overhead ozone from State_Chm%Species
Feat: Allow CESM-GC runs to be restartable
Feat: Implement 3-D emissions.
 (1) Surface emissions (layer PVER) are passed to cam_in%cflx while the
     non-surface emissions are added directly to the chemical tendencies
 (2) Dry deposition fluxes are now passed to cam_in%cflx such that:
     cam_in%cflx = eflx - dflx
 (3) Remove call to DO_MIXING as this is now handled by CAM.
Feat: Replace tracerNames with solsym in chem_implements_cnst
Feat: Changes required by GEOS-Chem 13.0.0
Feat: Move compile time flags to run time flags for DD velocities
Feat: Read OMOC from HEMCO and store in State_Chm
Feat: Move all GEOS-Chem related diagnostics to cesmgc_diag_mod.F90
Feat: Add missing initialization of ThisLoc and ErrMsg
Feat: Add option to output State_Met in cesmgc_diag_mod.F90
Feat: Update GEOS-Chem branch in Externals_CAM.cfg to be `CESM`
Feat: Replace pp_geoschem with geoschem
Feat: Reset MAM-inherited aerosols to 0 before mapping
 (1) Resetting MAM-inherited aerosols in State_Chm%Species allows these
     aerosols to not accumulate over time. Otherwise, we would have
     for instance:
         BCPI = BCPI + MAM4,
     which would accumulate overtime if BCPI was not reset
 (2) Lowered the threshold on QI and QL to 1.0E-10 rather than 1.0E-05
Feat: Add MAM aerosols to cesmgc_diag_mod
Feat: Add lightning emissions
Feat: Add MEGAN emissions
Feat: Symbolic link to mozart/mo_lightning
Feat: Add symbolic link to MOZART files, rather than copy
Feat: Add lightning, MEGAN, aerosol and fire emissions
Feat: Remote WDRATE_* from CAM history fields
Fix: Molar weight pFe
Fix: Add to_upper to tracerNames, required since 'pFe' /= 'PFE'
Chore: Try lower and uppercase tracernames when getting data from pbuf
Fix: Handle cases where ncol /= pcols
Chore: Add note explaining why DQRLSAN needs to be zero in top layer
Feat: Pass GEOS-Chem aerosol emissions to MAM tendencies
Fix: Fix typo SO4S vs SOAS
Feat: Enforce lq('Q') to be true if passing H2O tendencies:
 (1) lq(cQ) = .True. if applyQTend is True
 (2) iFirstCnst is now a variable in chem_mods
 (3) Reset cam_in%cflx for all species (including MAM aerosols)
Feat: Only diagnose wet deposition rates of soluble species
Feat: Skip emissions on first time step before HEMCO fills in data
Feat: Add chem_is-like function in mo_chm_utls
Fix: Fix typo
Feat: Add or rename some output fields:
 (1) Add option to save out chemical tendencies (kg/kg/s or kg/s)
 (2) Rename output fluxes to match CAM-Chem
Feat: Add _CLFX and other CAM-Chem like diagnostics to CESM-GC
Feat: Add new GC compsets that mimic CAM-Chem compsets:
 (1) New compsets
 (2) Enforce NTHRDS_ATM to be 1 when running with GEOS-Chem
Feat: Add new use_cases XML entries for newly added GC compsets
Feat: Turn on rad_prog_ozone for GEOS-Chem chemistry
Feat: Implement CAM-Chem like diagnostics for CESM-GC:
 (1) Rename diagnostics to match CAM-Chem's
 (2) Only perform diagnostics computations if field is an output.
     Use hist_fld_active whenever a call to outfld is performed.
Feat: Make sure that GC's SOAGX species is not picked up by MAM
Fix: Remove debug statement in cesmgc_diag_mod
Feat: Add mmr tendencies for MAM aerosols from chemistry
Feat: Replace DO loops with array element-wise operations
Feat: Set NTHRDS_*=1 when using a GEOS-Chem compset
Feat: Make SDYN compset with GEOS-Chem have 56 levs
Feat: Pass chemical tendencies to MAM aerosols:
 (1) Changes in aerosol concentrations due to GEOS-Chem processing is
     now passed to chemical tendencies for MAM aerosols
 (2) Wet deposition of MAM-inherited aerosols is not performed in
     GEOS-Chem. To do so, we define a new logical `WD_ExternalDep` in
     SpcInfo
Feat: Remove mass-weighted OH concentration diagnostics
Feat: Add CO2 as constituent
Feat: Compute CO2 chemical tendencies:
 (1) GEOS-Chem overwrites CO2 concentrations at every time step. We thus
     set State_Chm%Species(:,:,:,iCO2) = 0.0e+00 before chemistry and
     compute chemical tendencies based on how much CO2 has been produced.
 (2) Cleanup
Feat: Apply CAM-Chem surface boundary conditions for long-lived species
Feat: Remove hardwired path to GEOS-Chem CHEM_INPUTS directory
Feat: Remove hard-wired paths for GEOS-Chem inputs:
 (1) All input files are now (one-time) copied from geoschem_src/run/CESM
     to Buildconf/camconf. Then to the run folder every time builnml is
     called
Feat: Read from input.geos
Feat: Read input.geos rather than hard-wiring input options
Feat: Add check to make sure that solsym is following list of GC tracer
Chore: Clean up in short_lived_species
Fix: Fix wrong reference MMR
Chore: Cleanup, remove unused MWRatio and longNames
Feat: Update .exclude to exclude gosat and tccon from GEOS-Chem folder
Feat: Get strat_chem data from HEMCO
Feat: Add timers around DO_CHEMISTRY + Fix diagnostic in WetDep
Feat: Remove PSO4 diagnostic (write statement)
Fix: Fix diagnostics of emissions
Feat: Remove option to let GEOS-Chem perform wet scavenging.
 (1) The only option to perform convective scavenging in CESM-GC is
     currently to rely on the NEU scheme, which handles large-scale
     precipitation and convective scavening. Since the variables
     required by the GEOS-Chem convective routines cannot be extracted
     easily, we rely on the NEU scheme to perform washout due to both
     LS precipitation and convective scavenging for gases AND aerosols.
 (2) A next commit will follow to specify Henry coefficients of aerosols.
     The best option is to probably set something similar as HNO3
Feat: Make non-MAM GC aerosols "gas-like" species for wet&dry dep
 (1) Move all GC aerosols from aer_drydep_list to drydep_list and from
     aer_wetdep_list to gas_wetdep_list (see previous commits too)
 (2) This allows to remove the 'GC_AER_' terminology for GC aerosols
 (3) Aerosol emission fluxes (e.g. BCPI) are now passed directly to
     MAM (e.g. flux to bc_a4). This allows for the removal of some
     interfacing code in cesmgc_emissions_mod.F90
 (4) Fix diagnostic naming issues (e.g. replaced WD_HBR with WD_HBr)
 (5) Remove extra bit of code in cesmgc_diag_mod dealing with wet dep
     in GEOS-Chem, which had been removed in previous commits
 (6) In mo_neu_wetdep.F90, make all GC aerosols be removed like HNO3
 (7) Revert previous changes in modal_aero that used to deal with
     GC aerosols in aer_drydep_list

Signed-off-by: Thibaud Fritz <fritzt@mit.edu>
…_IN_JOH for HEMCO ParaNOx extension.

Fix: fldname_ns fix to FIELDNAME
Feat: Uniformize calls to HEMCO
Fix: Replace SO4S with SO4s
Fix: Fix XML file name
Feat: Capitalize all GC constituents name, and other updates:
(1) This is required because boundary conditions are stored with
    capitalized name. I would rather follow the same terminology
    as MOZART (with capitalized constituents) rather than modify
    the interface with flbc.
(2) Update geoschem.xml to match FC2000climo compset
(3) Fix bug where lght_no_prod_factor was not applied in CESM-GC
(4) Set ext_frc_specifier to '' for CESM-GC compsets as we rely on
    HEMCO
Fix: Pass surface J-Rates to HEMCO for PARANOX
Fix: Update MMR_Beg for MAM aerosols:
(1) This fix avoids a slow, but steady build up of some MAM aerosols
Fix: Make sure GEOS-Chem (aerosol phase) MSA is not picked up by MAM
Feat: Diagnose constituents as mol/mol apart from MAM aerosols
Feat: Update namelist_defaults s.t. geoschem mimics trop_strat_mam4vbs
Feat: Update geoschem.xml to mimic history_* XML variables
Feat: Add history_* options to save out fields in cesmgc_diag_mod
Feat: Don't make solsym fixed size, but rather of size gas_pcnst
Feat: Change nadv_chem from 240 to 238
Feat: Add more history_* options to save out fields (mimic CAM-Chem)

Signed-off-by: Thibaud Fritz <fritzt@mit.edu>
Feat: Revert mo_drydep to MOZART's version + Update chemistry.F90
 (1) Note that most of the mo_drydep routines are unused. We only need
     to load in landtypes for MAM
Feat: Add aerosol number emissions in CESM-GC
 (1) Emission diameters are taken from:
     Emmons, Louisa K., et al. "The chemistry mechanism in the
     Community Earth System Model version 2 (CESM2)."
     Journal of Advances in Modeling Earth Systems 12.4 (2020).
Feat: Lump GEOS-Chem SO4 with so4_a* and H2SO4
Fix: Remove hard-wired number emissions as this has been moved to HEMCO
Feat: Update .xml files with GEOS-Chem chemistry (MEGAN)
Feat: Add MEGAN emissions with GEOS-Chem species
Fix: Update IF condition for SRF diagnostics
Feat: Add hemco_nl in build-namelist
Feat: Rename geoschem.xml to 2000_geoscheml.xml (FC2000climo_GC)
Feat: Add 2010_geoscheml.xml (FC2010climo_GC)
Feat: Update config_component to reflect recent changes to xml files
Feat: Add SOA mapping between MAM and GEOS-Chem complex SOA option
 (1) Add mapping
 (2) Extend number of constituents
Feat: Add AEIC organic species to external forcings list
Feat: Add GEOS-Chem surface boundary conditions
Feat: Update .gitignore to exclude GEOS-Chem source code
Fix: Fix for sulfur mapping between CESM2 and GEOS-Chem
 (1) SO4_gasRatio and binRatio are in mol/mol, not kg/kg
Feat: Update .exclude for GEOS-Chem 13.1
Fix: Update in-cloud opticaldepth with cloud fractions
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
NOTE: Update to add AEIC organic species to external forcings list was
      removed in this merge. It is required for using HEMCO with CAM-Chem
      since all 3D emissions fluxes applied in CAM-Chem must be
      hard-coded. The update is not required for CESM-GC and so adding it
      will be done later.

# Conflicts:
#	.gitignore
#	bld/build-namelist
#	bld/config_files/definition.xml
#	bld/configure
#	bld/namelist_files/namelist_defaults_cam.xml
#	bld/perl5lib/Build/ChemNamelist.pm
#	cime_config/buildcpp
#	cime_config/config_component.xml
#	cime_config/config_pes.xml
#	src/chemistry/modal_aero/aero_model.F90
#	src/chemistry/modal_aero/modal_aero_gasaerexch.F90
#	src/chemistry/pp_trop_strat_mam4_vbs/chem_mods.F90
#	src/chemistry/pp_trop_strat_mam4_vbs/mo_sim_dat.F90
#	src/chemistry/pp_trop_strat_mam4_vbsext/chem_mods.F90
#	src/chemistry/pp_trop_strat_mam4_vbsext/mo_sim_dat.F90
#	src/control/cam_comp.F90
#	src/control/camsrfexch.F90
#	src/cpl/atm_import_export.F90
#	src/cpl/mct/cam_cpl_indices.F90
#	src/physics/cam/phys_control.F90

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
This prevents the code from double counting in-cloud sulfur oxidation

Signed-off-by: Thibaud Fritz <fritzt@mit.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
This commit includes:
 1. Syntax bug fixes in perl file ChemNamelist.pm
 2. Setting perl smartmatch to experimental in ChemNamelist.pm to avoid
    perl version dependent build error for use of '~~' (checks if item
    is in array)
 3. Remove CAM imports lwtgcell, pwtgcell, and lai that are used for
    GEOS-Chem dry deposition velocity calculation. In a future update
    GEOS-Chem will no longer calculate dry deposition velocity when run
    in CESM so these imports are not needed.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
@lizziel
Copy link
Collaborator Author

lizziel commented Feb 10, 2022

I am currently testing this PR branch within CESM master branch commit a2434e8 ("Merge pull request #201" on 1/27/22). It successfully builds and runs with case FCnudged with minor edits (now pushed).

I am now testing the five GEOS-Chem test cases: FCSD_GC, FCHIST_GC, FC2000climo_GC, FC2010climo_GC, and FSPCAMM_GC. Since HEMCO is turned off by default in this PR I must make a manual change here to turn on HEMCO to build these cases.

Current status is the GEOS-Chem builds are failing because all GEOS-Chem files are being compiled. This is expected since previously @fritzt implemented in CIME the ability to skip GEOS-Chem files that are not used in CESM-GC, and I have not brought that work in yet. That update is discussed in issue ESMCI/cime#3366, and submitted as part of PR ESMCI/cime#3974. I am now working on bringing that functionality to the recent version.

Pinging @gold2718 and @lkemmons on this update.

@lizziel
Copy link
Collaborator Author

lizziel commented Feb 11, 2022

I opened draft PR ESMCI/cime#4180 to submit CIME updates to use an .exclude file to exclude certain files from compiling. This update will be necessary for building GEOS-Chem within CESM. It supersedes ESMCI/cime#3974 (which can now be closed) and closes ESMCI/cime#3366.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
@lizziel
Copy link
Collaborator Author

lizziel commented Feb 24, 2022

Four of the five GEOS-Chem compsets in this PR now build successfully with HEMCO enabled and dry deposition code disabled.

  • FCSD_GC
  • FCHIST_GC
  • FC2000climo_GC
  • FC2010climo_GC

The fifth one, FSPCAMM_GC, relies on option geoschem_mam3 which is not fully implemented. We may not support this compset.

The next step for me is to tackle dry deposition. I will turn off dry deposition for aerosols and try to use dry deposition velocities for gas phase species from the land module.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
@fvitt
Copy link

fvitt commented Feb 1, 2024

@fvitt

Yes, you may push directly to the branch. I checked that you are added as a collaborator with write permissions. Could you explain what the real kind script is testing? Is this something I should fix at some point?

It checks for missing "r8" real kind specifier in variable declarations and floating point constants in the code. There are many other external codes that we skip over.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
@lizziel
Copy link
Collaborator Author

lizziel commented Feb 1, 2024

Updates to doc/Changelog are now pushed!

Copy link
Collaborator

@cacraigucar cacraigucar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that none of the GEOS-Chem tests use the SE dycore (which is one of the main dycores for CAM7). Has GEOS-Chem been tested with the SE dycore? This should not hold up this PR, but should be considered in the follow-on PR for GEOS-Chem.

@jimmielin
Copy link

I just realized that none of the GEOS-Chem tests use the SE dycore (which is one of the main dycores for CAM7). Has GEOS-Chem been tested with the SE dycore? This should not hold up this PR, but should be considered in the follow-on PR for GEOS-Chem.

Hi @cacraigucar, yes I have ran with the SE dycore using the ne30 grid with the FCnudged_GC compset. It should work out of the box.

@cacraigucar
Copy link
Collaborator

I just realized that none of the GEOS-Chem tests use the SE dycore (which is one of the main dycores for CAM7). Has GEOS-Chem been tested with the SE dycore? This should not hold up this PR, but should be considered in the follow-on PR for GEOS-Chem.

Hi @cacraigucar, yes I have ran with the SE dycore using the ne30 grid with the FCnudged_GC compset. It should work out of the box.
That is good to know! Thanks

@lizziel
Copy link
Collaborator Author

lizziel commented Feb 1, 2024

I can add these tests in my PR for GEOS-Chem version update to 14.3.

@fvitt
Copy link

fvitt commented Feb 2, 2024

@lizziel
The GEOS-Chem test fails to build with this error:

[Errno 2] No such file or directory: '/glade/derecho/scratch/fvitt/aux_cam_20240201095805/SMS_Ld1_Vnuopc.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d.GC.aux_cam_20240201095805/species_database.yml'

See test dir:

/glade/derecho/scratch/fvitt/aux_cam_20240201095805/SMS_Ld1_Vnuopc.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d.GC.aux_cam_20240201095805

@lizziel
Copy link
Collaborator Author

lizziel commented Feb 2, 2024

@fvitt, did you pull in my CIME PR ESMCI/cime#4497? This is needed so that the GEOS-Chem configuration files are copied to the run directory.

@fvitt
Copy link

fvitt commented Feb 2, 2024

@fvitt, did you pull in my CIME PR ESMCI/cime#4497? This is needed so that the GEOS-Chem configuration files are copied to the run directory.

Is there a tag that includes this?

@lizziel
Copy link
Collaborator Author

lizziel commented Feb 2, 2024

There is not. The PR is on hold to be brought in along with the GEOS-Chem PR. This is because it updates case setup to expect a new python file in CAM to be run during case setup. To test GEOS-Chem I brought in the change to cime before submitting tests. This makes sure the GEOS-Chem config files are copied to the case directory.

@lizziel
Copy link
Collaborator Author

lizziel commented Feb 2, 2024

I just realized that technically I do not know if there a tag with the PR merged. There is a commit that reverts it so perhaps the prior commit does have a tag. @jedwards4b, could you advise?

@fvitt
Copy link

fvitt commented Feb 2, 2024

@cacraigucar
Is it okay to let the goeschem tests fail until a new cime tag is brought in to fix the issue with geoschem config file?

@cacraigucar
Copy link
Collaborator

@cacraigucar Is it okay to let the goeschem tests fail until a new cime tag is brought in to fix the issue with geoschem config file?

@fvitt - Yes, let's go ahead and allow this to go in with the failing geoschem tests. Make sure you mark it in the plans page, so Chris knows to expect it with the prealpha tag, unless cime is updated by then for it.

@fvitt fvitt merged commit 74018ee into ESCOMP:cam_development Feb 2, 2024
@jedwards4b
Copy link

So this is going to require another cime branch - right?

@cacraigucar
Copy link
Collaborator

So this is going to require another cime branch - right?

That is correct. @lizziel can let us know whether they need this immediately or if we can wait for the next cime branch that you'll inevitably be making for Chris.

@cacraigucar
Copy link
Collaborator

So this is going to require another cime branch - right?

That is correct. @lizziel can let us know whether they need this immediately or if we can wait for the next cime branch that you'll inevitably be making for Chris.

I should mention that this change also needs to go into the main cime branch as well, but we won't be able to use it there until we no longer need the branches.

@jedwards4b
Copy link

It will go into cime master first, then I create a branch.

@cacraigucar
Copy link
Collaborator

It will go into cime master first, then I create a branch.

That is perfect. Let see when @lizziel thinks this needs to be made for their work. They may be able to use their personal branch until you make the next cime branch for other reasons.

@cacraigucar
Copy link
Collaborator

@jedwards4b - This was the response from @lizziel via email:

We would prefer there to be a CIME tag compatible with GEOS-Chem as soon as possible so that we can tell people it is functional. Let me know if this will be an issue.

Let us know when you make the cime branch tag and we will probably update all the CAM externals at that point.

@cacraigucar
Copy link
Collaborator

@jedwards4b - This may be in the branch tag you just made for Chris. The required changes were in: ESMCI/cime#4497 which said it was merged into cime in November. Could you confirm whether this is in the branch tag and what that tag is?

@fischer-ncar
Copy link
Collaborator

@cacraigucar The changes in ESMCI/cime#4497 were removed because they were causing all of my testing to fail. So the changes are not in the existing branch tag.

@cacraigucar
Copy link
Collaborator

@fischer-ncar Is there an open issue in cime to bring them back in, in a way that doesn't cause your tests to fail?

@fischer-ncar
Copy link
Collaborator

@cacraigucar there's a cime PR that's about to be merged when the tests for it finish. My tests will pass with this new cam tag. ESMCI/cime#4540

@jedwards4b
Copy link

cime6.0.209_httpsbranch01 is the cime tag you want here.

gold2718 pushed a commit to gold2718/CAM that referenced this pull request May 2, 2024
Merge pull request ESCOMP#484 from CESM-GC/CESM-GC_rebased_on_cam6_0_034

cam6_3_147: GEOS-Chem chemistry and four new compsets that use it

ESCOMP commit: 74018ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Tag
Development

Successfully merging this pull request may close these issues.