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
162 stars 155 forks source link

Improper tolerance values in GCHP carbon simulation #2341

Closed Aosrain closed 1 week ago

Aosrain commented 3 weeks ago

Your name

Longtao Wu

Your affiliation

JPL

What happened? What did you expect to happen?

The GCHP carbon simulation stops with the following error: Doing warm GEOS-Chem restart

   GCHPchem: INFO: GEOS-Chem phase -1:
   GCHPchem: INFO: DoConv   : T
   GCHPchem: INFO: DoDryDep : F
   GCHPchem: INFO: DoEmis   : T
   GCHPchem: INFO: DoTend   : F
   GCHPchem: INFO: DoTurb   : T
   GCHPchem: INFO: DoChem   : T
   GCHPchem: INFO: DoWetDep : F
HEMCO: array pointer vertically flipped relative to MAPL Import
AEIC19_MONMEAN_CO
HEMCO: array pointer vertically flipped relative to MAPL Import
AEIC19_MONMEAN_CO2
HEMCO: array pointer vertically flipped relative to MAPL Import GLOBAL_OH
HEMCO: array pointer vertically flipped relative to MAPL Import CH4_LOSS
HEMCO: array pointer vertically flipped relative to MAPL Import GLOBAL_Cl
HEMCO: array pointer vertically flipped relative to MAPL Import PCO_CH4
HEMCO: array pointer vertically flipped relative to MAPL Import PCO_NMVOC
HEMCO: array pointer vertically flipped relative to MAPL Import GMI_LOSS_CO
HEMCO: array pointer vertically flipped relative to MAPL Import GMI_PROD_CO
HEMCO: array pointer vertically flipped relative to MAPL Import CO2_COPROD
HEMCO: array pointer vertically flipped relative to MAPL Import ENERGY_LEVS
HEMCO: array pointer vertically flipped relative to MAPL Import INDUSTRY_LEVS
--- Do convection now
--- Convection done!
--- Do emissions now
--- Emissions done!
--- Do turbulence now
AbsTol( 1 ) = 0.000000000000000E+000
RelTol( 1 ) = 0.000000000000000E+000
Forced exit from Rosenbrock due to the following error:
--> Improper tolerance values
T= 0.000000000000000E+000 and H= 0.000000000000000E+000

What are the steps to reproduce the bug?

  1. download the GCHP model.
  2. set up the experiment.
  3. Submit the carbon simulation job.

Please attach any relevant configuration and log files.

No response

What GEOS-Chem version were you using?

GCHP 14.4.0

What environment were you running GEOS-Chem on?

Other (please explain below)

What compiler and version were you using?

ifort 19.1.3.304 20200925

Will you be addressing this bug yourself?

Yes

In what configuration were you running GEOS-Chem?

GCHP

What simulation were you running?

Carbon

As what resolution were you running GEOS-Chem?

c24

What meterology fields did you use?

MERRA-2

Additional information

No response

yantosca commented 2 weeks ago

Thanks for letting us know about this @Aosrain. The GCHP carbon simulation has been passing our integration tests with GNU Fortran 10.2.0.

I believe that ATOL and RTOL aren't used because the carbon simulation uses the Forward Euler integrator, which is an implicit method. ATOL and RTOL are used for the Rosenbrock solver and similar methods (or at least that is my understanding).

@lizziel: Do we have an error trap in GCHP for zero ATOL or RTOL?

Aosrain commented 2 weeks ago

CMakeLists.txt make.log cmake.log Makefile.txt

For the carbon simulation, it should call GCHP_GridComp/GEOSChem_GridComp/geos-chem/KPP/carbon/gckpp_Integrator.F90, right? However, carbon/gckpp_Integrator.F90 is not compiled as shown in my make.log. It only compiles fullchem/gckpp_Integrator.F90. Is this the issue?

Here is how I compile the model:

  1. git clone --recurse-submodules https://github.com/geoschem/GCHP.git GCHP
  2. Update CMakeLists.txt as the attached CMakeList.txt
  3. cmake /nobackup/lwu5/GCHP -DCMAKE_PREFIX_PATH=/nobackup/lwu5/esmf-ESMF_8_2_0 -DMAKE=carbon
  4. make -j
lizziel commented 2 weeks ago

@lizziel: Do we have an error trap in GCHP for zero ATOL or RTOL?

As far as I know GCHP uses the same KPP code as GC-Classic. GEOS has code to inflate the error tolerances in fullchem_mod.F90 but I assume that is not used for carbon.

Aosrain commented 1 week ago

It looks like that a new set of KPP code for carbon is available in src/GCHP_GridComp/GEOSChem_GridComp/geos-chem/KPP/carbon/, but not used yet.

After setting the error tolerances in src/GCHP_GridComp/GEOSChem_GridComp/geos-chem/KPP/fullchem/gckpp_Global.F90 as following, my job runs well. Thanks.

REAL(kind=dp) :: ATOL(NVAR) = 1e-2_dp REAL(kind=dp) :: RTOL(NVAR) = 0.5e-2_dp

lizziel commented 4 days ago

Following up on this, I thought KPP/carbon was used for the GCHP carbon simulation in 14.4. @yantosca, can you confirm this is true? I don't think changing the tolerances in KPP/fullchem/gckpp_Global.F90 should need to happen for carbon. If it does, then I wonder if there is a bug?

lizziel commented 4 days ago

@Aosrain, I just saw your comment earlier that you used this to build: cmake /nobackup/lwu5/GCHP -DCMAKE_PREFIX_PATH=/nobackup/lwu5/esmf-ESMF_8_2_0 -DMAKE=carbon

You need to use this command to build the carbon mechanism instead of -DMAKE=carbon: -DMECH=carbon

Aosrain commented 3 days ago

@lizziel Thanks for catching the error. I have recompiled it and the carbon simulation works well.