Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only convert units for species that require it #2072

Merged
merged 37 commits into from
Apr 23, 2024

Conversation

yantosca
Copy link
Contributor

@yantosca yantosca commented Dec 12, 2023

Name and Institution (Required)

Name: Bob Yantosca
Institution: Harvard + GCST

Confirm you have reviewed the following documentation

Describe the update

This PR updates the unit conversion routines as follows:

  • Introduces State_Chm%Species(N)%Units and State_Chm%Species(N)%Previous_Units fields
  • Updates in GeosUtil/unitconv_mod.F90:
    • In Convert_Spc_Units:
      • Now accepts a mapping argument, specifying the modelId species indices
      • Argument outUnit is renamed to new_units
      • Argument origUnit is renamed to previous_units
    • Added function Check_Units
    • Added function Check_Previous_Units

Calls to Convert_Spc_Units throughout the code have been updated correspondingly.

Expected changes

We will see small differences at the level of numerical noise.

Related Github Issue(s)

@yantosca yantosca added category: Feature Request New feature or request topic: Structural Modifications Related to GEOS-Chem structural modifications (as opposed to scientific updates) no-diff-to-benchmark This update will not change the results of fullchem benchmark simulations topic: Performance Related to GEOS-Chem speed, memory, or parallelization labels Dec 12, 2023
@yantosca yantosca self-assigned this Dec 12, 2023
@yantosca
Copy link
Contributor Author

Still shaking down some bugs in the implementation.

Headers/species_mod.F90
- Add SpcConc%Units and SpcConc%Previous_Units to store the integer
  flags for the current and previous species units.
- Add comments

Headers/state_chm_mod.F90
- Add State_Chm%Map_All(:) mapping vector, which returns all species
  indices.  This is needed for species-specific unit conversions.
