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

cam6_4_025: Aerosol deposition fluxes #1096

Merged
merged 10 commits into from
Aug 28, 2024

Conversation

fvitt
Copy link

@fvitt fvitt commented Jul 19, 2024

This repartitions the modal dust deposition fluxes into 4 bulk bins for passing to the surface models. The aerosol fluxes code was refactored in a generalized way which can easily be expanded for other aerosol representations, such as CARMA.

Closes #1060

        new file:   src/chemistry/aerosol/aero_deposition_cam.F90
        modified:   src/chemistry/aerosol/aero_deposition_cam.F90
        modified:   src/chemistry/aerosol/aerosol_properties_mod.F90
        modified:   src/chemistry/aerosol/modal_aerosol_properties_mod.F90
        modified:   src/chemistry/modal_aero/aero_model.F90
…anup

        modified:   src/chemistry/aerosol/aero_deposition_cam.F90
        modified:   src/chemistry/aerosol/modal_aerosol_properties_mod.F90
        modified:   src/chemistry/modal_aero/aero_model.F90
        modified:   src/chemistry/aerosol/modal_aerosol_properties_mod.F90
@fvitt fvitt added the answer changing answer changing tag label Jul 19, 2024
@fvitt fvitt requested a review from cacraigucar July 19, 2024 14:08
@fvitt fvitt self-assigned this Jul 19, 2024
@fvitt
Copy link
Author

fvitt commented Jul 19, 2024

This has yet to be tested and evaluated.

        modified:   src/chemistry/modal_aero/aero_model.F90
@cacraigucar cacraigucar marked this pull request as ready for review August 27, 2024 15:16
Comment on lines 254 to 261
do ispec=1,bcphi_cnt
cam_out%bcphidry(i) = cam_out%bcphidry(i) &
+ (aerdepdryis(i,bcphi_ndx(ispec))+aerdepdrycw(i,bcphi_ndx(ispec)))
enddo
do ispec=1,bcpho_cnt
cam_out%bcphodry(i) = cam_out%bcphodry(i) &
+ (aerdepdryis(i,bcpho_ndx(ispec))+aerdepdrycw(i,bcpho_ndx(ispec)))
enddo
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps adding a comment above each of these loops (and for the group below) that differentiates what each loop is doing. At first I thought I'd found a bug, before I realized you were doing a two pass calculation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments

Comment on lines 301 to 308
if (cam_out%bcphidry(i) .lt. 0._r8) cam_out%bcphidry(i) = 0._r8
if (cam_out%ocphidry(i) .lt. 0._r8) cam_out%ocphidry(i) = 0._r8
if (cam_out%bcphodry(i) .lt. 0._r8) cam_out%bcphodry(i) = 0._r8
if (cam_out%ocphodry(i) .lt. 0._r8) cam_out%ocphodry(i) = 0._r8
if (cam_out%dstdry1(i) .lt. 0._r8) cam_out%dstdry1(i) = 0._r8
if (cam_out%dstdry2(i) .lt. 0._r8) cam_out%dstdry2(i) = 0._r8
if (cam_out%dstdry3(i) .lt. 0._r8) cam_out%dstdry3(i) = 0._r8
if (cam_out%dstdry4(i) .lt. 0._r8) cam_out%dstdry4(i) = 0._r8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CAM guidelines say "should" use < instead of .lt. . This is at your discretion since it is a "should" and not a "must"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

do l = 1,self%nspecies(m)
mm = self%indexer(m,l)
call self%get(m,l, spectype=spectype, density=dns_dst) ! kg/m3
if (spectype==bulk_type) then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it is doable (an error or not) to capture if no matches occur with spectype==bulk_type. I'm thinking of whether it is worth trying to capture a typo or completely incorrect name for bulk_type

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could probably implement an error code and error string that get returned by the subroutine if you think it is worth while. As it is now, if the specified bulk_type is not valid then the fluxes returned are zeros.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that the fluxes will be zero, but I'm not sure if it would be readily apparent to a user that they had a typo or invalid name as zero fluxes might be pretty subtle in a run. It really is your call - I am just pointing this out for your consideration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added error checking

@cacraigucar cacraigucar changed the title Aerosol deposition fluxes cam6_4_025?: Aerosol deposition fluxes Aug 27, 2024
@cacraigucar cacraigucar changed the title cam6_4_025?: Aerosol deposition fluxes cam6_4_025: Aerosol deposition fluxes Aug 28, 2024
        modified:   src/chemistry/aerosol/aero_deposition_cam.F90
        modified:   src/chemistry/aerosol/aerosol_properties_mod.F90
        modified:   src/chemistry/aerosol/modal_aerosol_properties_mod.F90
@fvitt fvitt merged commit 2f8ec4d into ESCOMP:cam_development Aug 28, 2024
2 checks passed
gold2718 pushed a commit to gold2718/CAM that referenced this pull request Oct 16, 2024
Merge pull request ESCOMP#1096 from fvitt/aerosol_deposition_fluxes

cam6_4_025: Aerosol deposition fluxes

ESCOMP commit: 2f8ec4d
gold2718 pushed a commit to gold2718/CAM that referenced this pull request Oct 16, 2024
Merge pull request ESCOMP#1096 from fvitt/aerosol_deposition_fluxes

cam6_4_025: Aerosol deposition fluxes

ESCOMP commit: 2f8ec4d
gold2718 pushed a commit to gold2718/CAM that referenced this pull request Nov 8, 2024
Merge pull request ESCOMP#1096 from fvitt/aerosol_deposition_fluxes

cam6_4_025: Aerosol deposition fluxes

ESCOMP commit: 2f8ec4d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answer changing answer changing tag chill
Projects
Status: Tag
Development

Successfully merging this pull request may close these issues.

2 participants