Skip to content

101 calculate no photolysis rate constants #183

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

Draft
wants to merge 56 commits into
base: development
Choose a base branch
from

Conversation

K20shores
Copy link
Collaborator

@K20shores K20shores commented Dec 18, 2024

Closes #101

Also needed are these two PRs with the configuration files

There are a number of TODOs I still need to figure out, and I'm not really sure how to test this properly. The paper detailing the implemented algorithm doesn't seem to list individual values for Js, and I'm not sure what values they used for their extra terrestrial flux, but that could be a potential testing avenue if we thinks its worth me tracking down values from references.

cacraigucar and others added 30 commits August 15, 2024 12:48
Pull ZM 0.5 timestep removal into main
Replace original, locally-developed license with Apache 2.0 license.
Bring in development #108 (TUV-x) #112 (tropopause_find) to main
Bring in new directory structure from development
Upgrading to atmos_phys0_06_000
Tag name (The PR title should also include the tag name):
`atmos_phys0_07_000`
Originator(s): @jimmielin

List all `development` PR URLs included in this PR and a short
description of each:
* #141 by @mattldawson @boulderdaze 
* #147 by @peverwhee 
* #144 by @mwaxmonsky 
* #151 by @mattldawson 
* #145 by @jimmielin 

List all test failures: N/A
@K20shores K20shores marked this pull request as ready for review December 19, 2024 16:49
@cacraigucar cacraigucar removed their request for review January 27, 2025 23:18
@K20shores K20shores requested a review from boulderdaze February 6, 2025 20:20
@K20shores
Copy link
Collaborator Author

Right now there's a memory leak, but I found out that you can pair valgrind with gdb to identify leaks as the process is running.

  1. Build the docker file
    • From the top level docker build -t atmo -f test/docker/Dockerfile.musica.no_install --build-arg CAM_SIMA_CHEMISTRY_DATA_TAG=add_molecular_weight .
  2. Run the container and setup valgrind to wait for gdb
    • docker run --rm -it atmo
    • valgrind --vgdb=yes --vgdb-error=0 ./test_musica_api
  3. Grab the container id and execute a new shell in that container
    • docker ps, copy the ContainerID for the atmo image
    • Start a new shell in that container, docker exec -it 677e9af20b5f /bin/bash, replacing the ID with the one you copied
  4. Start gdb and make it target the valgrind process
    • gdb ./test_musica_api
    • Then, in the prompt, bring up the text user interface
      • tui enable
    • Then, target the valgrind process
      • target remote | vgdb
    • gdb is now connected to a running valgrind process. You can set breakpoints as you wish, or just type continue and gdb will pause whenever valgrind encounters and issue
    • I find it useful to place the two terminals side by side so that you can easily read the valgrind error message beside the source code displayed in gdb
    • Type kill within gdb to stop the valgrind process
    • You can inspect other options gdb now has from valgrind by typing monitor help
      • monitor leak_check will show what leaks exist where you are in the code right now if you're paused on a breakpoint

mattldawson and others added 6 commits February 11, 2025 08:22
Originator(s): Cheryl Craig 

Tag: atmos_phys0_08_000

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue
number):
Add ccpp'ized ZM - closes #66 

Describe any changes made to the namelist:
A       schemes/zhang_mcfarlane/zm_convr_namelist.xml
            - namelist template for ZM

List all files eliminated and why:  N/A


List all files added and what they do:
A       schemes/cloud_fraction/cloud_fraction_fice.F90
A       schemes/cloud_fraction/cloud_fraction_fice.meta
- Bring in the cloud_fraction_fice portion of the cloud_fraction CAM
code and CCPP'ize it

A       schemes/sima_diagnostics/zm_diagnostics.F90
A       schemes/sima_diagnostics/zm_diagnostics.meta
             - Add the main ZM diagnostics
             
A       schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90
A       schemes/sima_diagnostics/zm_convr_tendency_diagnostics.meta
A       schemes/sima_diagnostics/zm_evap_tendency_diagnostics.F90
A       schemes/sima_diagnostics/zm_evap_tendency_diagnostics.meta
A       schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.F90
A       schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.meta
A       schemes/sima_diagnostics/zm_tendency_diagnostics.F90
A       schemes/sima_diagnostics/zm_tendency_diagnostics.meta
             - Add ZM tendency diagnostics for each ZM component

A       schemes/utilities/to_be_ccppized_temporary.F90
A       schemes/utilities/to_be_ccppized_temporary.meta
- Add a temporary routine to house init methods which aren't being run
with to_be_ccppized code.
             - Add a call to wv_sat_init
             
A       schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.F90
A       schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.meta
A       schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.F90
A       schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta
- Add interstitials to move variables back and forth from the ZM deep
variables to general variables for the ZM routine which is used in
shallow convection as well
           
