Fix hardcoded rair (287.04) in bulk and modal aerosol state modules (#542) - #551
johnpaulalex wants to merge 3 commits into
Conversation
Replace hardcoded 287.04_r8 dry air gas constant literals in bulk_aerosol_state_mod.F90 and modal_aerosol_state_mod.F90 with rair imported from physconst. Assisted-by: gemini-3.6-flash
Assisted-by: gemini-3.6-flash
|
Thanks @johnpaulalex for working on this issue! With the abstract aerosol interface modules, we're trying to get rid (eventually) of all host model dependencies so it would be best if we threaded through CAM-SIMA/src/aerosol/modal_aerosol_state_mod.F90 Lines 66 to 74 in 3db176f I realize that's a much bigger change surface as then it requires changes on the atmos_phys side, so we might want to survey the callers first and see how many call sites are needed for the paired ESCOMP/atmospheric_physics PR. |
… physconst (ESCOMP#542) Pass dry air gas constant (rair) as an intent(in) argument into aero_surf_area_dens and its implementations, removing 'use physconst' from aerosol state modules to decouple host-model dependencies. Assisted-by: gemini-3.6-flash
|
Hey @jimmielin makes sense. I updated the CAM-SIMA code...but I can't find any prod callers of the method, including in ESCOMP/atmospheric_physics: https://github.com/search?q=repo%3AESCOMP%2Fatmospheric_physics+surf_area_dens&type=code ...but that search did surface a seemingly relevant issue ESCOMP/atmospheric_physics#446, which sounds like it wants to use that function in the future...am I missing something? |
|
oh and the linter CI is failing but iiuc it's linting all lines, not just the deltas. lmk if there's something for me to fix here. |
Tag name (required for release branches): N/A
Originator(s): @johnpaulalex
AI tools used (if applicable; please also add the "AI-generated code" label to the PR):
What: Gemini 3.6 Flash
How: Assisted with repository audit, worktree creation, Fortran refactoring, test execution, and drafting PR documentation.
Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number):
287.04_r8dry air gas constant literals inbulk_aerosol_state_mod.F90andmodal_aerosol_state_mod.F90withrairimported fromphysconst.Describe any changes made to build system: N/A
Describe any changes made to the namelist: N/A
List any changes to the defaults for the input datasets (e.g. boundary datasets): 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>)If there are new failures (compared to the
test/existing-test-failures.txtfile), have them OK'd by the gatekeeper, note them here, and add them to the file.If there are baseline differences, include the test and the reason for the diff. What is the nature of the change? Roundoff?
pytest test/unit/): 151 passed.test_bad_registry_xmlfails when executed locally on macOS withlibxml22.11+ due toxmllintomitting theelement <name>:prefix in schema validation output. The test passes on HPC/Linux CI environments runninglibxml22.9.x.rairinphysconstequals 287.04 J/kg/K viashr_const_rdair).If this changes climate describe any run(s) done to evaluate the new climate in enough detail that it(they) could be reproduced: N/A
CAM-SIMA date used for the baseline comparison tests if different than latest: N/A