Repository navigation
Aerosol interaction vn14.2 - #20
paulfield2024 wants to merge 13 commits into
Conversation
…_max_mact Ports the CASIM SVN branch dev/paulfield/um13.9_um13.9_casim_max_mact@12572 (created from casim/trunk@11952) onto the vn14.1 baseline. Changes: - aerosol_routines: increase max mean activated mass threshold, aerosol tidyup, handle zeros in aerosol - activation: replace erfg/casim_erfc with intrinsic erf/erfc - sedimentation: add limits for aerosol sedimentation - mphys_tidy: aerosol tidy-up rework - special: minor supporting change
|
This PR is linked to UM PR Summary of changes on
|
…/casim into aerosol_interaction_vn14.2 # Conflicts: # CONTRIBUTORS.md
…e dependent procs, ice_deposition clipping, activate_in_cloud/imethod tweaks Some of the content of this file has been produced with the assistance of Claude Opus5 and Claude Sonnet 5
2df5bec to
19040a8
Compare
…aling, ensure_positive dependent procs, ice_deposition clipping, activate_in_cloud/imethod tweaks Some of the content of this file has been produced with the assistance of Claude Opus5 and Claude Sonnet 5
Anthony Jones (ajones244)
left a comment
There was a problem hiding this comment.
Very small changes CASIM side. These are mostly bugfixes for a non-operational setup (aerosol-cloud coupling). I've followed the logic and it makes sense. There is a decision to revert to default ARG activation.
| alpha = 9.8*(LvT/(eps*cp*T)-1.0)/(T*Rd)*(1-ent_fraction) | ||
|
|
||
| smax_cloud= alpha*w*tau | ||
| smax_cloud= MIN(0.10, alpha*w*tau) !limit to 10% |
There was a problem hiding this comment.
Will this change results in any operational configuration e.g. RAL3?
There was a problem hiding this comment.
Just to comment, smax_cloud is the maximum supersaturation, we would not expect this to be greater than 10% (over marine regions, this is ~5%)
| use lognormal_funcs, only: MNtoRm ! DPG - added this for MNtoRm since was | ||
| ! causing circular conflicts as wanted | ||
| ! to use it in which_mode_to_use.F90 | ||
| USE umprintmgr, ONLY: umPrint, umMessage |
There was a problem hiding this comment.
I think this can be removed, the only call to umMessage is commented out
| ! CALL umPrint( umMessage) | ||
| aeroact(k)%mact_mean=min(aero_mact_mean_max, aeroact(k)%mact_mean) | ||
| ! aeroact(k)%mact=aero_mact_mean_max*aeroact(k)%nact | ||
| ! mac=aeroact(k)%mact |
There was a problem hiding this comment.
suggest removing these commented out lines to improve readability?
| aerosol_procs(iq, id)%column_data(k)= & | ||
| aerosol_procs(iq, id)%column_data(k)*ratio | ||
| end do | ||
| end if |
There was a problem hiding this comment.
This reformulates the mass conservation by calculating the ratio of total aerosol / aerosol lost or gained and then ensuring this lies between 0 and 1 (to avoid negative aerosol) and scaling accordingly
| !============================ | ||
| if (l_ased .and. l_da_local) then | ||
| if (params%id == cloud_params%id) then | ||
| dmac=(flux_n2(k+1)*aeroact(k+1)%nratio1*aeroact(k+1)%mact1_mean - & |
There was a problem hiding this comment.
This logic is also on L353, should that be changed too?:
dmac=(flux_n2(k+1)aeroact(k+1)%nratio1aeroact(k+1)%mact1_mean - &
flux_n2(k)aeroact(k)%nratio1aeroact(k)%mact1_mean)* rdz_on_rho(k,ixy_inner)
There was a problem hiding this comment.
NB: potentially this is another unused module and not sedr_1M_2M - consider if useful to copy the logic.
| flux_n2(k)*dustact(k)%nratio1*dustact(k)%mact1_mean)*rdz_on_rho(k,ixy_inner) | ||
| dmad=(min(flux_n2(k+1)*dustact(k+1)%nratio1*dustact(k+1)%mact1_mean, & | ||
| dustact(k+1)%mact1/(step_length*rdz_on_rho(k+1,ixy_inner)))& | ||
| -min(flux_n2(k)*dustact(k)%nratio1*dustact(k)%mact1_mean, & |
There was a problem hiding this comment.
Test of units:
flux_n2 * nratio1 * mact1 = kg.m-2.s-1 * kg.kg-1 = kg.m-2.s-1
mact1 / (step*rdzontho) = kg.kg-1 * s-1 * kg.m-2= kg.m-2.s-1
So units wise all good. The test is that the flux of aerosol coming from above does not exceed the total mass above. I think this is fine. dmad is then the net incoming flux from above minus outgoing below.
| IF (lhook) CALL dr_hook(ModuleName//':'//RoutineName,zhook_in,zhook_handle) | ||
|
|
||
| casim_erfc=erfg(x,c) | ||
| casim_erfc=erfc(x) !erfg(x,c) ! bug in erfg for c=1 and x<1e-10 |
There was a problem hiding this comment.
Simple bug fix to avoid erroneous values of erf as commented
| r1=min(max_accumulation_mean_radius, r1_in) | ||
| ELSE | ||
| r1 = max_accumulation_mean_radius | ||
| END IF |
There was a problem hiding this comment.
Simple check for reasonable r1, also reverts the default method
…r12572:12585) Completes the backport started in 6da0532 by adding the missing clamps and fixes that were not yet ported to this branch: - accretion.F90: fix stale cloud_mass scalar bug, use per-level qfields - evaporation.F90: clamp dmac/dmacd against negative mact2, zero dmac/dnumber_a on sign mismatch before which_mode call - homogeneous_freezing.F90: add explicit dmac/dmadl clamps (defense in depth; previously only implicitly bounded) - ice_accretion.F90: clamp dmac/dmad in all four branches (were previously completely unclamped) - ice_deposition.F90: clamp dmad (insoluble dust) during sublimation to match the existing dmac clamp - micro_main.F90: extend l_pos1 iprocs_dependent list to include i_diacw, i_dsacw, i_dgacw, i_dhomc, i_dnuc; comment out ensure_positive_aerosol calls for sedimentation (limiter now applied directly in sedimentation.F90) - mphys_tidy.F90: return orphaned activated aerosol mass to the interstitial pool instead of destroying it in qtidy; rewrite ensure_positive_aerosol to a single-pass per-field rescale Source: /data/users/paul.field/FCM/um13.9_um13.9_casim_max_mact/src (svn diff -r 12572:12585)
…14.2 # Conflicts: # src/homogeneous_freezing.F90 # src/mphys_tidy.F90
Anthony Jones (ajones244)
left a comment
There was a problem hiding this comment.
Hi Paul,
I have reviewed the code and I am satisfied that the changes are appropriate, mostly amounting to bug fixes, slight logic changes and conservation improvements.
To reiterate, the purpose of this ticket is to improve aerosol conservation when SOL/INSOL is coupled to CASIM, alongside associated bug fixes.
KGO for the SOL/INSOL-CASIM tests change because of the aerosol changes and the change of ndrop_pot (m-3 now rather than kg-1, which is what the rad_ctl wants)
Rose stem passes for the operational / higher-priority tests.
Passing to James Bruten (@james-bruten-mo) for CR. Happy to discuss this again next week if more is needed.
There are a larger number of scientific configuration improvements on the CASIM side which are meant to improve the aerosol conservation. You have demonstrated in offline tests (shown to me) that this conservation requires significant changes to the logic. I have hence reviewed the logic in detail to ensure the changes are consistent and am happy to approve as Sci tech reviewer)
Anthony
James Bruten (james-bruten-mo)
left a comment
There was a problem hiding this comment.
Unless there's a good reason to keep them (ie. imminently, they will be reinstated in a separate PR) it'd be better to keep the code tidy by removing the commented out sections.
Otherwise looks good
| aerofields(:,:,ixy_inner), & | ||
| aerosol_procs(:,:,ixy_inner), & | ||
| (/i_asedr, i_asedl/) ) | ||
| ! No need to call ensure positive aerosol. Limiter added to sedimentation |
There was a problem hiding this comment.
Is there a good reason to keep this code but commented out? Generally we prefer to not keep commented out code blocks
There was a problem hiding this comment.
Hello James - thanks - i've removed those bits in micro_main and mphys_tidy.
Please let me know if i missed anything.
thanks
|
|
||
|
|
||
|
|
||
| ! aerofields(:, i_am1)=a1(ks:ke,i,j) AitkenSolMass |
There was a problem hiding this comment.
Same comment as above
There was a problem hiding this comment.
Hello James - thanks - i've removed those bits in micro_main and mphys_tidy.
Please let me know if i missed anything.
thanks
James Bruten (james-bruten-mo)
left a comment
There was a problem hiding this comment.
Thanks Paul, looks good now
PR Summary
Sci/Tech Reviewer: Anthony Jones (@ajones244)
Code Reviewer: James Bruten (@james-bruten-mo)
Code Quality Checklist
(Some checks are automatically carried out via the CI pipeline)
Testing
stem suites
acceptable (eg. kgo changes)
tests, unit tests, etc.)
trac.log
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
Sci/Tech Review
Please alert the code reviewer via a tag when you have approved the SR
Code Review