geoschem / geos-chem

GEOS-Chem "Science Codebase" repository. Contains GEOS-Chem science routines, run directory generation scripts, and interface code. This repository is used as a submodule within the GCClassic and GCHP wrappers, as well as in other modeling contexts (external ESMs).
http://geos-chem.org
Other
164 stars 156 forks source link

KPP convergence error after introducing new chemical mechanism in 0.25 x 0.3125 nested run #2195

Open laura-hyesung-yang opened 6 months ago

laura-hyesung-yang commented 6 months ago

Name and Institution (Required)

Name: Laura Yang Institution: Harvard University GEOS-Chem version: 13.3.4

Description of your issue or question

I added two new chemical mechanisms to GEOS-Chem version 13.3.4 related to cloud chemistry. In fullchem.eqn, I added the following: MCO3 = MP : MCO3uptkByCloud( State_Het ); {2024/03/11; LHY} CH2O = MDL : K_MDL;

I defined FUNCTION MCO3uptkByCloud in fullchem_RateLawFuncs.F90 following the N2O5uptkByCloud function. K_MDL is defined in fullchem_SulfurChemFuncs.F90 as a constant that depends on cloud fraction, temperature, and liquid water content (KPP_files.zip). Then I rebuilt KPP.

When I run a 4x5 global run with these changes, the model ran successfully without failing. So, I generated boundary condition files from a 4x5 global run. Then I tried to run a 0.25 x 0.3125 nested simulation and the integration failing error showed up right after GET_BOUNDARY_CONDITIONS call was run (GC.log).

Min and Max of each species in BC file [mol/mol]:
GET_BOUNDARY_CONDITIONS: Done applying BCs at 2016/04/01 21:00
 zhaisx prints: 0.25x0.3125 simulation.
 Forced exit from Rosenbrock due to the following error:
 --> Step size too small: T + 10*H = T or H < Roundoff
 T=   2.4000000000000033E-017 and H=   2.4000000000000033E-017
 ### INTEGRATE RETURNED ERROR AT:            4          26          37
 Forced exit from Rosenbrock due to the following error:
 --> Step size too small: T + 10*H = T or H < Roundoff
 T=   4.0000000000000040E-017 and H=   4.0000000000000040E-017
## INTEGRATE FAILED TWICE !!!
 #############################################################################################################################################################################################################################################
 ### KPP DEBUG OUTPUT!
 ### Species concentrations at problem box            4          26          37
 #############################################################################################################################################################################################################################################
 ###    9.3355777770412612E-019 CH2I2
 ###    1.4843733101339312E-016 CH2IBr
 ###    4.9602182464559288E-013 CH2ICl
 ###    1113523.1767719504      AERI

When I ran the GCClassic version 13.3.4 without this chemical mechanism changed, it ran fine so this issue is possibly related to me adding the mechanism. Also, since the global run was OK but the nested run is being stuck, perhaps boundary condition files are the culprit. May I ask for advice on which to look into further?

laura-hyesung-yang commented 5 months ago

1337 was the most relevant post to solve this problem. It seems like Br2 and ClOO blow up randomly depending on the day. Once I changed the start day of the simulation, I no longer encountered this issue.

yantosca commented 5 months ago

Thanks @laura-hyesung-yang for the update. Is that just kicking the can down the road though? I wonder if the Br2 and ClOO will blow up on another day. Something to watch for.

laura-hyesung-yang commented 5 months ago

@yantosca Yes - it might be kicking the can down the road. I encountered this issue when my simulation began on 04/01/2016. I switched the Restart file name to be 04/02/2016 and timestamp to be 04/02/2016. Then I got the following message on the first day of simulation at 21:00.

Infinity in DO_CLOUD_CONVECTION!
K, IC, Q(K,IC):   11  30           NaN      CFC11
                       NaN                       NaN                       NaN                       NaN                       NaN                       NaN   300.00000000000000                            NaN
Infinity in DO_CLOUD_CONVECTION!
K, IC, Q(K,IC):   10  30           NaN      CFC11
                       NaN                       NaN                       NaN                       NaN                       NaN                       NaN   300.00000000000000                            NaN
Infinity in DO_CLOUD_CONVECTION!
K, IC, Q(K,IC):   11  30           NaN      CFC11
                       NaN                       NaN                       NaN                       NaN                       NaN                       NaN   300.00000000000000                            NaN
Infinity in DO_CLOUD_CONVECTION!
K, IC, Q(K,IC):    5  30           NaN      CFC11
                       NaN                       NaN                       NaN                       NaN                       NaN                       NaN   300.00000000000000                            NaN
Infinity in DO_CLOUD_CONVECTION!
K, IC, Q(K,IC):    5  30           NaN      CFC11
                       NaN                       NaN                       NaN                       NaN                       NaN                       NaN   300.00000000000000                            NaN
Infinity in DO_CLOUD_CONVECTION!
K, IC, Q(K,IC):    5  30           NaN      CFC11

I've resubmitted the run so that my simulation starts on 05/01/2016. So far, it's running without these errors appearing for 2 days. But I will watch for it and keep you posted here!

yantosca commented 3 months ago

@laura-hyesung-yang: Is this issue now resolved?