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

Convert GEOS-Chem netCDF utility routines to use the netCDF-F90 interface #1882

Merged
merged 4 commits into from
Jul 20, 2023

Conversation

yantosca
Copy link
Contributor

@yantosca yantosca commented Jul 18, 2023

Name and Institution (Required)

Name: Bob Yantosca
Institution: Harvard + GCST

Confirm you have reviewed the following documentation

Describe the update

This PR is the analog to geoschem/HEMCO PR #226. It updates the GEOS-Chem netCDF I/O utilities (located in the NcdfUtil folder) to use the netCDF-F90 interface rather than netCDF-F77. This is a requirement for eventually merging GEOS-Chem into the CESM model.

Expected changes

This is a zero-diff update, as it does not touch any science code.

Reference(s)

N/A

Related Github Issue(s)

yantosca added 2 commits July 18, 2023 16:39
NcdfUtil/m_netcdf_*.F90
NcdfUtil/ncdf_mod.F90
- Replaced "INCLUDE netcdf.inc" with "use netCDF"
- Now use the NF90_ function and variables
- Added equivalent netCDF f u
- Use F90 indentation style
- Trimmed trailing whitespace

CHANGELOG.md
- Updated accordingly

    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
CHANGELOG.md
- This should have been updated in the prior commit 7282c0e,
  but was omitted.  Updating now.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@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 labels Jul 18, 2023
@yantosca yantosca added this to the 14.2.1 milestone Jul 18, 2023
@yantosca yantosca requested a review from lizziel July 18, 2023 21:37
@yantosca yantosca self-assigned this Jul 18, 2023
@yantosca
Copy link
Contributor Author

Integration tests are now running.

yantosca added 2 commits July 19, 2023 11:08
NcdfUtil/m_netcdf_io_read.F90
- Remove code that used NF_NOERR -- this was leftover after applying
  the corresponding updates from the HEMCO/src/Shared/NcdfUtil code

NcdfUtil/m_netcdf_io_read.F90
- Fix typo: NF90_Put_Var_Double -> NF90_Put_Var

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
NcdfUtil/m_netcdf_io_readattr.F90
- Add NcGet_Var_Attr_C_nostop to the interface NcGet_Var_Attributes,
  this was omitted in the prior commit
- Add USE statements in routine NcGet_Glob_Attr_R4

NcdfUtil/m_netcdf_io_write.F90
- Fix typo: "NF90_Put_Vara" -> "NF90_Put_Var"

NcdfUtil/ncdf_mod.F90
- Add "USE netCDF" at top of module with other USE statements
- Fix typo: "NF_TYPE" -> "NF90_TYPE"
- Remove leftover '#include "netcdf.inc"' statements, these are
  for the netCDF-F77 interface

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

After merging on top of PR #1879, all GEOS-Chem Classic integration tests passed (except TOMAS, which is a known issue):

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

GCClassic #2773dc8 GEOS-Chem submod updates: Set ESMF logging mode at run-time
GEOS-Chem #5c8050f08 Merge PR #1882 (Convert GEOS-Chem netCDF routines to use netCDF-F90)
HEMCO     #599775d Merge PR #227 (Fix several minor issues not addressed in PR #226)

Using 24 OpenMP threads
Number of execution tests: 26

Submitted as SLURM job: 63552572
==============================================================================
 
Execution tests:
------------------------------------------------------------------------------
gc_05x0625_NA_47L_merra2_CH4........................Execute Simulation....PASS
gc_05x0625_NA_47L_merra2_fullchem...................Execute Simulation....PASS
gc_4x5_47L_merra2_fullchem..........................Execute Simulation....PASS
gc_4x5_47L_merra2_fullchem_TOMAS15..................Execute Simulation....FAIL
gc_4x5_47L_merra2_fullchem_TOMAS40..................Execute Simulation....FAIL
gc_4x5_merra2_aerosol...............................Execute Simulation....PASS
gc_4x5_merra2_carbon................................Execute Simulation....PASS
gc_4x5_merra2_CH4...................................Execute Simulation....PASS
gc_4x5_merra2_CO2...................................Execute Simulation....PASS
gc_4x5_merra2_fullchem..............................Execute Simulation....PASS
gc_4x5_merra2_fullchem_aciduptake...................Execute Simulation....PASS
gc_4x5_merra2_fullchem_APM..........................Execute Simulation....PASS
gc_4x5_merra2_fullchem_benchmark....................Execute Simulation....PASS
gc_4x5_merra2_fullchem_complexSOA...................Execute Simulation....PASS
gc_4x5_merra2_fullchem_complexSOA_SVPOA.............Execute Simulation....PASS
gc_4x5_merra2_fullchem_LuoWd........................Execute Simulation....PASS
gc_4x5_merra2_fullchem_marinePOA....................Execute Simulation....PASS
gc_4x5_merra2_fullchem_RRTMG........................Execute Simulation....PASS
gc_4x5_merra2_Hg....................................Execute Simulation....PASS
gc_4x5_merra2_metals................................Execute Simulation....PASS
gc_4x5_merra2_POPs_BaP..............................Execute Simulation....PASS
gc_4x5_merra2_tagCH4................................Execute Simulation....PASS
gc_4x5_merra2_tagCO.................................Execute Simulation....PASS
gc_4x5_merra2_tagO3.................................Execute Simulation....PASS
gc_4x5_merra2_TransportTracers......................Execute Simulation....PASS
gc_4x5_merra2_TransportTracers_LuoWd................Execute Simulation....PASS
 
