Skip to content

Commit

Permalink
remove P_frozen variable
Browse files Browse the repository at this point in the history
  • Loading branch information
tangwhiap committed Dec 11, 2024
1 parent f6fd949 commit 45fc988
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 37 deletions.
2 changes: 1 addition & 1 deletion scenarios/7_freezing/0_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tang, W. (2024). Particle-resolved simulations of immersion freezing with multi-

This is a scenario demonstrating how to use PartMC to simulate the immersion freezing process of multiple species INPs.

There are a total of 4*2=8 simulation groups, consisting of four types of INP populations and two temperature curve scenarios. The four types of INPs are 100% illite, 100% Fe2O3, a 50% illite and 50% Fe2O3 external mixture, and an internal mixture. The two temperature curves are a constant -20 degrees Celsius and a steady cooling from -10 to -30 degrees Celsius. The simulation time for each is 10 minutes.
There are a total of 4*2=8 simulation groups, consisting of four types of INP populations and two temperature curve scenarios. The four types of INPs are 100% illite, 100% Fe2O3, a 50% illite and 50% Fe2O3 external mixture, and an internal mixture. The two temperature curves are a constant -20 degrees Celsius and a steady cooling from -10 to -30 degrees Celsius. The simulation time for each is 10 minutes. All immersion freezing simulations are using the ABIFM scheme.

exp1: 100% illite, constant temperature
exp2: 100% Fe2O3, constant temperature
Expand Down
7 changes: 0 additions & 7 deletions scenarios/7_freezing/1_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ fi

cp -rp $setDir $outDir/


#if [ -e "output" ]; then
# unlink output
#fi
#ln -sf $outDir output

for expName in exp1 exp2 exp3 exp4 exp5 exp6 exp7 exp8
do
caseName=${expName}
Expand All @@ -32,6 +26,5 @@ do
sleep 1

../../build/partmc run_part.spec
#mv freezing_timing.txt output/$caseName

