Open lizziel opened 1 year ago
Here is a list of all GOTOs in the GEOS-Chem source code. Many of these are in 3rd-party code (such as ISORROPIA). Other instances are used as a way to exit during file I/O (e.g. in species_database_mod.F90
) -- this is in code that only gets done once so this is less egregious.
Tagging @lizziel @msulprizio @Jourdan-He @SaptSinha
I think it'd be almost impossible to remove the GOTOs in ISORROPIA without potentially messing things up. The best solution would be to replace ISORROPIA as @sdeastham has been advocating for.
We could focus on the in-house code that is in GeosCore
, Headers
, and GeosUtil
. I agree best not to touch the 3rd part code given it'll eventually be replaced with new versions anyway.
@lizziel: We can now revisit this now that HETP has replaced ISORROPIA.
This instance in GeosCore/carbon_mod.F90
(for TOMAS):
IF ( SUM( EMISMASS(I,J,:) ) == 0.e+0_fp ) GOTO 100
can be replaced with
IF ( SUM( EMISMASS(I,J,:) ) == 0.e+0_fp ) CYCLE
Use of goto is discouraged as it is confusing and very old fortran. Still, it is present is many places in GEOS-Chem. We should retire it.