- Set State_Chm%Species(:)%Units = 0 at init
  Set State_Chm%Species(:)%Previous_Units = 0 at init

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
GeosUtil/unitconv_mod.F90
- Added routine Check_Input_Units
- In each unit conversion routine:
  - Accepts a mapping array as an argument.  This will allow the calling
    routine to pass one of the State_Chm%Map_* vectors, which specifies
    the ModelId's of the species for which unit conversions will be done.
   - Removed references to State_Chm%Spc_Units.
   - Added new loop index S.
   - N (the modelID) is now obtained with N = mapping(S)
   - Update units metadata in State_Chm%Species(N)%Units and
     State_Chm%Species(N)%Previous_Units
   - Pull computations outside of (I,J,L) loops where expedient and
     store the results in !$OMP PRIVATE loop variables for use within
     (I,J,L) loops.
   - Store conversion factors in an !$OMP PRIVATE loop variable,
     both for clarity and to avoid repeated computations
   - Now place adjoint code in IF/THEN blocks (instead of using a single
     IF statement with continuation characters.
   - Change e.g. 1e-3fp to 1.0e-3_fp, etc.
   - Updated comments

CHANGELOG.md
- Updated accordingly
GeosUtil/unitconv_mod.F90
- Rename function Check_Input_Units to Check_Units.
- Add function Check_Previous_Units
- In routine Convert_Spc_Units:
  - Add a single call to Check_Units before the CASE statement.
  - Rename "outUnit" argument to "new_units"
  - Rename "origUnit" argument to "previous_units"
  - Add errUnits error message variable
  - Add a single call to Check_Previous_Units before exiting,
    to ensure that all species have the same Previous_Units value
- In routine "Print_Species_Kg"
  - Update calls to "Convert_Spc_Units"
- In other routines
  - Remove calls to Check_Input_Units

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
This commit updates the various calls to Convert_Spc_Units in modules
throughout the GeosCore/*.F90, Interfaces/GCHP/*.F90, and
Interfaces/GEOS/*.F90.  Updates include:

- Adding the "mapping" argument to pass one of the State_Chm%Map_*
  arrays.  This is the list of modelId's for each species.
- Renaming "outUnit" -> "new_units"
- Renaming "origUnit" -> "previous_units

NOTE: Some additional work will be needed, as some code (mostly
in TOMAS) still relies on the old State_Chm%Spc_Units variable.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca yantosca force-pushed the feature/unitconv-per-species-category branch from 31cc208 to d838f7e Compare December 13, 2023 17:02
This commit fixes several minor issues that were left over from
the prior commit.

GeosCore/aerosol_mod.F90
- Add missing comma after "previous_units"

GeosCore/fullchem_mod.F90
- Rename "origUnit" -> "previous_units"

GeosCore/hco_interface_gc_mod.F90
- Add missing continuation character &
- Rename "outUnit" -> "new_units"

GeosCore/hco_utilities_gc_mod.F90
GeosCore/vdiff_mod.F90
- Rename "origUnit" -> "previous_units"
- Rename "outUnit" -> "new_units"
- Add mapping argument in calls to Convert_Spc_Units

GeosUtil/unitconv_mod.F90
- Rename "inUnit" -> "in_units"
- Rename "outUnit" -> "new_units"

ObsPack/obspack_mod.F90
- Fixed typo: "State_Chem" -> "State_Chm"

GeosCore/mercury_mod.F90
- Bug fix: previous_units should be INTEGER, not LOGICAL

GeosCore/sulfate_mod.F90
- Rename "origUnit" -> "previous_units"
- Rename "outUnit" -> "new_units"

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
GeosCore/calc_met_mod.F90
- Add "units" variable to store units in UpdtMR block
- Only convert units for species that have dry units (moved IF block
  to within the N loop over species0

GeosCore/chemistry_mod.F90
- Remove reference to State_Chm%Spc_Units

GeosCore/hco_utilities_gc_mod.F90
- Remove reference to State_Chm%Spc_Units
- Set initial units and previous_units values for each species N

GeosCore/ucx_mod.F90
- Remove reference to State_Chm%Spc_Units
- Update error check for H2O units using Spc(id_H2O)%Units

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
GeosUtil/unitconv_mod.F90
- Undo numerical optimizations where we pull terms outside of the
  IJL loops.  This seems to cause some numerical differences.  We
  can return to this later.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
GeosUtil/unitconv_mod.F90
- Now declare Check_Units and Check_Previous_Units as PUBLIC, so that
  they can be seen outside the module
- Rename the "unit" argument to "units" in both Check_Units
  and Check_Previous_Units routines, for consistency

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
GeosCore/aerosol_mod.F90
- State_Chm is now INTENT(INOUT) in routine Set_Aermass_Diagnostic
- Now call Check_Units; Remove reference to State_Chm%Spc_Units

GeosCore/chemistry_mod.F90
GeosCore/diagnostics_mod.F90
GeosCore/set_boundary_conditions.F90
- Now call Check_Units; Remove reference to State_Chm%Spc_Units

Headers/state_chm_mod.F90
- Remove Spc_Units from TYPE(ChmState)

History/history_mod.F90
- Replace State_Chm%Spc_Units with State_Chm%Species(1)%Units

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca yantosca changed the base branch from dev/no-diff-to-benchmark to main December 14, 2023 16:28
GeosUtil/unitconv_mod.F90
- Remove loops over (I,J,L) and replace with array operations, which
  are more efficient
- Compute constant terms only once where expedient
- Reduce the number of local variables where expedient

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca
Copy link
Contributor Author

yantosca commented Dec 15, 2023

The unit conversions update result in a noticeable speedup in GEOS-Chem fullchem simullations.

Both runs on huce_cascade, --exclusive, 48 cores

7day fullchem benchmark run, ref (dev/no-diff-to-benchmark)

G E O S - C H E M   T I M E R S
 
  Timer name                       DD-hh:mm:ss.SSS     Total Seconds
-------------------------------------------------------------------------------
  GEOS-Chem                     :  00-00:52:27.125          3147.125
  HEMCO                         :  00-00:09:27.250           567.250
  All chemistry                 :  00-00:18:57.500          1137.500
  => Gas-phase chem             :  00-00:11:14.875           674.875
  => Photolysis                 :  00-00:01:17.250            77.250
  => Aerosol chem               :  00-00:06:06.875           366.875
  => Linearized chem            :  00-00:00:05.000             5.000
  Transport                     :  00-00:03:52.125           232.125
  Convection                    :  00-00:04:02.875           242.875
  Boundary layer mixing         :  00-00:07:14.250           434.250
  Dry deposition                :  00-00:00:10.625            10.625
  Wet deposition                :  00-00:01:32.250            92.250
  Diagnostics                   :  00-00:06:09.250           369.250
  Unit conversions              :  00-00:02:00.500           120.500

7day fullchem benchmark run, ref (feature/units-array-ops)

G E O S - C H E M   T I M E R S
 
  Timer name                       DD-hh:mm:ss.SSS     Total Seconds
-------------------------------------------------------------------------------
  GEOS-Chem                     :  00-00:48:45.750          2925.750
  HEMCO                         :  00-00:07:58.250           478.250
  All chemistry                 :  00-00:17:58.250          1078.250
  => Gas-phase chem             :  00-00:11:10.375           670.375
  => Photolysis                 :  00-00:01:18.875            78.875
  => Aerosol chem               :  00-00:05:10.375           310.375
  => Linearized chem            :  00-00:00:04.125             4.125
  Transport                     :  00-00:03:37.500           217.500
  Convection                    :  00-00:03:59.625           239.625
  Boundary layer mixing         :  00-00:06:43.750           403.750
  Dry deposition                :  00-00:00:08.250             8.250
  Wet deposition                :  00-00:01:24.250            84.250
  Diagnostics                   :  00-00:06:08.000           368.000
  Unit conversions              :  00-00:01:26.250            86.250

@yantosca
Copy link
Contributor Author

yantosca commented Dec 15, 2023

From the 7-day fullchem benchmark runs shown above, most species have numerical noise differences w/r/t the prior code. This may be because numerical computations (1) may be done in a slightly different order, which may incur roundoff, and (2) Some species will have less unit conversions than others.
o3

@yantosca
Copy link
Contributor Author

As part of this PR, I am making sure that unit conversion is timed separately (i.e. halting other timers before calls to Convert_Spc_Units and starting them again afterwards).

This commit

GeosCore/aerosol_mod.F90
GeosCore/airs_ch4_mod.F90
GeosCore/carbon_mod.F90
GeosCore/chemistry_mod.F90
GeosCore/fullchem_mod.F90
GeosCore/gosat_ch4_mod.F90
GeosCore/hco_interface_mod.F90
GeosCore/hco_utilities_mod.F90
GeosCore/linear_chem_mod.F90
GeosCore/mercury_mod.F90
GeosCore/mixing_mod.F90
GeosCore/pbl_mix_mod.F90
GeosCore/rrtmg_rad_transfer_mod.F90
GeosCore/sulfate_mod.F90
GeosCore/tracer_mod.F90
GeosCore/vdiff_mod.F90
GeosCore/wetscav_mod.F90
ObsPack/obspack_mod.F90
- USE Timer_Start and Timer_End from GeosUtil/timers_mod.F90
- Halt the active timer (by calling Timer_End) before each call
  to unit conversion routine Convert_Spc_Units
- Start the halted timer (by calling Timer_Start) after each call
  to Convert_Spc_Units
- This will make sure that the time spent in unit conversions will
  be logged separately from other timers

Interfaces/GCClassic/main.F90
- Halt the Diagnostics timer (with Timer_Start) before each of the
  AIRS, GOSAT, TCCON observation operators calls
- Restart the diagnostics timer (with Timer_End) after each of the
  AIRS, GOSAT, TCCON observation operators calls

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca
Copy link
Contributor Author

In 8d05296, we have reorganized calls to timers so that unit conversion is timed separately from other categories. This now results in the following timing output:

All simualtions were run on the Cannon cluster on 48 cores (Intel Cascade Lake CPUs).

1-month carbon simulations

Ref version: geoschem/geos-chem commit 69ae58a

G E O S - C H E M   T I M E R S
 
  Timer name                       DD-hh:mm:ss.SSS     Total Seconds
---------------------------------------------------------------------------
  GEOS-Chem                     :  00-00:16:56.312          1016.312
  HEMCO                         :  00-00:10:03.796           603.797
  All chemistry                 :  00-00:01:45.750           105.750
  => Gas-phase chem             :  00-00:01:43.250           103.250
  => Photolysis                 :  >>>>> THE TIMER DID NOT RUN <<<<<
  => Aerosol chem               :  >>>>> THE TIMER DID NOT RUN <<<<<
  => Linearized chem            :  >>>>> THE TIMER DID NOT RUN <<<<<
  Transport                     :  00-00:02:46.484           166.484
  Convection                    :  00-00:00:03.156             3.156
  Boundary layer mixing         :  00-00:00:43.593            43.594
  Dry deposition                :  >>>>> THE TIMER DID NOT RUN <<<<<
  Wet deposition                :  >>>>> THE TIMER DID NOT RUN <<<<<
  Diagnostics                   :  00-00:01:20.171            80.172
  Unit conversions              :  00-00:00:09.937             9.938

Dev version: geoschem/geos-chem commit 8d05296

G E O S - C H E M   T I M E R S
 
  Timer name                       DD-hh:mm:ss.SSS     Total Seconds
---------------------------------------------------------------------------
  GEOS-Chem                     :  00-00:16:11.093           971.094
  HEMCO                         :  00-00:09:43.796           583.797
  All chemistry                 :  00-00:01:19.515            79.516
  => Gas-phase chem             :  00-00:01:19.500            79.500
  => Photolysis                 :  >>>>> THE TIMER DID NOT RUN <<<<<
  => Aerosol chem               :  >>>>> THE TIMER DID NOT RUN <<<<<
  => Linearized chem            :  >>>>> THE TIMER DID NOT RUN <<<<<
  Transport                     :  00-00:02:45.984           165.984
  Convection                    :  00-00:00:02.875             2.875
  Boundary layer mixing         :  00-00:00:35.343            35.344
  Dry deposition                :  >>>>> THE TIMER DID NOT RUN <<<<<
  Wet deposition                :  >>>>> THE TIMER DID NOT RUN <<<<<
  Diagnostics                   :  00-00:01:21.515            81.516
  Unit conversions              :  00-00:00:08.312             8.312

7-day fullchem benchmark simulations:

Ref version: geoschem/geos-chem commit 69ae58a

G E O S - C H E M   T I M E R S
 
  Timer name                       DD-hh:mm:ss.SSS     Total Seconds
---------------------------------------------------------------------------
  GEOS-Chem                     :  00-00:55:33.500          3333.500
  HEMCO                         :  00-00:09:27.500           567.500
  All chemistry                 :  00-00:23:48.531          1428.531
  => Gas-phase chem             :  00-00:12:48.968           768.969
  => Photolysis                 :  00-00:01:32.218            92.219
  => Aerosol chem               :  00-00:09:02.234           542.234
  => Linearized chem            :  00-00:00:08.781             8.781
  Transport                     :  00-00:03:04.812           184.812
  Convection                    :  00-00:03:58.906           238.906
  Boundary layer mixing         :  00-00:05:53.156           353.156
  Dry deposition                :  00-00:00:12.468            12.469
  Wet deposition                :  00-00:01:32.015            92.016
  Diagnostics                   :  00-00:06:16.000           376.000
  Unit conversions              :  00-00:01:56.640           116.641

Dev version: geoschem/geos-chem commit 8d05296

G E O S - C H E M   T I M E R S
 
  Timer name                       DD-hh:mm:ss.SSS     Total Seconds
---------------------------------------------------------------------------
  GEOS-Chem                     :  00-00:50:26.390          3026.391
  HEMCO                         :  00-00:08:35.781           515.781
  All chemistry                 :  00-00:20:16.921          1216.922
  => Gas-phase chem             :  00-00:11:03.578           663.578
  => Photolysis                 :  00-00:01:18.250            78.250
  => Aerosol chem               :  00-00:07:21.562           441.562
  => Linearized chem            :  00-00:00:03.343             3.344
  Transport                     :  00-00:03:00.921           180.922
  Convection                    :  00-00:03:58.671           238.672
  Boundary layer mixing         :  00-00:04:44.875           284.875
  Dry deposition                :  00-00:00:07.734             7.734
  Wet deposition                :  00-00:01:14.750            74.750
  Diagnostics                   :  00-00:06:30.062           390.062
  Unit conversions              :  00-00:01:13.703            73.703

@yantosca yantosca modified the milestone: 14.3.1 Dec 20, 2023
@yantosca yantosca marked this pull request as ready for review December 20, 2023 22:02
@yantosca yantosca changed the title [WIP] Only convert units for species that require it Only convert units for species that require it Dec 20, 2023
@yantosca
Copy link
Contributor Author

yantosca commented Apr 9, 2024

@lizziel: Also note, I made sure that the passive species in the restart file was set to a constant value. I used this script to edit the PassiveTracer starting concentration:

#!/usr/bin/env python3

import numpy as np
import xarray as xr

ifile="./GEOSChem.Restart.20190101_0000z.nc4"
ofile="./new.GEOSChem.Restart.20190101_0000z.nc4"

with xr.set_options(keep_attrs=True):

    data = xr.open_dataset(ifile)

    arr = data["SpeciesRst_PassiveTracer"].values
    arr[:,:,:,:] = 1.0e-7

    data["SpeciesRst_PassiveTracer"].values = arr

    data.to_netcdf(ofile)

@yantosca
Copy link
Contributor Author

yantosca commented Apr 9, 2024

@lizziel: If I shut off wetdep, I get this output:

===============================================================================
Global mass of PassiveTracer

Ref = alpha.9
Dev = PR_2072
===============================================================================

 Date & Time                  Ref mass [Tg]             Dev mass [Tg]      Abs Diff    % Diff
 -----------------     --------------------      -------------------- -------------  --------
 2019-01-01 00:00          17.6563096646018          17.6563096646018    0.0000e+00     0.000
 2019-01-02 00:00          17.6563097334271          17.6563097334271    0.0000e+00     0.000
 2019-01-03 00:00          17.6563096472464          17.6563096472464    0.0000e+00     0.000
 2019-01-04 00:00          17.6563097381031          17.6563097381031    0.0000e+00     0.000
 2019-01-05 00:00          17.6563096420086          17.6563096420086    0.0000e+00     0.000
 2019-01-06 00:00          17.6563096769969          17.6563096769969    0.0000e+00     0.000
 2019-01-07 00:00          17.6563097517568          17.6563097517568    0.0000e+00     0.000
 2019-01-08 00:00          17.6563096589453          17.6563096589453    0.0000e+00     0.000
 
 Summary                                Ref                       Dev      Abs Diff    % Diff
 -----------------     --------------------      -------------------- -------------  --------
 Maximum mass [Tg]         17.6563097517568          17.6563097517568    0.0000e+00     0.000
 Minimum mass [Tg]         17.6563096420086          17.6563096420086    0.0000e+00     0.000
 Abs diff [g]          109748.2034140284668      109748.2034140284668    0.0000e+00     0.000
 % difference               0.0000006215806           0.0000006215806    0.0000e+00     0.000

 Start mass [Tg]           17.6563096646018          17.6563096646018    0.0000e+00     0.000
 End mass [Tg]             17.6563096589453          17.6563096589453    0.0000e+00     0.000
 Abs diff [g]           -5656.5063744073996       -5656.5063744073996    0.0000e+00    -0.000
 % difference              -0.0000000320367          -0.0000000320367    0.0000e+00    -0.000

 Mean mass [Tg]            17.6563096891357          17.6563096891357    0.0000e+00     0.000
 Variance [Tg]          1.7396662828534e-15       1.7396662828534e-15    0.0000e+00     0.000

@yantosca
Copy link
Contributor Author

yantosca commented Apr 9, 2024

@lizziel: I was able to get this output from the compare_diags.py script:

... Creating single-level plots
... Creating zonal mean plots
... Printing totals and differences
... Only showing variables with |absolute difference| > 0.0
Variable               Ref=alpha.9              Dev=PR #2072             Dev - Ref
SpeciesRst_PassiveTracer : 0.02384641             | 0.02384641             | -7.105427357601002e-15 

But this may just be numerical noise at the limit of representation.

In this commit, we now make sure to convert all species units (not just
advected or wetdep) for TOMAS.  This will make sure not to break the
internal unit conversions.

GeosCore/carbon_mod.F90
- Remove mapping=State_Chm%Map_Advect from calls to Convert_Spc_Units,
  which will convert all species units

GeosCore/chemistry_mod.F90
- Deleted whitespace

GeosCore/convection_mod.F90
- Deleted whitespace
- Rearranged call to WASHOUT by placing input arguments first, then
  input/output, then output
- For TOMAS only, added fromWetDep=.FALSE. keyword so that the proper
  unit conversion inside WASHOUT will be applied

GeosCore/fullchem_mod.F90
- Update comments
- Now call TOMAS routine AQOXID with fromWetDep=.FALSE. so that the
  proper internal unit conversion will be applied

GeosCore/sulfate_mod.F90
- Remove mapping=State_Chm%Map_Advect from calls to Convert_Spc_Units,
  which will convert all species units
- Add an error trap after routine CHEM_SO4_AQ
- Now call TOMAS routine AQOXID with fromWetDep=.FALSE. so that the
  proper internal unit conversion will be applied

GeosCore/tomas_mod.F90
- Remove commented out, obsolete unit conversion code
- Remove mapping=State_Chm%Map_Advect from calls to Check_Units,
  which will check if all species have units of in kg.
- Added fromWetDep argument to routine AQOXID.  If fromWetDep is TRUE
  then convert units from kg/m2 -> kg.  Otherwise, do no unit
  conversion (as units are already in kg in the calling routine).
- Added UnitFactor argument to routine GETFRACTION.  The unit conversion
  factor (either State_Met%AD(I,J,L) or State_Grid%AREA_M2(I,J)) will
  be passed from the calling program, depending on whether units need
  to be converted from kg/kg dry or from kg/m2.

GeosCore/wetscav_mod.F90
- In routine COMPUTE_F:
  - Pass State_Met%AD(I,J,L) to GETFRACTION via the UnitFactor argument.
    This converts kg/kg dry -> kg for TOMAS.
- In routine WETDEP:
  - Convert all species units for TOMAS.
  - Convert only wetdep species units if we are not using TOMAS.
- In routine DO_RAINOUT_ONLY:
  - Pass State_Grid%Area_M2(I,J) to GETFRACTION via UnitFactor argument.
    This will convert kg/m2 -> kg for TOMAS.
- In routine DO_WASHOUT_ONLY and DO_WASHOUT_AT_SFC,
  - Arrange arguments to WASHOUT by inputs, input/outputs, and outputs.
  - Pass  fromWetDep=.TRUE. for TOMAS only.
  - Call AQOXID with fromWetDep=.TRUE.
- In routine DO_COMPLETE_REEVAP,
  - Call AQOXID with fromWetDep-.TRUE.

GeosCore/unitconv_mod.F90
- In the ConvertBox_* routines, restore loop over all species
- Trimmed trailing whitespace

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@lizziel
Copy link
Contributor

lizziel commented Apr 11, 2024

With respect to no diff, looks good to me!

Copy link
Contributor Author

@lizziel @msulprizio: Thanks! I am doing integration test off of alpha.9 (where the branch is now). Then will merge up to dev/14.4.0 (locally) and test after the volcano update.

GeosCore/wetscav_mod.F90
- Adding missing "=" sign in call to WASHOUT at line 4475
- Changed capitalization: "phRain" -> "pHRain"

GeosCore/convection_mod.F90
- Changed capitalization: "phRain" -> "pHRain"

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
Interfaces/GCHP/gchp_chunk_mod.F90
- In routine GCHP_CHUNK_RUN:
  - Add loop variable N
  - Removed reference to State_Chm%allSpeciesInDryMixingRatio
  - Now define species units in a loop over 1..nSpecies.  This would
    avoid a compilation error when using a mask to a pointer field.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
This merge brings the dev/14.4.0 branch as of PR #2246 (Update volcano
emissions through 2023, by @msulprizio).  This is necesary in order to
include various updates and bug fixes from the 14.3.1 release.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
This fixes the issue described in geoschem/geos-chem #2250.

run/shared/setupConfigFiles.sh
- We now reset EFYO -> CYS for the SPC_ container in HEMCO_Config.rc
  (which is the container for restart file variables).

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
GeosCore/wetscav_mod.F90
- Now define REEVAPSO2 in routines DO_WASHOUT_ONLY and
  DO_COMPLETE_REEVAP when the units are in kg species.

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
…ory( )

This merge brings the hotfix for the volcano climatology file (by
@msulprizio) into the feature/unitconv-per-species-category branch.
This should have been merged previously but was omitted due to an
oversight.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca yantosca added the topic: Math and Units Issues pertaining to math expressions and/or unit conversions label Apr 16, 2024
GeosCore/wetscav_mod.F90
- Initialize REEVAPSO2 and KMIN in the loop over wetdep species
- Define REEVAPSO2 and convert from kg/m2 to kg if necessary
- Remove error traps, they seem to be obsolete as as all species
  are either in kg or kg/m2 for TOMAS

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca
Copy link
Contributor Author

I've merged 14.4.0-alpha.12 into the feature/unitconv-per-species-category branch and re-ran integration tests. The GEOS-Chem Classic tests all passed:

==============================================================================
GEOS-Chem Classic: Execution Test Results

GCClassic #965e66d GEOS-Chem submodule update: Add hotfix to correct typo in volcano emission file name
GEOS-Chem #49782e849 Make sure REEVAPSO2 is properly defined in kg
HEMCO     #fddcae5 Update version to 3.8.1 for release

Using 24 OpenMP threads
Number of execution tests: 29

Submitted as SLURM job: 28408502
==============================================================================

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%  All execution tests passed!  %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

@yantosca
Copy link
Contributor Author

@msulprizio, @lizziel: I ran a set of integration tests w/o the carbon simulation tests. All integration tests passed. We will look into the carbon simulation issues in a separate PR. I think it is OK to merge so as not to hold up the 14.4.0 release.

==============================================================================
GCHP: Execution Test Results

GCHP      #85f9efc GEOS-Chem submodule update: Add hotfix to correct typo in volcano emission file name
GEOS-Chem #49782e849 Make sure REEVAPSO2 is properly defined in kg
HEMCO     #fddcae5 Update version to 3.8.1 for release

Number of execution tests: 6

Submitted as SLURM job: 29233300
==============================================================================
 
Execution tests:
------------------------------------------------------------------------------
gchp_merra2_fullchem................................Execute Simulation....PASS
gchp_merra2_fullchem_benchmark......................Execute Simulation....PASS
gchp_merra2_fullchem_RRTMG..........................Execute Simulation....PASS
gchp_merra2_fullchem_TOMAS15........................Execute Simulation....PASS
gchp_merra2_tagO3...................................Execute Simulation....PASS
gchp_merra2_TransportTracers........................Execute Simulation....PASS
 
Summary of test results:
------------------------------------------------------------------------------
Execution tests passed: 6
Execution tests failed: 0
Execution tests not yet completed: 0

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%  All execution tests passed!  %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

@yantosca yantosca requested a review from msulprizio April 22, 2024 19:44
@yantosca
Copy link
Contributor Author

Am merging locally up to 14.4.0 and re-running integration tests.

@yantosca
Copy link
Contributor Author

After merging on top of 14.4.0-alpha.12, all GEOS-Chem Classic integration tests passed:

==============================================================================
GEOS-Chem Classic: Execution Test Results

GCClassic #a4231d5 GEOS-Chem submod update: Merge PR #2260 (Use "stale" GitHub action)
GEOS-Chem #2f7c05bba Merge PR #2072 (Only convert units for species that require it)
HEMCO     #fddcae5 Update version to 3.8.1 for release

Using 24 OpenMP threads
Number of execution tests: 29

Submitted as SLURM job: 29253161
==============================================================================

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%  All execution tests passed!  %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

@yantosca
Copy link
Contributor Author

All GCHP integration tests also passed:

==============================================================================
GCHP: Execution Test Results

GCHP      #ad4667a GEOS-Chem submod update: Merge PR #2260 (Use "stale" GitHub action)
GEOS-Chem #2f7c05bba Merge PR #2072 (Only convert units for species that require it)
HEMCO     #fddcae5 Update version to 3.8.1 for release

Number of execution tests: 11

Submitted as SLURM job: 29252666
==============================================================================
 
Execution tests:
------------------------------------------------------------------------------
gchp_merra2_carbon..................................Execute Simulation....PASS
gchp_merra2_carbon_CH4..............................Execute Simulation....PASS
gchp_merra2_carbon_CO...............................Execute Simulation....PASS
gchp_merra2_carbon_CO2..............................Execute Simulation....PASS
gchp_merra2_carbon_OCS..............................Execute Simulation....PASS
gchp_merra2_fullchem................................Execute Simulation....PASS
gchp_merra2_fullchem_benchmark......................Execute Simulation....PASS
gchp_merra2_fullchem_RRTMG..........................Execute Simulation....PASS
gchp_merra2_fullchem_TOMAS15........................Execute Simulation....PASS
gchp_merra2_tagO3...................................Execute Simulation....PASS
gchp_merra2_TransportTracers........................Execute Simulation....PASS
 
Summary of test results:
------------------------------------------------------------------------------
Execution tests passed: 11
Execution tests failed: 0
Execution tests not yet completed: 0

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%  All execution tests passed!  %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

NOTE: The carbon simulation integration tests passed, but runs having CH4 data ran much more slowly than usual. We are currently looking into this.

@yantosca yantosca added this to the 14.4.0 milestone Apr 23, 2024
@yantosca yantosca merged commit 2f7c05b into dev/14.4.0 Apr 23, 2024
@yantosca yantosca deleted the feature/unitconv-per-species-category branch April 23, 2024 15:59
@gopikrishnangs44
Copy link

Hi @yantosca

I am trying to simulate GCAP.

Encountered the same error, as below

HEMCO: Opening ./Restarts/GEOSChem.Restart.20450101_0000z.nc4

HEMCO ERROR: Cannot find field SPC_BUTDI. Please check variable name in the config. file

HEMCO ERROR: Error encountered in routine HCOIO_Read!

HEMCO ERROR: Error in HCOIO_DATAREAD called from HEMCO ReadList_Fill: SPC_BUTDI
 --> LOCATION: ReadList_Fill (HCO_ReadList_Mod.F90)

HEMCO ERROR: Error in called ReadList_Fill (7) from HEMCO ReadList_Read
 --> LOCATION: ReadList_Read (HCO_ReadList_Mod.F90)
 Error in ReadList_Read called from hco_run
===============================================================================
GEOS-Chem ERROR: Error encountered in "HCO_Run"!
 -> at HCOI_GC_Run (in module GeosCore/hco_interface_gc_mod.F90)

THIS ERROR ORIGINATED IN HEMCO!  Please check the HEMCO log file for
additional error messages!
===============================================================================


Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x15555363eb4f in ???
#1  0x155554a63169 in sflush
        at /local/gg2995/spack-stage/spack-stage-gcc-10.2.0-ca5qgfppgl4tppua3svba6vehsuvjayp/spack-src/libgfortran/io/unix.h:89
#2  0x456c62 in __emissions_mod_MOD_emissions_run
        at /burg/fiore_new/users/gg2995/test2/gc_2x25_ModelE2.1_fullchem/CodeDir/src/GEOS-Chem/GeosCore/emissions_mod.F90:184
#3  0x4068c4 in geos_chem
        at /burg/fiore_new/users/gg2995/test2/gc_2x25_ModelE2.1_fullchem/CodeDir/src/GEOS-Chem/Interfaces/GCClassic/main.F90:667
#4  0x405556 in main
        at /burg/fiore_new/users/gg2995/test2/gc_2x25_ModelE2.1_fullchem/CodeDir/src/GEOS-Chem/Interfaces/GCClassic/main.F90:32

@lizziel
Copy link
Contributor

lizziel commented Nov 18, 2024

@gopikrishnangs44, please create a new issue to request help.

@gopikrishnangs44
Copy link

HI @lizziel

I figured it out by changing the SPC restart from EY to CYS.

Thank for the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Feature Request New feature or request no-diff-to-benchmark This update will not change the results of fullchem benchmark simulations topic: Math and Units Issues pertaining to math expressions and/or unit conversions topic: Performance Related to GEOS-Chem speed, memory, or parallelization topic: Structural Modifications Related to GEOS-Chem structural modifications (as opposed to scientific updates)
Projects
None yet
5 participants