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

Fix unit conversion code for TOMAS following merge with 14.2.3 #2063

Merged
merged 1 commit into from
Dec 8, 2023
Merged
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
25 changes: 19 additions & 6 deletions GeosCore/fullchem_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1806,7 +1806,7 @@ SUBROUTINE TOMAS_SO4_AQ( Input_Opt, State_Chm, State_Grid, &
USE State_Met_Mod, ONLY : MetState
USE State_Diag_Mod, ONLY : DgnState
USE TOMAS_MOD, ONLY : AQOXID, GETACTBIN,PSO4AQ_RATE
USE UnitConv_Mod, ONLY : Convert_Spc_Units
USE UnitConv_Mod
!
! !INPUT PARAMETERS:
!
Expand Down Expand Up @@ -1837,8 +1837,8 @@ SUBROUTINE TOMAS_SO4_AQ( Input_Opt, State_Chm, State_Grid, &
INTEGER :: I, J, L
INTEGER :: k, binact1, binact2
INTEGER :: KMIN
INTEGER :: OrigUnit
REAL(fp) :: SO4OXID
CHARACTER(LEN=63) :: OrigUnit

!=================================================================
! TOMAS_SO4_AQ begins here!
Expand All @@ -1848,8 +1848,15 @@ SUBROUTINE TOMAS_SO4_AQ( Input_Opt, State_Chm, State_Grid, &
RC = GC_SUCCESS

! Convert species from to [kg]
CALL Convert_Spc_Units( Input_Opt, State_Chm, State_Grid, State_Met, &
'kg', RC, OrigUnit=OrigUnit )
CALL Convert_Spc_Units( &
Input_Opt = Input_Opt, &
State_Chm = State_Chm, &
State_Grid = State_Grid, &
State_Met = State_Met, &
outUnit = KG_SPECIES, &
origUnit = origUnit, &
RC = RC )

IF ( RC /= GC_SUCCESS ) THEN
CALL GC_Error('Unit conversion error', RC, &
'Start of TOMAS_SO4_AQ in sulfate_mod.F90')
Expand Down Expand Up @@ -1907,8 +1914,14 @@ SUBROUTINE TOMAS_SO4_AQ( Input_Opt, State_Chm, State_Grid, &
!$OMP END PARALLEL DO

! Convert species back to original units
CALL Convert_Spc_Units( Input_Opt, State_Chm, State_Grid, State_Met, &
OrigUnit, RC )
CALL Convert_Spc_Units( &
Input_Opt = Input_Opt, &
State_Chm = State_Chm, &
State_Grid = State_Grid, &
State_Met = State_Met, &
outUnit = origUnit, &
RC = RC )

IF ( RC /= GC_SUCCESS ) THEN
CALL GC_Error('Unit conversion error', RC, &
'End of TOMAS_SO4_AQ in sulfate_mod.F90')
Expand Down