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

Feature request: Add comments for units in KPP/commonIncludeVars.H #2029

Closed
jhaskinsPhD opened this issue Nov 6, 2023 · 4 comments · Fixed by #2061
Closed

Feature request: Add comments for units in KPP/commonIncludeVars.H #2029

jhaskinsPhD opened this issue Nov 6, 2023 · 4 comments · Fixed by #2061
Assignees
Labels
category: Feature Request New feature or request topic: Chemical Mechanisms Related to KPP and/or GEOS-Chem chemistry mechanisms

Comments

@jhaskinsPhD
Copy link
Contributor

Name and Institution (Required)

Name: Jessica Haskins
Institution: University of Utah

Description of your issue or question

Hi, I'm using the KPP files in creating my GEOS-Chem Emulator to generate F0AM compliant mechanisms based on past GEOS-Chem versions. In doing so, I need to make sure the units of all the global variables used in KPP rate functions are translated properly to F0AM, but the documentation of those global variables is a bit ambiguous in the commonIncludeVars.H, gckpp_Global.f90 and gckpp_Parameters.F90 files.

Could you let me know the units of the following variables & add that to the documentation of that file?

  • PRESS (assuming its hPa because that's what PMID & all StateMet pressure variables are in)
  • RELHUM (is this % or fraction?)
  • H2O (assuming is mole/mole?)
@yantosca
Copy link
Contributor

yantosca commented Nov 6, 2023

Thanks for writing @jhaskinsPhD. These are all set in routine Set_Kpp_Gridbox_Values in the GeosCore/fullchem_mod.F90 module:

    !========================================================================
    ! Populate global variables in gckpp_Global.F90
    !========================================================================

    ! Solar quantities
    SUNCOS          = State_Met%SUNCOSmid(I,J)

    ! Pressure and density quantities
    NUMDEN          = State_Met%AIRNUMDEN(I,J,L)
    H2O             = State_Met%AVGW(I,J,L) * NUMDEN
    PRESS           = Get_Pcenter( I, J, L )

    ! Temperature quantities
    TEMP            = State_Met%T(I,J,L)
    INV_TEMP        = 1.0_dp   / TEMP
    TEMP_OVER_K300  = TEMP     / 300.0_dp
    K300_OVER_TEMP  = 300.0_dp / TEMP
    SR_TEMP         = SQRT( TEMP )
    FOUR_R_T        = 4.0_dp * CON_R    * TEMP
    FOUR_RGASLATM_T = 4.0_dp * RGASLATM * TEMP
    EIGHT_RSTARG_T  = 8.0_dp * RSTARG   * TEMP

    ! Relative humidity quantities
    CONSEXP         = 17.2693882_dp * (TEMP - 273.16_dp) / (TEMP - 35.86_dp)
    VPRESH2O        = CONSVAP * EXP( CONSEXP ) / TEMP
    RELHUM          = ( H2O / VPRESH2O ) * 100_dp

PRESS is in hPa because that is what GEOS-Chem uses. I think it is only used for pressure-dependent rate-law reactions as specified in KPP/fullchem/fullchem_RateLawFuncs.F90. My guess is that the units shouldn't matter as long as you are consistent.

RELHUM looks like a fraction percent since it is multiplied by 100.

Also from Headers/state_met_mod.F90:

     REAL(fp), POINTER :: AIRNUMDEN     (:,:,:) ! Dry air density [molec/cm3]
     REAL(fp), POINTER :: AVGW          (:,:,:) ! Water vapor volume mixing
                                                !  ratio [vol H2O/vol dry air]

Lastly, H2O looks like it is in molec/cm3 (mixing ratio * number density).

We can add an update to the common IncludeVars.H to specifically list the units of these data.

@jhaskinsPhD
Copy link
Contributor Author

Thanks! A comment would be great so I can parse all future files to make the units are consistent in future versions!

@yantosca yantosca added category: Feature Request New feature or request topic: Chemical Mechanisms Related to KPP and/or GEOS-Chem chemistry mechanisms labels Nov 6, 2023
@yantosca yantosca self-assigned this Nov 6, 2023
@yantosca yantosca changed the title Units in KPP/comonInlucdeVars.H? Featurer equest: Add comments for units in KPP/comonInlucdeVars.H Nov 6, 2023
@yantosca yantosca changed the title Featurer equest: Add comments for units in KPP/comonInlucdeVars.H Featurer request: Add comments for units in KPP/comonInlucdeVars.H Nov 6, 2023
@yantosca
Copy link
Contributor

yantosca commented Nov 6, 2023

Thanks @jhaskinsPhD. I've updated the title of this issue to be a feature request so that it'll remind us to add the comments in. That can go into our "no-diff-to-benchmark" branch.

@yantosca yantosca changed the title Featurer request: Add comments for units in KPP/comonInlucdeVars.H Feature request: Add comments for units in KPP/comonInlucdeVars.H Nov 6, 2023
@yantosca yantosca changed the title Feature request: Add comments for units in KPP/comonInlucdeVars.H Feature request: Add comments for units in KPP/commonIncludeVars.H Nov 6, 2023
yantosca added a commit that referenced this issue Dec 5, 2023
This commit addresses issue #2029 by @jessicahaskins:

KPP/fullchem/commonIncludeVars.H
- Update units (in comment) for SR_MW in comment line
- Add units (in comment) for PRESS, RELHUM, SUNCOS, PHOTOL, H2O,
  K_STRAT, K_TROP, TROP

Signed-off-by: Bob Yantosca <[email protected]>
@yantosca yantosca linked a pull request Dec 5, 2023 that will close this issue
1 task
@yantosca
Copy link
Contributor

@jhaskinsPhD, I am closing out this issue since PR @2061 has been merged into the GEOS-Chem "no-diff-to-benchmark" development stream. It iwll be merged into a future version shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Feature Request New feature or request topic: Chemical Mechanisms Related to KPP and/or GEOS-Chem chemistry mechanisms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants