Skip to content

Commit

Permalink
Add TSOIL1 field to ExtState object for soil NOx extension
Browse files Browse the repository at this point in the history
Signed-off-by: Melissa Sulprizio <[email protected]>
  • Loading branch information
msulprizio committed Aug 15, 2024
1 parent af21f3c commit 99ee81b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased - TBD
### Added
- Added TSOIL1 field to ExtState

### Changed
- Updated soil NOx extention to include the option to use soil temperature and parameterization based on Yi Wang et al. (ERL, 2021) instead of the temperature at 2 meters.

Expand Down
8 changes: 8 additions & 0 deletions src/Extensions/hcox_state_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ MODULE HCOX_STATE_MOD
TYPE(ExtDat_2R), POINTER :: ALBD ! Surface albedo [-]
TYPE(ExtDat_2R), POINTER :: T2M ! 2m Sfce temperature [K]
TYPE(ExtDat_2R), POINTER :: TSKIN ! Surface skin temperature [K]
TYPE(ExtDat_2R), POINTER :: TSOIL1 ! Soil temperature, layer 1 [K]
TYPE(ExtDat_2R), POINTER :: GWETROOT ! Root soil wetness [1]
TYPE(ExtDat_2R), POINTER :: GWETTOP ! Top soil moisture [-]
TYPE(ExtDat_2R), POINTER :: SNOWHGT ! Snow height [mm H2O = kg H2O/m2]
Expand Down Expand Up @@ -355,6 +356,12 @@ SUBROUTINE ExtStateInit( ExtState, RC )
RETURN
ENDIF

CALL ExtDat_Init ( ExtState%TSOIL1, RC )
IF ( RC /= HCO_SUCCESS ) THEN
CALL HCO_ERROR( 'Initializing TSOIL1', RC, THISLOC=LOC )
RETURN
ENDIF

CALL ExtDat_Init ( ExtState%GWETROOT, RC )
IF ( RC /= HCO_SUCCESS ) THEN
CALL HCO_ERROR( 'ERROR 6', RC, THISLOC=LOC )
Expand Down Expand Up @@ -676,6 +683,7 @@ SUBROUTINE ExtStateFinal( ExtState )
CALL ExtDat_Cleanup( ExtState%ALBD )
CALL ExtDat_Cleanup( ExtState%T2M )
CALL ExtDat_Cleanup( ExtState%TSKIN )
CALL ExtDat_Cleanup( ExtState%TSOIL1 )
CALL ExtDat_Cleanup( ExtState%GWETROOT )
CALL ExtDat_Cleanup( ExtState%GWETTOP )
CALL ExtDat_Cleanup( ExtState%SNOWHGT )
Expand Down
17 changes: 16 additions & 1 deletion src/Interfaces/Standalone/hcoi_standalone_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2210,7 +2210,7 @@ SUBROUTINE ExtState_SetFields ( HcoState, ExtState, RC )
ENDIF
ENDIF

!%%%%% Air and skin temperature %%%%%
!%%%%% Air temperature %%%%%
IF ( ExtState%T2M%DoUse ) THEN
Name = 'T2M'
CALL ExtDat_Set( HcoState, ExtState%T2M, &
Expand All @@ -2224,6 +2224,7 @@ SUBROUTINE ExtState_SetFields ( HcoState, ExtState, RC )
ENDIF
ENDIF

!%%%%% Skin temperature %%%%%
IF ( ExtState%TSKIN%DoUse ) THEN
Name = 'TS'
CALL ExtDat_Set( HcoState, ExtState%TSKIN, &
Expand All @@ -2237,6 +2238,20 @@ SUBROUTINE ExtState_SetFields ( HcoState, ExtState, RC )
ENDIF
ENDIF

!%%%%% Soil temperature %%%%%
IF ( ExtState%TSOIL1%DoUse ) THEN
Name = 'TSOIL1'
CALL ExtDat_Set( HcoState, ExtState%TSOIL1, &
TRIM( Name ), RC, FIRST=FIRST )
IF ( RC /= HCO_SUCCESS ) THEN
ErrMsg = 'Could not find quantity "' // TRIM( Name ) // &
'" for the HEMCO standalone simulation!'
CALL HCO_Error( ErrMsg, RC, ThisLoc )
CALL HCO_Leave( HcoState%Config%Err, RC )
RETURN
ENDIF
ENDIF

!%%%%% Soil moisture %%%%%
IF ( ExtState%GWETROOT%DoUse ) THEN
Name = 'GWETROOT'
Expand Down

0 comments on commit 99ee81b

Please sign in to comment.