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

Add function for NO photolysis calculation #191

Merged

Conversation

boulderdaze
Copy link
Collaborator

No description provided.

@boulderdaze boulderdaze changed the title Add function for no photolysis calculation Add function for NO photolysis calculation Jan 24, 2025
Comment on lines +181 to +182
real(dk) :: delta_z(size(dry_air_density)+1) ! layer thickness (cm)
real(dk) :: jNO(size(dry_air_density)) ! final photolysis rate
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @K20shores, @mattldawson, what do you think about renaming these variables such as?
delta_z ->layer_thickness
jNO-> photolysis_rate_NO

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like that

Comment on lines +189 to +201
N2_densities(1) = N2_densities(2) * 0.9_dk

call convert_mixing_ratio_to_molecule_cm3(constituents(:,O2_index), dry_air_density, molar_mass_O2, o2_dens(2:))
o2_dens(1) = o2_dens(2) * 7.0_dk / ( height_at_interfaces(1) - height_at_interfaces(2) )
call convert_mixing_ratio_to_molecule_cm3(constituents_O2, &
dry_air_density, MOLAR_MASS_O2, O2_densities(2:))
O2_densities(1) = O2_densities(2) * 7.0_dk / ( height_at_interfaces(1) - height_at_interfaces(2) )

call convert_mixing_ratio_to_molecule_cm3(constituents(:,O3_index), dry_air_density, molar_mass_O3, o3_dens(2:))
o3_dens(1) = o3_dens(2) * 7.0_dk / ( height_at_interfaces(1) - height_at_interfaces(2) )
call convert_mixing_ratio_to_molecule_cm3(constituents_O3, &
dry_air_density, MOLAR_MASS_O3, O3_densities(2:))
O3_densities(1) = O3_densities(2) * 7.0_dk / ( height_at_interfaces(1) - height_at_interfaces(2) )

call convert_mixing_ratio_to_molecule_cm3(constituents(:,NO_index), dry_air_density, molar_mass_NO, no_dens(2:))
no_dens(1) = no_dens(2) * 0.9_dk
call convert_mixing_ratio_to_molecule_cm3(constituents_NO_photolysis(:,index_NO), &
dry_air_density, MOLAR_MASS_NO, NO_densities(2:))
NO_densities(1) = NO_densities(2) * 0.9_dk
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @mattldawson, @K20shores, I checked that in the CAM code, these (7.0_dk, 0.9_dk, and so on) also appear to be magic numbers without explanation. Is there a way to figure out what they represent so we can define them as constexpr variables?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I also don't know. I wonder if they are scale heights, but I don't understand why they would be different. The original paper also didn't really indicate anything about this. We may have to ask Doug.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great, I asked him about it

@boulderdaze boulderdaze requested a review from K20shores January 24, 2025 19:37
@boulderdaze boulderdaze marked this pull request as ready for review January 24, 2025 19:48
@boulderdaze boulderdaze merged commit 5399a16 into 101-calculate-no-photolysis-rate-constants Jan 24, 2025
3 checks passed
@boulderdaze boulderdaze deleted the 101-no_photolysis branch January 24, 2025 20:32
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.

2 participants