From 6cd34a1278f8a953143f116b913b1ae3998f68e8 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Fri, 6 May 2022 11:58:38 -0400 Subject: [PATCH] Now use SUNCOSmid as proxy --- GeosCore/fullchem_mod.F90 | 7 ++++++- KPP/fullchem/gckpp_Integrator.F90 | 5 +---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/GeosCore/fullchem_mod.F90 b/GeosCore/fullchem_mod.F90 index 8f9f6567e..69e40acec 100644 --- a/GeosCore/fullchem_mod.F90 +++ b/GeosCore/fullchem_mod.F90 @@ -1211,7 +1211,12 @@ SUBROUTINE Do_FullChem( Input_Opt, State_Chm, State_Diag, & ! JNO2 ranges from 0 to 0.02 and is order ~ 1e-4 at the terminator. We set this threshold ! to be slightly relaxed so it captures the terminator, but this needs some ! tweaking. - IF(ZPJ(L,RXN_NO2,I,J) .eq. 0.0_fp) THEN + ! + ! For some reason, RXN_NO2 as a proxy fails to propagate the sunset terminator + ! even though all diagnostics seem fine, and after a while only the OH scheme applies. + ! Use SUNCOSmid as a proxy to fix this. (hplin, 4/20/22) + ! IF(ZPJ(L,RXN_NO2,I,J) .eq. 0.0_fp) THEN + IF(State_Met%SUNCOSmid(I,J) .le. -0.1391731e+0_fp) THEN ICNTRL(10) = ind_NO2 ! NO2 is nighttime target species. RCNTRL(10) = Input_Opt%AUTOREDUCE_TUNING_NO2 ENDIF diff --git a/KPP/fullchem/gckpp_Integrator.F90 b/KPP/fullchem/gckpp_Integrator.F90 index 1f885d717..85dc45020 100644 --- a/KPP/fullchem/gckpp_Integrator.F90 +++ b/KPP/fullchem/gckpp_Integrator.F90 @@ -429,10 +429,7 @@ SUBROUTINE Rosenbrock(N,Y,Tstart,Tend, & Autoreduce = .false. ENDIF !~~~> Auto-reduction threshold ratio (only if ICNTRL(10) is not zero) - AR_thr_ratio = 0.001_dp - IF (RCNTRL(10) > ZERO) THEN - AR_thr_ratio = RCNTRL(10) - ENDIF + AR_thr_ratio = RCNTRL(10) !~~~> CALL Auto-reducing Rosenbrock method IF ( Autoreduce .and. .not. Autoreduce_Append ) THEN ! ros_yIntegrator is the aggressively micro-optimized revision by Haipeng Lin.