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

Fixes for reading masks in HEMCO (merge bugfix/masks into HEMCO 3.7.0) #198

Merged
merged 3 commits into from
Apr 10, 2023

Conversation

yantosca
Copy link
Contributor

@yantosca yantosca commented Mar 7, 2023

Name and Institution (Required)

Name: Bob Yantosca
Institution: Harvard + GCST

Confirm you have reviewed the following documentation

Describe the update

This brings the bugfix/masks branch (which prevents trying to read a mask from disk if its entry does not end in *.nc* into the 3.7.0 develpment branch.

Expected changes

This brings together a fix implemented by @jimmielin when using HEMCO in MPI environments (GCHP, GEOS, WRF, CESM), as described below:

          ! Because the code only distinguishes between full/partial and zero
          ! coverage, and skips reading the base field if coverage is zero,
          ! this may cause issues with MPI environments in WRF and CESM where
          ! the mask lon1/lat1/lon2/lat2 boundaries are set too small compared
          ! to the mask, and result in the base field being skipped over small
          ! CPU decompositions where it should not have been. The above fix
          ! does not fix the issue where ThisCover == 0, which is the root
          ! cause in WRF and CESM. Thus, always set to partial coverage
          ! (hplin, 8/19/22)

with a bug fix by @yantosca to avoid reading a mask from disk if the filename is -:

          ! If ncFile is passed as the lon1/lat1/lon2/lat2 instead
          ! of netCDF file name, then set ncRead to false, so that
          ! HEMCO won't try to read a file from disk.  Also set the
          ! IsLocTime flag to TRUE.  This should fix Github issue
          ! https://github.com/geoschem/HEMCO/issues/153.
          !  -- Bob Yantosca (12 Jul 2022)
          IF ( INDEX( Lct%Dct%Dta%ncFile, ".nc" ) == 0 ) THEN
             Lct%Dct%Dta%ncRead    = .FALSE.
             Lct%Dct%Dta%IsLocTime = .TRUE.
          ENDIF

Reference(s)

N/A

Related Github Issue(s)

See issue #163

yantosca added 2 commits July 12, 2022 13:42
src/Core/hco_config_mod.F90
- Add an IF block to handle the case of HEMCO masks that are specified as
  lon1/lat1/lon2/lat2.  For these masks, we flag them as not to be read
  from disk (Lct%Dct%Dta%ncRead=.FALSE.) and that they are in local
  time (Lct%Dct%Dta%IsLocTime=.TRUE.)

src/Core/hcoio_read_std_mod.F90
- Add an IF block that returns from routine HCOIO_Read for HEMCO masks
  specified as lon1/lat1/lon2/lat2.

This commit should fix the issue raised in geoschem/HEMCO #153.

Signed-off-by: Bob Yantosca <[email protected]>
This merge brings the bugfix/masks branch up to date with the
HEMCO 3.7.0 development branch.  In src/Core/hco_config_mod.F90,
we resolved a merge conflict so that updates from both branches
are now brought forward.

Signed-off-by: Bob Yantosca <[email protected]>
@yantosca yantosca added category: Bug Something isn't working topic: Scaling or Masking Related to issues in applying scale factors or masks labels Mar 7, 2023
@yantosca yantosca requested a review from msulprizio March 7, 2023 15:28
@yantosca yantosca self-assigned this Mar 7, 2023
@yantosca yantosca added this to the 3.7.0 milestone Mar 7, 2023
@yantosca yantosca changed the title Bugfix/masks Fixes for reading masks in HEMCO (merge bugfix/masks into HEMCO 3.7.0) Mar 7, 2023
CHANGELOG.md
- Add sentence about not reading masks if filename is '-'
- Add sentence about bug fix in #163 for ESMF environment and masks

Signed-off-by: Bob Yantosca <[email protected]>
@stale
Copy link

stale bot commented Apr 6, 2023

This issue has been automatically marked as stale because it has not had recent activity. If there are no updates within 7 days it will be closed. You can add the "never stale" tag to prevent the Stale bot from closing this issue.

@stale stale bot added the stale No recent activity on this issue label Apr 6, 2023
@msulprizio msulprizio removed the stale No recent activity on this issue label Apr 6, 2023
@msulprizio msulprizio merged commit cbce0a0 into dev/3.7.0 Apr 10, 2023
@msulprizio msulprizio deleted the bugfix/masks branch April 10, 2023 17:25
@yantosca yantosca added category: Bug Fix Fixes a bug that was previously reported and removed category: Bug Something isn't working labels Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Fix Fixes a bug that was previously reported topic: Scaling or Masking Related to issues in applying scale factors or masks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants