Skip to content

Commit

Permalink
Merge pull request #2063 from branch 'bugfix/tomas-unitconv' into dev…
Browse files Browse the repository at this point in the history
…/14.3.0
  • Loading branch information
msulprizio committed Dec 8, 2023
2 parents b8f871b + 5517e59 commit b74f52e
Showing 1 changed file with 19 additions and 6 deletions.
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

0 comments on commit b74f52e

Please sign in to comment.