Numerical issues discovered in GEOS-Chem

From Geos-chem
Revision as of 23:42, 19 April 2017 by Yanko (Talk | contribs) (Fixed div-by-zero issue in paranox_mod.F)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

On this page, we provide specific information about floating-point invalid or other numerical errors that were found in GEOS-Chem. For a general discussion of how floating-point mathematics works on computers, please see our Floating point math issues page.

Overview

We discovered the numerical issues described below by debugging GEOS-Chem (versions v9-02o and higher) with the GEOS-Chem Unit Tester. This turns on very strict debugging options. In particular, the Unit Tester compiles GEOS-Chem with the FPE=yes option, which tells the compiler to trap any floating point errors. This will halt GEOS-Chem execution if any of the following situations occur:

  • Floating-point invalid
  • Floating point overflow
  • Division by zero

Error checking for these options are activated by setting the compilation flag FPE=yes. This turns on the following options:

--Bob Yantosca (talk) 17:25, 13 December 2016 (UTC)

Previous issues now resolved in GEOS-Chem

Optimization error in grid_mod.F

This bug was fixed for the GEOS-Chem v10-01 public release (approved 15 Jun 2015).

For a full description of this issue, please see this post on our Regridding in GEOS-Chem wiki page.

--Bob Yantosca (talk) 17:16, 9 February 2016 (UTC)

Segmentation fault in HEMCO when emissions are shut off

This fix was validated with 1-month benchmark GEOS-Chem v10-01g (approved 01 May 2015).

For a full description of the issue, please see this post on our Implementation of HEMCO in GEOS-Chem wiki page.

--Bob Yantosca (talk) 19:22, 9 February 2016 (UTC)

Parallelization error in nested-grid simulations

These updates were validated in the 1-month benchmark simulation v10-01d (approved 03 Jun 2014).

For a full description of the issue, please see this post on our Setting up GEOS-Chem nested-grid simulations wiki page.

--Bob Yantosca (talk) 19:19, 9 February 2016 (UTC)

Eliminate floating-point invalid in strat_chem_mod.F

NOTE: This fix was included in GEOS-Chem v9-02o (approved 03 Sep 2013).

For a full description of this issue, please see this post on our Stratospheric chemistry wiki page.

This error condition was caught by the GEOS-Chem unit tester when compiling with option FPE=yes.

--Bob Y. 12:14, 13 September 2013 (EDT)

Fixed div-by-zero issue in paranox_mod.F

This fix was validated with 1-month benchmark simulation GEOS-Chem v9-02o (approved 03 Sep 2013). This update is included in Adjoint v35l

NOTE: PARANOX is now a HEMCO extension in GEOS-Chem v10-01 and higher versions. Module GeosCore/paranox_mod.F has been moved to HEMCO/Extensions/hcox_paranox_mod.F.

In routine INTERPOLATE_LUT2 (in GeosCore/paranox_mod.F), there is a division JO1D / JNO2. But because JNO2 is a J-value, its value will go to zero at night. This will result in a div-by-zero error.

Geert Vinken recommends that if the division cannot be done, that we just set the result of the quotient JO1D / JNO2 to zero. We have added a call to function SAFE_DIV in GeosUtil/error_mod.F to do this.

     Old code:
     var_array(6) = JO1D / JNO2                      ! J(O1D)/J(NO2)

     New code:
     USE ERROR_MOD, ONLY : SAFE_DIV
     . . .
     var_array(6) = SAFE_DIV( JO1D, JNO2, 0d0 )      ! J(O1D)/J(NO2)	

This error condition was caught by the GEOS-Chem unit tester when compiling with option FPE=yes.

--Bob Y. 12:00, 13 September 2013 (EDT)

Fixed floating-point issues in drydep_mod.F

These fixes were validated with 1-month benchmark GEOS-Chem v9-02p (approved 13 Sep 2013).

For more information about these issues, please see the following wiki posts:

  1. Preventing floating-point invalid errors in the dry deposition module
  2. Fixed error in the definition of drydep species RIP and IEPOX
  3. Add extra variables to PRIVATE declaration in parallel loop

--Bob Y. 15:06, 16 October 2013 (EDT)

Prevent div-by-zero conditions in wet deposition

This fix was validated with 1-month benchmark GEOS-Chem v9-02p (approved 13 Sep 2013).

We added some extra error checks in the WASHFRAC* routines (in GeosCore/wetscav_mod.F) in order to prevent div-by-zero conditions. Please see this post on our Wet deposition wiki page for more information.

--Bob Y. 15:07, 16 October 2013 (EDT)

Prevent out-of-bounds error in AIRQNT_FULLGRID for Hg simulations

