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

101 calculate no photolysis rate constants #183

Draft
wants to merge 51 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
@jimmielin
Copy link
Member

Hi @K20shores could you change the base branch of this PR to development? It seems like a lot of the diffs unrelated to this PR are showing in the changed files.

I'm happy to review once the PR is out of draft. Thanks!

@K20shores K20shores changed the base branch from main to development December 19, 2024 15:03
@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
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