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

Use MAPL_UNDEF value for HEMCO missing values if using GCHP or GEOS #171

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased 3.6.0]
### Added
- placeholder
- Added MAPL_ESMF compiler option for use with GCHP and GEOS

### Changed
- placeholder
- Set HCO_MISSVAL to MAPL missing value (1e15) if using GCHP or GEOS

### Fixed
- placeholder

### Removed
- placeholder
- Removed old kludge for MAPL missing data if applying mask

## [3.5.0] - 2022-09-19
### Added
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ if(HEMCO_EXTERNAL_CONFIG AND MAPL_ESMF)
INTERFACE $<TARGET_PROPERTY:MAPL.generic,INTERFACE_INCLUDE_DIRECTORIES>
)
target_compile_definitions(HEMCOBuildProperties
INTERFACE ESMF_
INTERFACE ESMF_ MAPL_ESMF
)

# Specify the HEMCO interface being used
Expand Down
18 changes: 2 additions & 16 deletions src/Core/hco_calc_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1035,15 +1035,8 @@ SUBROUTINE Get_Current_Emissions( HcoState, BaseDct, nI, nJ, &
TMPVAL = BaseDct%Dta%V3(tIDx)%Val(I,J,L)
ENDIF

! If it's a missing value, mask box as unused and set value to
! zero
#if defined( ESMF_ )
! SDE 2017-01-07: Temporary kludge. MAPL ExtData sets missing
! data to 1e15, but HEMCO uses a different value!
IF ( ( TMPVAL == HCO_MISSVAL ) .or. ( TMPVAL > 1.0e+14 ) ) THEN
#else
! If it's a missing value, mask box as unused and set value to zero
IF ( TMPVAL == HCO_MISSVAL ) THEN
#endif
MASK(I,J,:) = 0.0_hp
OUTARR_3D(I,J,L) = 0.0_hp

Expand Down Expand Up @@ -3086,15 +3079,8 @@ SUBROUTINE Get_Current_Emissions_Adj( HcoState, BaseDct, &
TMPVAL = BaseDct%Dta%V3(tIDx)%Val(I,J,L)
ENDIF

! If it's a missing value, mask box as unused and set value to
! zero
#if defined( ESMF_ )
! SDE 2017-01-07: Temporary kludge. MAPL ExtData sets missing
! data to 1e15, but HEMCO uses a different value!
IF ( ( TMPVAL == HCO_MISSVAL ) .or. ( TMPVAL > 1.0e+14 ) ) THEN
#else
! If it's a missing value, mask box as unused and set value to zero
IF ( TMPVAL == HCO_MISSVAL ) THEN
#endif
MASK(I,J,:) = 0.0_hp
OUTARR_3D(I,J,L) = 0.0_hp

Expand Down
8 changes: 8 additions & 0 deletions src/Core/hco_error_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ MODULE HCO_Error_Mod
!
! !USES:
!
#if defined( MAPL_ESMF )
USE MAPL_Base, ONLY: MAPL_UNDEF
#endif

IMPLICIT NONE
PRIVATE
!
Expand Down Expand Up @@ -94,7 +98,11 @@ MODULE HCO_Error_Mod
! Missing value
! Note: define missing value as single precision because all data arrays
! are read/stored in single precision.
#if defined( MAPL_ESMF )
REAL(sp), PARAMETER, PUBLIC :: HCO_MISSVAL = MAPL_UNDEF
#else
REAL(sp), PARAMETER, PUBLIC :: HCO_MISSVAL = -1.e31_sp
#endif

! HEMCO version number.
CHARACTER(LEN=12), PARAMETER, PUBLIC :: HCO_VERSION = '3.6.0'
Expand Down