This fix was validated with 1-month benchmark GEOS-Chem v9-02p (approved 13 Sep 2013).

NOTE: Routine AIRQNT_FULLGRID was removed from GEOS-Chem v10-01 and higher versions. This function was superseded by the vertical regridding capability of the HEMCO emissions component.

In routine AIRQNT_FULLGRID (in GeosCore/dao_mod.F), we loop over 1..LGLOB vertical levels. However, when we compile with the reduced vertical grid (i.e. with -DGRIDREDUCED), the AREA_M2 array in GeosUtil/grid_mod.F90 will only be compiled with LLPAR vertical levels. This means that the call GET_AREA_M2( I, J, L ) will be trying to retrieve data from AREA_M2 with a vertical level index that is out-of-bounds.

The quick solution is to just call GET_AREA_M2( I, J, 1 ), since for the traditional GEOS-Chem, all areas in a vertical column are identical. In fact, the (I,J,L) dependence on AREA_M2 was introduced as part of the Grid-Independent GEOS-Chem in order to allow for future grids that may not be rectilinear.

   Old code:
   AREA_M2 = GET_AREA_M2( I, J, L )

   New code:
   AREA_M2 = GET_AREA_M2( I, J, 1 )	

This error condition was caught by the GEOS-Chem unit tester when compiling with option FPE=yes.

--Bob Y. 15:09, 16 October 2013 (EDT)

Parallelization fix for the ND57 diagnostic

This fix was validated with 1-month benchmark GEOS-Chem v9-02p (approved 13 Sep 2013).

We added the variable P0 to the !$OMP PRIVATE list in GeosCore/diag1.F where we compute the ND57 (potential temperature) diagnostic. P0 is a scalar in a parallel loop, which must be held PRIVATE. This appears to have been a typo.

Old code:
!$OMP PARALLEL DO
!$OMP+DEFAULT( SHARED )
!$OMP+PRIVATE( I, J, L )

New code:
!$OMP PARALLEL DO
!$OMP+DEFAULT( SHARED )
!$OMP+PRIVATE( I, J, L, P0 )

This error condition was caught by the GEOS-Chem unit tester when compiling with option FPE=yes.

--Bob Y. 15:08, 16 October 2013 (EDT)

Correct floating-point invalid in GEOS-FP simulations

This fix was validated with 1-month benchmark GEOS-Chem v9-02p (approved 13 Sep 2013).

We added a fix to prevent a floating-point invalid situation from occurring when running GEOS-Chem with the GEOS-FP met fields. For more information about this issue, please see this post on our GEOS-FP implementation details wiki page.

--Bob Y. 15:08, 16 October 2013 (EDT)

Correct floating-point invalid in MERRA simulations

These fixes were validated with 1-month benchmark GEOS-Chem v9-02p (approved 13 Sep 2013).

For more information about these issues, please see the following wiki posts:

  1. Remove negative values from MERRA QI, QL met fields
  2. Call WASHOUT from DO_MERRA_CONVECTION with the proper time variable

These error conditions were caught by the GEOS-Chem unit tester when compiling with option FPE=yes.

--Bob Y. 15:07, 16 October 2013 (EDT)

Add a stricter error check in cldice_HBrHOBr_rxn.F

These fixes were validated with 1-month benchmark GEOS-Chem v9-02p (approved 13 Sep 2013).

For more information about these issues, please see this wiki post on our Bromine chemistry mechanism wiki page.

--Bob Y. 15:07, 16 October 2013 (EDT)

Parallelization error in routine METERO

This update was validated with 1-month benchmark simulation v9-02r (approved 14 Nov 2013).

For a full description of this issue, please see this wiki post on our Dry deposition wiki page.

--Bob Y. 10:38, 23 October 2013 (EDT)

Prevent LOG(0) error from occurring in soil NOx module

This update was tested in the 1-month benchmark simulation v9-02r (approved 14 Nov 2013).

NOTE: The soil NOx module is now implemented as a HEMCO extension in GEOS-Chem v10-01 and higher versions.

For a full description of this issue, please see this wiki post on our Soil NOx emissions wiki page.

--Bob Y. 16:09, 31 October 2013 (EDT)

Parallelization error in routine DRYFLX

This update was validated with 1-month benchmark simulation v9-02r (approved 14 Nov 2013).

For a full description of this issue, please see this wiki post on our Dry deposition wiki page.

--Bob Y. 16:09, 31 October 2013 (EDT)

Issues that have not yet been resolved

Parallelization error in 0.5x0.666 nested CH simulation

For a full description of this issue, please see this wiki post on our GEOS-Chem nested grid simulations wiki page.

--Melissa Sulprizio 17:36, 10 March 2014 (EDT)