A       test/test_suites/suite_zhang_mcfarlane.xml
             - Suite to test ZM
             
A       to_be_ccppized/error_messages.F90
A       to_be_ccppized/namelist_utils.F90
A       to_be_ccppized/wv_sat_methods.F90
A       to_be_ccppized/wv_saturation.F90
- Add methods which ZM requires, but are not being CCPP-ized at this
point in time

List all existing files that have been modified, and describe the
changes:
(Helpful git command: git diff --name-status
development...<your_branch_name>)
M       doc/ChangeLog
M       doc/NamesNotInDictionary.txt
              - updated with ZM names

M       schemes/zhang_mcfarlane/zm_conv_convtran.F90
M       schemes/zhang_mcfarlane/zm_conv_convtran.meta
M       schemes/zhang_mcfarlane/zm_conv_evap.F90
M       schemes/zhang_mcfarlane/zm_conv_evap.meta
M       schemes/zhang_mcfarlane/zm_conv_momtran.F90
M       schemes/zhang_mcfarlane/zm_conv_momtran.meta
M       schemes/zhang_mcfarlane/zm_convr.F90
M       schemes/zhang_mcfarlane/zm_convr.meta
             - Further refinements needed to CCPP'ize ZM
             
M       suites/suite_cam7.xml
             - Add ZM routines to CAM7

List any test failures:

Is this a science-changing update? New physics package, algorithm
change, tuning changes, etc?
- CCPP'ized ZM which was a package which already existed in CAM

---------

Co-authored-by: Jesse Nusbaumer <[email protected]>
Co-authored-by: Haipeng Lin <[email protected]>
Co-authored-by: mwaxmonsky <[email protected]>
Originator(s): peverwhee

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue
number):
The sima_state_diagnostics scheme only output the "known" constituents.
This PR adds history add and out field calls for ALL other constituents.
I'm open to discussion about the diagnostic names for these!

Describe any changes made to the namelist: n/a

List all files eliminated and why: n/a

List all files added and what they do: n/a

List all existing files that have been modified, and describe the
changes:
(Helpful git command: `git diff --name-status
development...<your_branch_name>`)
M   schemes/sima_diagnostics/sima_state_diagnostics.F90
- add "history_add_field" and "history_out_field" calls for constituents
outside of the core expected ones.

List any test failures: all CAM-SIMA tests pass

Is this a science-changing update? New physics package, algorithm
change, tuning changes, etc? no - diagnostics update
Originator(s): @boulderdaze

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue
number):
- Closes #196
- Fixed bugs for the CAM-SIMA build

Describe any changes made to the namelist: 
```
M       schemes/musica/musica_ccpp_namelist.xml -> Specified the path to directory for the configuration
```

List all files eliminated and why: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the
changes:
```
M       schemes/musica/musica_ccpp.F90
M       schemes/musica/musica_ccpp.meta
M       schemes/musica/musica_ccpp_namelist.xml
M       schemes/musica/tuvx/musica_ccpp_tuvx.F90
M       schemes/musica/tuvx/musica_ccpp_tuvx_surface_albedo.F90
M       test/musica/test_musica_api.F90
```
List any test failures: N/A

Is this a science-changing update? New physics package, algorithm
change, tuning changes, etc? No
@mattldawson mattldawson marked this pull request as draft February 12, 2025 20:42
@K20shores K20shores marked this pull request as ready for review February 20, 2025 15:42
@K20shores K20shores marked this pull request as draft February 20, 2025 15:42
mattldawson and others added 5 commits February 20, 2025 12:38
…rmo_water_update) (#178)

Originator(s): @jimmielin

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue
number):

Closes #177, implementing thermo_water_update scheme to call
cam_thermo_water_update.

Describe any changes made to the namelist: N/A

List all files eliminated and why: N/A

List all files added and what they do:

Implement thermo_water_update scheme
A       schemes/thermo_water_update/thermo_water_update.F90
A       schemes/thermo_water_update/thermo_water_update.meta

List all existing files that have been modified, and describe the
changes:
(Helpful git command: `git diff --name-status
development...<your_branch_name>`)

Include thermo_water_update scheme in CAM7 suite and simple physics
suites
M       suites/suite_cam7.xml
M       suites/suite_kessler.xml
M       suites/suite_tj2016.xml

List any test failures:

Is this a science-changing update? New physics package, algorithm
change, tuning changes, etc? Yes

---------

Co-authored-by: Jesse Nusbaumer <[email protected]>
…name update (#169)

Originator(s): @jimmielin

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue
number):

* Fixes #161: Add check_energy related history output variables to check_energy_diagnostics
* Fixes #166: Need to remove old CAM suite definition files
* Fixes #176 (updates `teout` standard name to
`vertically_integrated_total_energy_using_dycore_energy_formula_at_end_of_physics_timestep`)

