-
Notifications
You must be signed in to change notification settings - Fork 175
Refactor rad_constituents, aerosol_optics_cam for portability; extend abstract aerosol interface #1506
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
Open
jimmielin
wants to merge
25
commits into
ESCOMP:cam_development
Choose a base branch
from
jimmielin:hplin/rad_cnst_refactor_5_optics
base: cam_development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refactor rad_constituents, aerosol_optics_cam for portability; extend abstract aerosol interface #1506
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ebe3194
rad_cnst/aerosol abstract interface refactor and extension phases 1 t…
jimmielin c6430f1
fixup! phys_state subsetting cannot be assumed shape for chunking
jimmielin 60811a3
cleanup: use public active_calls; clean use statements
jimmielin 48871c6
Refactor aerosol_optics_cam to extract portable aerosol_optics_core
jimmielin 5f200d9
Unify names for aerosol_mmr_cam to make port easier to CAM-SIMA.
jimmielin 9ac36dd
Clarify num_to_mass_aer, dryrad for modal, sectional; fix null pointe…
jimmielin 73aa9d2
Sync radiative_aerosol_definitions.F90 with version in CAM-SIMA
jimmielin a78c9aa
Address review comments
jimmielin d68d2d8
Remove strange dash that crept into comments
jimmielin 7103f75
Fix and update comments throughout.
jimmielin 867ddfb
Use pointer optional argument as suggested by @fvitt; update comment …
jimmielin c750e8c
Merge branch 'cam_development' into hplin/rad_cnst_refactor_5_optics
jimmielin 545ddbf
Remove dead code in modal_aero_data (migrated into modal_aerosol_state)
jimmielin 73c8831
Fix palb, pasm comment? in aerosol_optics_mod.F90
jimmielin 26a6dea
Merge branch 'cam_development' into hplin/rad_cnst_refactor_5_optics
jimmielin 372fa29
Address review comments
jimmielin 7442ca0
Update src/chemistry/aerosol/aerosol_state_mod.F90
jimmielin 1f0e160
Update src/physics/cam/nucleate_ice_cam.F90
jimmielin 4f190f0
Update src/chemistry/aerosol/aerosol_state_mod.F90
jimmielin cf78638
generalized optics_params method instead of concrete duplicate implem…
jimmielin c6fbc25
remove modal_aero_data dependency in modal_aero_state_mod: refactor c…
jimmielin ec0784f
Fix typo throughout
jimmielin f9591e1
Merge branch 'cam_development' into hplin/rad_cnst_refactor_5_optics
jimmielin a8d344c
Apply list_idx changes to new code in cam6_4_162
jimmielin 5819264
Fix bin_ndx -> bin_idx (this module mixes both)
jimmielin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we
deallocatebeforenullifyto prevent memory leaks?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the question. For most modules excluding
microp_aero.F90(which has intermediatestate1updates) the aerosol properties and aerosol state modules are persistently allocated byaerosol_instances_mod.F90:https://github.com/jimmielin/CAM/blob/hplin/rad_cnst_refactor_5_optics/src/chemistry/aerosol/aerosol_instances_mod.F90
so the
aero_wetdep_cam.F90'saero_stateis just pointing to that persistent state:https://github.com/jimmielin/CAM/blob/hplin/rad_cnst_refactor_5_optics/src/chemistry/aerosol/aero_wetdep_cam.F90
at the end of the subroutine it only has to be
nullify()'d but the state should not be deallocated as it is managed byaerosol_instances_mod.F90.In the future in CAM-SIMA
aero_state,aero_propswill be provided as subroutine input pointers so the nullify will also not be necessary. (and the chunk dimension will also be gone.)Differently, in
microp_aero.F90, because ofaero_staterequiring access tostate1and notstate(since there are aerosol tendencies in ice nucleation) it is created withinmicrop_aero_run:thus there is a destructor call at the end that deallocates the state object:
! destroy all aerosol state objects created for this chunk nullify(aero_state1_obj) call aerosol_instances_destroy_states(aero_states1)https://github.com/jimmielin/CAM/blob/hplin/rad_cnst_refactor_5_optics/src/physics/cam/microp_aero.F90
In CAM-SIMA there won't be "intermediate states" like this (instead they're split into separate schemes running sequentially and the tendencies are updated in-between) so in the CAM-SIMA implementation there will be no
aerosol_instances_{create,destroy}_states: subroutines do not need to manage aero_props/aero_state anymore and they are all just passed as input pointers