done
17 changes: 0 additions & 17 deletions src/aero_particle.F90
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ module pmc_aero_particle
logical :: frozen
!> Immersion freezing temperature (K).
real(kind=dp) :: imf_temperature
!> Ice-phase probability (1).
real(kind=dp) :: P_frozen
!> Ice density (kg m^{-3}).
real(kind=dp) :: den_ice
!> Ice shape.
Expand Down Expand Up @@ -108,7 +106,6 @@ subroutine aero_particle_shift(aero_particle_from, aero_particle_to)
aero_particle_from%greatest_create_time
aero_particle_to%frozen = aero_particle_from%frozen
aero_particle_to%imf_temperature = aero_particle_from%imf_temperature
aero_particle_to%P_frozen = aero_particle_from%P_frozen
aero_particle_to%den_ice = aero_particle_from%den_ice
aero_particle_to%ice_shape_phi = aero_particle_from%ice_shape_phi
aero_particle_to%n_primary_parts = aero_particle_from%n_primary_parts
Expand Down Expand Up @@ -148,7 +145,6 @@ subroutine aero_particle_zero(aero_particle, aero_data)
aero_particle%greatest_create_time = 0d0
aero_particle%frozen = .FALSE.
aero_particle%imf_temperature = 0d0
aero_particle%P_frozen = 0d0
aero_particle%den_ice = -9999d0
aero_particle%ice_shape_phi = -9999d0
aero_particle%n_primary_parts = 0
Expand Down Expand Up @@ -1005,8 +1001,6 @@ subroutine aero_particle_coagulate(aero_particle_1, &
!!! Not true, need further discussion
aero_particle_new%imf_temperature = max(aero_particle_1%imf_temperature, &
aero_particle_2%imf_temperature)
aero_particle_new%P_frozen = 1 - (1 - aero_particle_1%P_frozen) &
* (1 - aero_particle_2%P_frozen)

if (aero_particle_new%frozen) then
ice_vol_1 = aero_particle_1%vol(aero_data%i_water)
Expand Down Expand Up @@ -1076,13 +1070,10 @@ integer function pmc_mpi_pack_size_aero_particle(val)
+ pmc_mpi_pack_size_integer(aero_particle_n_components(val)) &
+ pmc_mpi_pack_size_real(val%least_create_time) &
+ pmc_mpi_pack_size_real(val%greatest_create_time) &
!<<<<<<< HEAD
+ pmc_mpi_pack_size_logical(val%frozen) &
+ pmc_mpi_pack_size_real(val%imf_temperature) &
+ pmc_mpi_pack_size_real(val%P_frozen) &
+ pmc_mpi_pack_size_real(val%den_ice) &
+ pmc_mpi_pack_size_real(val%ice_shape_phi) &
!=======
+ pmc_mpi_pack_size_integer(val%n_primary_parts)

do i = 1,aero_particle_n_components(val)
Expand Down Expand Up @@ -1127,15 +1118,11 @@ subroutine pmc_mpi_pack_aero_particle(buffer, position, val)
end do
call pmc_mpi_pack_real(buffer, position, val%least_create_time)
call pmc_mpi_pack_real(buffer, position, val%greatest_create_time)
!<<<<<<< HEAD
call pmc_mpi_pack_logical(buffer, position, val%frozen)
call pmc_mpi_pack_real(buffer, position, val%imf_temperature)
call pmc_mpi_pack_real(buffer, position, val%P_frozen)
call pmc_mpi_pack_real(buffer, position, val%den_ice)
call pmc_mpi_pack_real(buffer, position, val%ice_shape_phi)
!=======
call pmc_mpi_pack_integer(buffer, position, val%n_primary_parts)
!>>>>>>> 2341ef410d6f49f3169b8461b5fa8c89dbd3c7a2
call assert(810223998, position - prev_position &
<= pmc_mpi_pack_size_aero_particle(val))
#endif
Expand Down Expand Up @@ -1178,15 +1165,11 @@ subroutine pmc_mpi_unpack_aero_particle(buffer, position, val)
end do
call pmc_mpi_unpack_real(buffer, position, val%least_create_time)
call pmc_mpi_unpack_real(buffer, position, val%greatest_create_time)
!<<<<<<< HEAD
call pmc_mpi_unpack_logical(buffer, position, val%frozen)
call pmc_mpi_unpack_real(buffer, position, val%imf_temperature)
call pmc_mpi_unpack_real(buffer, position, val%P_frozen)
call pmc_mpi_unpack_real(buffer, position, val%den_ice)
call pmc_mpi_unpack_real(buffer, position, val%ice_shape_phi)
!=======
call pmc_mpi_unpack_integer(buffer, position, val%n_primary_parts)
!>>>>>>> 2341ef410d6f49f3169b8461b5fa8c89dbd3c7a2
call assert(287447241, position - prev_position &
<= pmc_mpi_pack_size_aero_particle(val))
#endif
Expand Down
9 changes: 0 additions & 9 deletions src/aero_state.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2645,7 +2645,6 @@ subroutine aero_state_output_netcdf(aero_state, ncid, aero_data, &
integer(kind=8) :: aero_id(aero_state_n_part(aero_state))
integer :: aero_frozen(aero_state_n_part(aero_state))
real(kind=dp) :: aero_imf_temperature(aero_state_n_part(aero_state))
real(kind=dp) :: aero_frozen_probability(aero_state_n_part(aero_state))
real(kind=dp) :: aero_ice_density(aero_state_n_part(aero_state))
real(kind=dp) :: aero_ice_shape_phi(aero_state_n_part(aero_state))
real(kind=dp) :: aero_least_create_time(aero_state_n_part(aero_state))
Expand Down Expand Up @@ -2814,7 +2813,6 @@ subroutine aero_state_output_netcdf(aero_state, ncid, aero_data, &
end if
aero_imf_temperature(i_part) &
= aero_state%apa%particle(i_part)%imf_temperature
aero_frozen_probability(i_part) = aero_state%apa%particle(i_part)%P_frozen
aero_ice_density(i_part) = aero_state%apa%particle(i_part)%den_ice
aero_ice_shape_phi(i_part) &
= aero_state%apa%particle(i_part)%ice_shape_phi
Expand Down Expand Up @@ -2885,9 +2883,6 @@ subroutine aero_state_output_netcdf(aero_state, ncid, aero_data, &
call pmc_nc_write_real_1d(ncid, aero_imf_temperature, &
"aero_imf_temperature", (/ dimid_aero_particle /), &
long_name="immersion freezing temperature (Singular)")
call pmc_nc_write_real_1d(ncid, aero_frozen_probability, &
"aero_frozen_probability", (/ dimid_aero_particle /), &
long_name="probability of freezing describing the group of real aerosols represented by each computational particle")
call pmc_nc_write_real_1d(ncid, aero_ice_density, &
"aero_ice_density", (/ dimid_aero_particle /), &
long_name="Ice density if the particle nucleates to ice, -9999 indicates the particle is not an ice.")
Expand Down Expand Up @@ -3090,7 +3085,6 @@ subroutine aero_state_input_netcdf(aero_state, ncid, aero_data)
real(kind=dp), allocatable :: aero_num_conc(:)
integer, allocatable :: aero_frozen(:)
real(kind=dp), allocatable :: aero_imf_temperature(:)
real(kind=dp), allocatable :: aero_frozen_probability(:)
real(kind=dp), allocatable :: aero_ice_density(:)
real(kind=dp), allocatable :: aero_ice_shape_phi(:)
integer(kind=8), allocatable :: aero_id(:)
Expand Down Expand Up @@ -3163,8 +3157,6 @@ subroutine aero_state_input_netcdf(aero_state, ncid, aero_data)
"aero_frozen")
call pmc_nc_read_real_1d(ncid, aero_imf_temperature, &
"aero_imf_temperature")
call pmc_nc_read_real_1d(ncid, aero_frozen_probability, &
"aero_frozen_probability", must_be_present=.false.)
call pmc_nc_read_real_1d(ncid, aero_ice_density, &
"aero_ice_density", must_be_present=.false.)
call pmc_nc_read_real_1d(ncid, aero_ice_shape_phi, &
Expand Down Expand Up @@ -3226,7 +3218,6 @@ subroutine aero_state_input_netcdf(aero_state, ncid, aero_data)
aero_particle%frozen = .False.
end if
aero_particle%imf_temperature = aero_imf_temperature(i_part)
aero_particle%P_frozen = aero_frozen_probability(i_part)
aero_particle%den_ice = aero_ice_density(i_part)
aero_particle%ice_shape_phi = aero_ice_shape_phi(i_part)
aero_particle%least_create_time = aero_least_create_time(i_part)
Expand Down
3 changes: 0 additions & 3 deletions src/ice_nucleation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,6 @@ subroutine immersion_freezing_time_dependent_naive(aero_state, aero_data, &
IMMERSION_FREEZING_SCHEME_CONST) then
p_freeze = 1 - exp(freezing_rate * del_t)
end if
p_frozen = aero_state%apa%particle(i_part)%P_frozen
aero_state%apa%particle(i_part)%P_frozen = 1 - (1 - p_frozen) &
* (1 - p_freeze)

if (rand < p_freeze) then
aero_state%apa%particle(i_part)%frozen = .TRUE.
Expand Down

0 comments on commit 45fc988

Please sign in to comment.