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

Update netCDF code (in src/Shared/NcdfUtil) to use the netCDF-F90 interface #226

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

yantosca
Copy link
Contributor

Name and Institution (Required)

Name: Bob Yantosca
Institution: Harvard + GCST

Confirm you have reviewed the following documentation

Describe the update

We have updated the HEMCO netCDF reading/writing routines in src/Shared/NcdfUtil from the netCDF-F77 interface to the netCDF-F90 interface. This is necessary to satisfy merging requirements for CESM.

The updates mainly involve:

  • Replacing INCLUDE "netcdf.inc" with USE netCDF
  • Replacing NF_ with NF90_ in netCDF parameters and function calls
  • Replacing obsolete netCDF-F77 routines with equivalent netCDF-F90 functionality
  • Also the hco_m_netcdf_io_read.F90 was indented according to F90 free-format.

Expected changes

This is a zero-diff update. No changes are expected.

Reference(s)

N/A

Related Github Issue(s)

Closes #225

Also tagging @jimmielin

src/Core/hcoio_write_std_mod.F90
- Set Compress=.FALSE. for the P0 variable.  This prevents a netCDF
  error when netCDF tries to compress a zero-dimension variable.

src/shared/NcdfUtil/hco_m_netcdf_*.F90
- Replaced"INCLUDE netcdf.inc" with "use netCDF"
- Now use the NF90_ function and variables

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <[email protected]>
src/Shared/NcdfUtil/hco_m_netcdf_io_define.F90
- Eliminate ELSE blocks by using never-nesting techniques
- First execute the IF block in the #ifdef.  If COMPRESS is not
  passed, or is false, or if ndims == 0, then do not create the
  variable with netCDF compression.

Signed-off-by: Bob Yantosca <[email protected]>
@yantosca yantosca added category: Feature Request New feature or request category: Interface to External Model Related to HEMCO updates needed to interface with other models (GEOS, WRF, CESM, etc) topic: Structural Modifications Related to HEMCO structural modifications (as opposed to scientific updates) no-diff-to-benchmark This update will have no impact on benchmark simulations labels Jul 17, 2023
@yantosca yantosca added this to the 3.7.1 milestone Jul 17, 2023
@yantosca yantosca requested a review from lizziel July 17, 2023 14:39
@yantosca yantosca self-assigned this Jul 17, 2023
@yantosca yantosca linked an issue Jul 17, 2023 that may be closed by this pull request
1 task
@yantosca
Copy link
Contributor Author

Integration tests are running.

@yantosca
Copy link
Contributor Author

When merged atop PR #1874 and PR #1876, GEOS-Chem Classic integration tests passed (except for TOMAS, which is a known issue that will be fixed later

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

GCClassic #2c2dab8 GEOS-Chem submod updates: Merge PR #1874 and PR #1876 (GCHP updates)
GEOS-Chem #f9d697f18 Merge PR #1876 (Use standard format for AEIC monthly clim in ExtData.rc)
HEMCO     #725972f PR #226 post-merge fixes: Update CHANGELOG.md

Using 24 OpenMP threads
Number of execution tests: 26

Submitted as SLURM job: 63112103
==============================================================================

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 #1874 and PR #1876, except for APM (known issue) and RRTMG diagnostics (see #1869).

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_r10/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.Metrics.20190701_0000z.nc4 
        GCC_14.2.1_r11/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.Metrics.20190701_0000z.nc4 
      * GCC_14.2.1_r10/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.SpeciesConc.20190701_0000z.nc4 
        GCC_14.2.1_r11/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.SpeciesConc.20190701_0000z.nc4 
   -> 1 difference found in Restarts
      * GCC_14.2.1_r10/rundirs/gc_4x5_merra2_fullchem_APM/Restarts/GEOSChem.Restart.20190701_0100z.nc4 
        GCC_14.2.1_r11/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_r10/rundirs/gc_4x5_merra2_fullchem_RRTMG/OutputDir/GEOSChem.RRTMG.20190701_0000z.nc4 
        GCC_14.2.1_r11/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

@jimmielin
Copy link
Collaborator

Thanks @yantosca for working on this! We will submit a PR to update it downstream in HEMCO-CESM when 3.7.1 is released.

@yantosca
Copy link
Contributor Author

When merged atop PR #1874 and PR #1876, all GCHP integration tests passed (except for TOMAS, which is a known issue that will be fixed later).

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

GCClassic #baad1bd GEOS-Chem submod updates: Merge PR #1874 and PR #1876 (GCHP updates)
GEOS-Chem #f9d697f18 Merge PR #1876 (Use standard format for AEIC monthly clim in ExtData.rc)
HEMCO     #725972f PR #226 post-merge fixes: Update CHANGELOG.md

Number of execution tests: 5

Submitted as SLURM job: 63113136
==============================================================================
 
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 #1874 and PR #1876:

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 merge. Thanks Bob!

yantosca added a commit that referenced this pull request Jul 17, 2023
CHANGELOG.md
- Now list the PR #226 (Update HEMCO netCDF I/O code to use the
netCDF-F90 interface) under version 3.7.1.

Signed-off-by: Bob Yantosca <[email protected]>
@yantosca yantosca merged commit f2b9d17 into dev/3.7.1 Jul 17, 2023
@yantosca yantosca deleted the feature/hco-netcdf-f90 branch July 17, 2023 19:04
yantosca added a commit that referenced this pull request Jul 20, 2023
This merge brings PR #227 (Fix several minor issues not addressed in
PR #226, by @yantosca) into the HEMCO 3.7.1 development stream.

Important features added
- Convert hco_m_netcdf_io_write.F90 module to use netCDF-F90 interface
- Remove leftover calls to netCDF-F77 functions
- Updated comment headers

Signed-off-by: Bob Yantosca <[email protected]>
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 category: Interface to External Model Related to HEMCO updates needed to interface with other models (GEOS, WRF, CESM, etc) no-diff-to-benchmark This update will have no impact on benchmark simulations topic: Structural Modifications Related to HEMCO structural modifications (as opposed to scientific updates)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to update HEMCO I/O routines to use the netCDF-F90 interface
3 participants