Skip to content

Conversation

@tangwhiap
Copy link
Collaborator

Add the immersion freezing simulation codes, freezing test case, and freezing scenario.

tangwhiap and others added 30 commits August 29, 2023 15:24
Copy link
Collaborator

@jcurtis2 jcurtis2 left a comment

Choose a reason for hiding this comment

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

Just a few more things I've noted while taking a pass through for PyPartMC.


!> compute saturated vapor pressure (units : Pa) with respective to water
!> Formula (10) from [Murphy & Koop, 2004] (https://doi.org/10.1256/qj.04.94)
real(kind=dp) function env_state_saturated_vapor_pressure_water(T)
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 wonder why env_state isn't passed to this function given it is an env_state function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because this function only requires the temperature, T is the only necessary input. I thought you had previously suggested that I use T instead of env_state as the input—should I change it back to env_state?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, you are right - I see where I suggested that. This was probably the simplest suggestion at the time as you had two functions that did the same thing (which isn't a great idea), one taking temperature and the other taking env_state.

I think that made this pretty confusing and in hindsight, we probably should apply a different fix. Not 100% sure what it should be at the moment.

The fact is, that all env_state functions take env_state as an input so this function is an outlier. So I think we need it to take env_state. However we also shouldn't have two functions that do exactly the same thing.

Two paths that I can think of:

  • Make an env_state in the theoretical_freezing.F90 code and then call those functions by passing an env_state that has it the temperature set. Then switch to have env_state as the input rather than temperature.
  • A function that takes env_state that is just a wrapper to call another function that just takes temperature (and this function name shouldn't start with env_state). However, I don't know that we have any cases in the code that does something quite like that. And I'm not quite sure what file this function would actually exist in (it doesn't quite feel like it belongs in util.F90).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for your reply! I prefer the second approach since it wouldn’t complicate theoretical_freezing.F90. However, it would still be somewhat of an outlier. We can discuss this further.

src/run_part.F90 Outdated
if (run_part_opt%do_immersion_freezing .and. &
(run_part_opt%immersion_freezing_scheme_type .eq. &
IMMERSION_FREEZING_SCHEME_SINGULAR)) then
call ice_nucleation_singular_initialize(aero_state, aero_data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is now not yet called if using timestep or timeblock variants -> should be moved to the timestep logic

tangwhiap and others added 4 commits September 14, 2025 18:41
Co-authored-by: Jeffrey Curtis <jcurtis2@illinois.edu>
Co-authored-by: Jeffrey Curtis <jcurtis2@illinois.edu>
@slayoo
Copy link
Collaborator

slayoo commented Sep 15, 2025

closing and reopening to trigger codecov analysis in further commits

@slayoo slayoo closed this Sep 15, 2025
@slayoo slayoo reopened this Sep 15, 2025
@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

❌ Patch coverage is 92.99363% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.40%. Comparing base (7e7ac4c) to head (6d962a3).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/aero_particle.F90 66.66% 10 Missing ⚠️
src/ice_nucleation.F90 94.64% 9 Missing ⚠️
src/aero_data.F90 87.50% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #205       +/-   ##
===========================================
+ Coverage        0   77.40%   +77.40%     
===========================================
  Files           0       55       +55     
  Lines           0     9427     +9427     
===========================================
+ Hits            0     7297     +7297     
- Misses          0     2130     +2130     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

add_test(test_tchem ${CMAKE_BINARY_DIR}/test_run/run_test_directory.sh tchem)
endif()
add_test(test_weighting ${CMAKE_BINARY_DIR}/test_run/run_test_directory.sh weighting)
#>>>>>>> 2341ef410d6f49f3169b8461b5fa8c89dbd3c7a2
Copy link
Collaborator

Choose a reason for hiding this comment

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

this seems to be a merge-conflict leftover to be removed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

would it be better to make it a part of the web-publishable doxygen html?

Copy link
Collaborator

Choose a reason for hiding this comment

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

IIUC, the lack of these additions was not detected by CI, it would be great to add a mechanism at least parsing all the scenario input on CI

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, this is a fairly common occurrence. The urban_plume scenarios are often fixed but the scenarios that often require more libraries (SUNDIALs for condense, CAMP) are often overlooked. This is often as simple as missing a spec file line change/addition. In this case, it would be a lack of adding things in aero_data.dat for most scenarios or a more special case in terms of the CAMP scenario. The CAMP test caught this, it was fixed in the test but not in the scenario til later.

I think that something that simply attempts to run a 0 second simulation will work in terms of reading in all inputs.

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.

4 participants