@@ -605,6 +605,13 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
605
605
function limit (q, dt, n:: Int )
606
606
return q / float (dt) / n
607
607
end
608
+ function clipped (q)
609
+ if q > 0
610
+ return true
611
+ else
612
+ return false
613
+ end
614
+ end
608
615
609
616
function ∂ρqₗ_err_∂ρqₗ (tps, ts, cmc, dt, S, pos_lim, neg_lim,
610
617
source_deriv, pos_lim_deriv, neg_lim_deriv)
@@ -620,7 +627,17 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
620
627
neg_lim_deriv = 0
621
628
622
629
if q. tot + q. liq < FT (0 )
623
- S = CMNe. conv_q_vap_to_q_liq_ice_MM2015 (cmc. liquid, tps, q, ρ, Tₐ (tps, ts))
630
+ S = CMNe. conv_q_vap_to_q_liq_ice_MM2015 (
631
+ cm_params,
632
+ thp,
633
+ qₜ,
634
+ qₗ,
635
+ qᵢ,
636
+ qᵣ,
637
+ qₛ,
638
+ ρ,
639
+ Tₐ,
640
+ )
624
641
else
625
642
S = 0
626
643
source_deriv = 0
@@ -653,7 +670,17 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
653
670
q = TD. PhasePartition (tps, ts)
654
671
ρ = TD. air_density (tps, ts)
655
672
656
- S = CMNe. conv_q_vap_to_q_liq_ice_MM2015 (cmc. ice, tps, q, ρ, Tₐ (tps, ts))
673
+ S = CMNe. conv_q_vap_to_q_liq_ice_MM2015 (
674
+ cmc,
675
+ thp,
676
+ qₜ,
677
+ qₗ,
678
+ qᵢ,
679
+ qᵣ,
680
+ qₛ,
681
+ ρ,
682
+ Tₐ,
683
+ )
657
684
658
685
if S > FT_inner (0 )
659
686
if S <= limit (TD. vapor_specific_humidity (q), dt, 2 )
@@ -684,6 +711,11 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
684
711
∂ᶜρqₗ_err_∂ᶜρqₜ = matrix[@name (c. ρq_liq), @name (c. ρq_tot)]
685
712
∂ᶜρqᵢ_err_∂ᶜρqₜ = matrix[@name (c. ρq_ice), @name (c. ρq_tot)]
686
713
714
+
715
+ # plan -- check if things have been clipped or not. if so then don't calc.
716
+
717
+
718
+
687
719
# if isdefined(Main, :Infiltrator)
688
720
# Main.@infiltrate
689
721
# end
0 commit comments