Companion PR in SIMA: ESCOMP/CAM-SIMA#339

Describe any changes made to the namelist: N/A

List all files eliminated and why:
```
Fix #166 to remove old SDF files from scoping exercise
D       suites/suite_cam4.xml
D       suites/suite_cam6.xml
D       suites/suite_cam6_silhs.xml
```

List all files added and what they do:
```
Add global energy fixer diagnostics (teinp, teout, tefix, efix) 
A       schemes/sima_diagnostics/check_energy_fix_diagnostics.F90
A       schemes/sima_diagnostics/check_energy_fix_diagnostics.meta
```


List all existing files that have been modified, and describe the
changes:
(Helpful git command: `git diff --name-status
development...<your_branch_name>`)
```
Move some developments to check_energy_fix_diagnostics so they can be called at right time.
M       schemes/sima_diagnostics/check_energy_diagnostics.F90
M       schemes/sima_diagnostics/check_energy_diagnostics.meta

Add call to check_energy_fix_diagnostics in schemes using global energy fixer:
M       suites/suite_adiabatic.xml
M       suites/suite_cam7.xml

Update teout standard name
M       doc/NamesNotInDictionary.txt
M       schemes/check_energy/check_energy_chng.meta
M       schemes/check_energy/check_energy_gmean/check_energy_gmean.meta
M       schemes/check_energy/check_energy_save_teout.meta
M       schemes/sima_diagnostics/check_energy_diagnostics.F90
M       schemes/sima_diagnostics/check_energy_diagnostics.meta
M       schemes/sima_diagnostics/check_energy_gmean_diagnostics.meta
```

List any test failures: N/A

Is this a science-changing update? New physics package, algorithm
change, tuning changes, etc? N/A (diagnostics change only)
…st (#204)

Originator(s): jimmielin

Description (include issue title and the keyword ['closes', 'fixes',
'resolves'] and issue number):

The FPHYStest test for Kessler in SIMA right now uses the same
`suite_kessler.xml` as FKESSLER, which means it includes
`physics_after_coupler` and other `check_energy` schemes we do not want
to include in the FPHYStest test which should only be testing
`kessler_tend`.

This PR includes a new `suite_kessler_test.xml` that removes all the
other schemes from the SDF and keeps only what we want to test, and
consistent with how the snapshots are taken in CAM:

```fortran
      if (trim(cam_take_snapshot_before) == "kessler_tend") then
         call cam_snapshot_all_outfld(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf)
      end if

      call kessler_tend(state, ptend, ztodt, pbuf)
      if ( (trim(cam_take_snapshot_after) == "kessler_tend") .and.            &
           (trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then
         call cam_snapshot_ptend_outfld(ptend, lchnk)
      end if
      call physics_update(state, ptend, ztodt, tend)

      if (trim(cam_take_snapshot_after) == "kessler_tend") then
         call cam_snapshot_all_outfld(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf)
      end if
```

List all namelist files that were added or changed: N/A

List all files eliminated and why: N/A

List all files added and what they do:
```
A       test/test_suites/suite_kessler_test.xml
  - new kessler_test suite
```

List all existing files that have been modified, and describe the
changes:
(Helpful git command: `git diff --name-status
development...<your_branch_name>`)
N/A

List all automated tests that failed, as well as an explanation for why
they weren't fixed:
N/A

Is this an answer-changing PR? If so, is it a new physics package,
algorithm change, tuning change, etc?
Yes for FPHYStest kessler test

If yes to the above question, describe how this code was validated with
the new/modified features:
BFB when using this suite
Originator(s): @mwaxmonsky 

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue
number): Adds pbl_utils capability from CAM.

Describe any changes made to the namelist: N/A

List all files eliminated and why: N/A

List all files added and what they do:
M phys_utils/atmos_phys_pbl_utils.F90
- Transferred all functionality (except for `compute_radf(...)`) from
ESCOMP/cam/src/physics/cam/pbl_utils.F90

M .github/workflows/unit-tests.yaml
- Added phys_utils to code coverage.

M test/unit-test/CMakeLists.txt
M test/unit-test/tests/CMakeLists.txt
M test/unit-test/tests/phys_utils/CMakeLists.txt
M test/unit-test/tests/phys_utils/test_atmos_pbl_utils.pf
- Creating CMake target library for `phys_utils` and adding sample unit
tests.


List all existing files that have been modified, and describe the
changes: N/A
(Helpful git command: `git diff --name-status
development...<your_branch_name>`)

List any test failures: N/A

Is this a science-changing update? New physics package, algorithm
change, tuning changes, etc? No

---------

Co-authored-by: Jesse Nusbaumer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calculate NO photolysis rate constants
8 participants