Summary of test results:
------------------------------------------------------------------------------
Execution tests passed: 24
Execution tests failed: 2
Execution tests not yet completed: 0

Furthermore, most integration tests were identical to PR #1879. The exceptions are:

  • TOMAS (failed integration tests)
  • APM (known parallelization issue, will be fixed later)
  • RRTMG diagnostic output (known parallelization issue, will be fixed later)
Checking gc_05x0625_NA_47L_merra2_CH4
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_05x0625_NA_47L_merra2_fullchem
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_47L_merra2_fullchem
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_47L_merra2_fullchem_TOMAS15
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_47L_merra2_fullchem_TOMAS40
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_aerosol
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_carbon
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_CH4
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_CO2
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_fullchem
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_fullchem_aciduptake
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_fullchem_APM
   -> 2 differences found in OutputDir
      * GCC_14.2.1_r12/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.Metrics.20190701_0000z.nc4 
        GCC_14.2.1_r13/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.Metrics.20190701_0000z.nc4 
      * GCC_14.2.1_r12/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.SpeciesConc.20190701_0000z.nc4 
        GCC_14.2.1_r13/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.SpeciesConc.20190701_0000z.nc4 
   -> 1 difference found in Restarts
      * GCC_14.2.1_r12/rundirs/gc_4x5_merra2_fullchem_APM/Restarts/GEOSChem.Restart.20190701_0100z.nc4 
        GCC_14.2.1_r13/rundirs/gc_4x5_merra2_fullchem_APM/Restarts/GEOSChem.Restart.20190701_0100z.nc4 

Checking gc_4x5_merra2_fullchem_benchmark
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_fullchem_complexSOA
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_fullchem_complexSOA_SVPOA
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_fullchem_LuoWd
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_fullchem_marinePOA
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_fullchem_RRTMG
   -> 1 difference found in OutputDir
      * GCC_14.2.1_r12/rundirs/gc_4x5_merra2_fullchem_RRTMG/OutputDir/GEOSChem.RRTMG.20190701_0000z.nc4 
        GCC_14.2.1_r13/rundirs/gc_4x5_merra2_fullchem_RRTMG/OutputDir/GEOSChem.RRTMG.20190701_0000z.nc4 
   -> No differences in Restarts

Checking gc_4x5_merra2_Hg
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_metals
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_POPs_BaP
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_tagCH4
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_tagCO
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_tagO3
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_TransportTracers
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gc_4x5_merra2_TransportTracers_LuoWd
   -> No differences in OutputDir
   -> No differences in Restarts

@yantosca
Copy link
Contributor Author

After merging on top of PR #1879, all GCHP integration tests passed:

GCHP: Execution Test Results

GCClassic #5994b33 Merge PR #330 (Set ESMF logging option at run-time via config file)
GEOS-Chem #5c8050f08 Merge PR #1882 (Convert GEOS-Chem netCDF routines to use netCDF-F90)
HEMCO     #599775d Merge PR #227 (Fix several minor issues not addressed in PR #226)

Number of execution tests: 5

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

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

Furthermore, all GCHP integration tests were zero-diff w/r/t PR #1879:

Checking gchp_merra2_fullchem
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gchp_merra2_fullchem_benchmark
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gchp_merra2_fullchem_RRTMG
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gchp_merra2_tagO3
   -> No differences in OutputDir
   -> No differences in Restarts

Checking gchp_merra2_TransportTracers
   -> No differences in OutputDir
   -> No differences in Restarts

Copy link
Contributor

@lizziel lizziel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I am no expert in the netcdf libraries so might have missed something, but I think the integration and diff tests should catch any errors. Thanks @yantosca for taking this on!

@yantosca yantosca merged commit 5c8050f into dev/14.2.1 Jul 20, 2023
@yantosca yantosca deleted the feature/use-netcdf-f90 branch July 20, 2023 17:45
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: Structural Modifications Related to GEOS-Chem structural modifications (as opposed to scientific updates)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants