Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
8bac008
Initial file (placeholders) for SU Volcanic Emissions
lholland-noaa Oct 15, 2024
84717da
Adding datetime utility
lholland-noaa Oct 18, 2024
caa0aee
modifications to comments
lholland-noaa Oct 18, 2024
5d2889e
Initial files to begin SU Volcanic Emissions
lholland-noaa Oct 22, 2024
98c33cc
Reorg of prepmetvars, initial reader placeholder
lholland-noaa Nov 5, 2024
7b349af
Added example volcanic file and updated code
lholland-noaa Nov 7, 2024
c17d3b8
Volcanic updates
lholland-noaa Nov 18, 2024
8ac6871
more updates
lholland-noaa Nov 18, 2024
55074ca
Updating emission reader
lholland-noaa Nov 21, 2024
b8c18b5
Updating module
lholland-noaa Nov 21, 2024
292343d
Merge branch 'feature/gocart_suv' of https://github.com/lholland-noaa…
lholland-noaa Nov 21, 2024
ec8eee4
added notes in comments
lholland-noaa Nov 22, 2024
f94fa2a
Updating cmake file to incl SUVolcanic
lholland-noaa Dec 20, 2024
2f4494e
compiles on hera, committing
lholland-noaa Jan 16, 2025
b932013
removing extraneous file
lholland-noaa Jan 17, 2025
7d866fd
Creating directory and initial source files
lholland-noaa Jan 17, 2025
06675af
Adding CMakeLists
lholland-noaa Jan 17, 2025
fb4de14
Adding DMS to core
lholland-noaa Jan 21, 2025
fa1780e
compiles - still need to create test
lholland-noaa Jan 21, 2025
12218b0
constructing test_dms
lholland-noaa Jan 21, 2025
056431b
updating
lholland-noaa Jan 21, 2025
4fb1da6
Merge branch 'develop' into feature/gocart_suv
zmoon Jan 22, 2025
d2045b4
This version with test_dms compiles
lholland-noaa Jan 22, 2025
50e372b
fmt
zmoon Jan 22, 2025
288bbd0
removing un-used datetime.F90
lholland-noaa Jan 22, 2025
c7f3626
Remove unused module
zmoon Jan 22, 2025
0527d9a
updating
lholland-noaa Jan 22, 2025
295332e
removing unnecessary section
lholland-noaa Jan 22, 2025
e758e0d
correcting error in activate flag
lholland-noaa Jan 23, 2025
9426066
removing unnecessary items
lholland-noaa Jan 24, 2025
be3aedc
Set NLEVS before using
zmoon Feb 7, 2025
da91066
Update test_suvolcanic.F90
lholland-noaa Feb 11, 2025
22b0381
Update test_suvolcanic.F90
lholland-noaa Feb 11, 2025
73fc01e
add gocart SO2 volcanic emissions
lwcugb Mar 17, 2025
bd4a099
remove changes on ChemState module
lwcugb Mar 19, 2025
041b1aa
Merge remote-tracking branch 'Lacey_catchem/feature/gocart_dms' into …
lwcugb Mar 19, 2025
f3d8307
Fix lint error
lwcugb Mar 19, 2025
9c5997f
Try to fix floating point error
lwcugb Mar 20, 2025
7b14f53
premet module name update
lwcugb Mar 20, 2025
ab430ff
Merge remote-tracking branch 'origin/feature/gocart_suv' into feature…
lwcugb Mar 20, 2025
3b0f4ed
add array initialization
lwcugb Mar 20, 2025
fdbde05
Bug fix for the test run
lwcugb Mar 20, 2025
89b13b5
add assertion for the test case
lwcugb Mar 20, 2025
baaefcb
replace some pointers
lwcugb Mar 21, 2025
debc3ed
emission file read bug fix
lwcugb Mar 21, 2025
2e4efea
update DMS process
lwcugb Mar 21, 2025
69dfe8a
update emission species file
lwcugb Mar 21, 2025
2441467
remove util folder and update module names
lwcugb Mar 24, 2025
774b8a7
Merge remote-tracking branch 'origin/feature/gocart_suv' into feature…
lwcugb Mar 25, 2025
892802f
rename volcanic folder
lwcugb Mar 25, 2025
28b0bc7
Merge remote-tracking branch 'origin/feature/gocart_suv' into feature…
lwcugb Mar 25, 2025
5c1a61e
remove the use of premet module from util folder
lwcugb Mar 25, 2025
6403591
clean up
lwcugb Mar 27, 2025
8eb9784
rename folder
lwcugb Mar 27, 2025
f0c3116
rename folder
lwcugb Mar 27, 2025
774b4fe
Merge remote-tracking branch 'ufs/develop' into feature/gocart_suv
lwcugb Mar 27, 2025
06b08f9
Merge remote-tracking branch 'origin/feature/gocart_suv' into feature…
lwcugb Mar 27, 2025
3f3c87d
Merge branch 'develop' into wei-suv
zmoon Mar 27, 2025
0010198
Restore the column data extraction util
zmoon Mar 27, 2025
16bed5c
fix to use new GOCART version
lwcugb Mar 28, 2025
c17dddd
Merge remote-tracking branch 'origin/feature/gocart_suv' into feature…
lwcugb Mar 28, 2025
a110c23
pre-commit run fix
lwcugb Mar 28, 2025
efe2c5f
Merge remote-tracking branch 'origin/feature/gocart_suv' into feature…
lwcugb Mar 28, 2025
dfe07db
pre-commit run fix
lwcugb Mar 29, 2025
528f486
updates some comments
lwcugb May 1, 2025
593c87f
file name changes
lwcugb May 1, 2025
013ba20
lowercase file name
lwcugb May 1, 2025
ab3ce8e
update some comments
lwcugb May 1, 2025
cdb0abe
file name change
lwcugb May 1, 2025
124d71b
lowercase file name
lwcugb May 1, 2025
23eed8e
Merge remote-tracking branch 'origin/feature/gocart_suv' into feature…
lwcugb May 1, 2025
0d6f99c
get MW from species yaml file
lwcugb Jun 10, 2025
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
2 changes: 2 additions & 0 deletions src/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ target_link_libraries(${_lib} PUBLIC CATChem_process_dust)
target_link_libraries(${_lib} PUBLIC CATChem_process_seasalt)
target_link_libraries(${_lib} PUBLIC CATChem_process_plumerise)
target_link_libraries(${_lib} PUBLIC CATChem_process_drydep)
target_link_libraries(${_lib} PUBLIC CATChem_process_volcanic)
target_link_libraries(${_lib} PUBLIC CATChem_process_DMS)
target_link_libraries(${_lib} PUBLIC CATChem_process_chem)
set_target_properties(
${_lib}
Expand Down
10 changes: 10 additions & 0 deletions src/api/catchem.F90
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ module CATChem
use CCPr_DryDep_mod, only: cc_drydep_init => CCPr_DryDep_Init !< DryDep Process Initialization Routine
use CCPr_DryDep_mod, only: cc_drydep_run => CCPr_DryDep_Run !< DryDep Process Run Routine
use CCPr_DryDep_mod, only: cc_drydep_finalize => CCPr_DryDep_Finalize !< DryDep Process Finalization Routine
! SUVolcanicEmissions
use CCPr_Volcanic_mod, only: VolcanicStateType !< SUVolcanic State
use CCPr_Volcanic_mod, only: cc_volcanic_init => CCPr_Volcanic_Init !< SUVolcanicEmissions Process Initialization Routine
use CCPr_Volcanic_mod, only: cc_volcanic_run => CCPr_Volcanic_Run !< SUVolcanicEmissions Process Run Routine
use CCPr_Volcanic_mod, only: cc_volcanic_finalize => CCPr_Volcanic_Finalize !< SUVolcanicEmissions Process Finalization Routine
! DMS
use CCPr_DMS_mod, only: DMSStateType !< DMS State
use CCPr_DMS_mod, only: cc_dms_init => CCPr_DMS_Init !< DMS Process Initialization Routine
use CCPr_DMS_mod, only: cc_dms_run => CCPr_DMS_Run !< DMS Process Run Routine
use CCPr_DMS_mod, only: cc_dms_finalize => CCPr_DMS_Finalize !< DMS Process Finalization Routine
! Chemical mechanism solver
use CCPr_Chem_mod, only: cc_get_micm_version => get_micm_version

Expand Down
10 changes: 8 additions & 2 deletions src/core/chemstate_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ module ChemState_Mod
!! \param nSpeciesGas: The number of gas species.
!! \param nSpeciesAero: The number of aerosol species.
!! \param nSpeciesDust: The number of dust species.
!! \param nSpeicesSeaSalt: The number of sea salt species.
!! \param nSpeciesSeaSalt: The number of sea salt species.
!! \param SpeciesIndex: An array containing the total species index.
!! \param AeroIndex: An array containing the aerosol species index.
!! \param GasIndex: An array containing the gas species index.
!! \param DustIndex: An array containing the dust species index.
!! \param SeaSaltIndex: An array containing the sea salt species index.
!! \param chemSpecies: A 2-D array containing the concentration of each species.
!! \param DryDepIndex: An array containing the dry deposition species index.
!! \param SpeciesNames: A character array containing the names of the species.
!!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like DryDepIndex is listed twice here. For clarity, should we remove one of them?

!! \ingroup core_modules
!!!>
Expand Down Expand Up @@ -362,6 +363,11 @@ subroutine FindSpecByName(ChemState, name, index, RC)
exit
endif
enddo
if (index == 0) then
RC = CC_FAILURE
ErrMsg = 'Species not found: ' // TRIM(name)
call CC_Warning(ErrMsg, RC, thisLoc)
endif

end subroutine FindSpecByName

Expand Down
179 changes: 179 additions & 0 deletions src/core/config_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,24 @@ SUBROUTINE Read_Input_File( Config , GridState, EmisState, ChemState, RC, Config
RETURN
ENDIF

call Config_Process_DMS(ConfigInput, Config, RC)
IF ( RC /= CC_SUCCESS ) THEN
errMsg = 'Error in "Config_Process_DMS"!'
CALL CC_Error( errMsg, RC, thisLoc )
CALL QFYAML_CleanUp( ConfigInput )
CALL QFYAML_CleanUp( ConfigAnchored )
RETURN
ENDIF

call Config_Process_Volcanic(ConfigInput, Config, RC)
IF ( RC /= CC_SUCCESS ) THEN
errMsg = 'Error in "Config_Process_Volcanic"!'
CALL CC_Error( errMsg, RC, thisLoc )
CALL QFYAML_CleanUp( ConfigInput )
CALL QFYAML_CleanUp( ConfigAnchored )
RETURN
ENDIF


!========================================================================
! Config ChemState
Expand Down Expand Up @@ -1373,4 +1391,165 @@ SUBROUTINE Config_Process_DryDep( ConfigInput, Config, RC )
END SUBROUTINE Config_Process_DryDep


!> \brief Process Volcanic configuration
!!
!! This function processes the Volcanic configuration and performs the necessary actions based on the configuration.
!!
!! \param[in] ConfigInput The YAML configuration object
!! \param[inout] Config The configuration object
!! \param[out] RC The return code
!!
!! \ingroup core_modules
!!!>
SUBROUTINE Config_Process_Volcanic( ConfigInput, Config, RC )
USE CharPak_Mod, ONLY : StrSplit
USE Error_Mod
USE Config_Opt_Mod, ONLY : ConfigType

TYPE(QFYAML_t), INTENT(INOUT) :: ConfigInput ! YAML Config object
TYPE(ConfigType), INTENT(INOUT) :: Config ! Input options

!
! !OUTPUT PARAMETERS:
!
INTEGER, INTENT(OUT) :: RC ! Success or failure

! !LOCAL VARIABLES:
!
! Scalars
LOGICAL :: v_bool
INTEGER :: v_int
CHARACTER(LEN=1055) :: v_str

! Strings
CHARACTER(LEN=255) :: thisLoc
CHARACTER(LEN=512) :: errMsg
CHARACTER(LEN=QFYAML_StrLen) :: key

!========================================================================
! Config_Process_Volcanic begins here!
!========================================================================

! Initialize
RC = CC_SUCCESS
thisLoc = ' -> at Config_Process_Volcanic (in CATChem/src/core/config_mod.F90)'
errMsg = ''

! TODO #105 Fix reading of config file
key = "process%volcanic%activate"
v_bool = MISSING_BOOL
CALL QFYAML_Add_Get( ConfigInput, TRIM( key ), v_bool, "", RC )
IF ( RC /= CC_SUCCESS ) THEN
errMsg = 'Error parsing ' // TRIM( key ) // '!'
CALL CC_Error( errMsg, RC, thisLoc )
RETURN
ENDIF
Config%volcanic_activate = v_bool


key = "process%volcanic%scheme_opt"
v_int = MISSING_INT
CALL QFYAML_Add_Get( ConfigInput, TRIM( key ), v_int, "", RC )
IF ( RC /= CC_SUCCESS ) THEN
errMsg = TRIM( key ) // 'Not Found, Setting Default to 1'
v_int = 1 ! default is one
RETURN
ENDIF
Config%volcanic_scheme = v_int

key = "process%volcanic%filedir"
v_str = MISSING_STR
CALL QFYAML_Add_Get( ConfigInput, TRIM( key ), v_str, "", RC )
IF ( RC /= CC_SUCCESS ) THEN
errMsg = 'Error parsing ' // TRIM( key ) // '!'
CALL CC_Warning( errMsg, RC, thisLoc )
ENDIF
Config%volcanic_filedir = TRIM( v_str )


write(*,*) "Volcanic Configuration"
write(*,*) '------------------------------------'
write(*,*) 'Config%volcanic_activate = ', Config%volcanic_activate
write(*,*) 'Config%volcanic_scheme = ', Config%volcanic_scheme
write(*,*) 'Config%volcanic_filedir = ', Config%volcanic_filedir
write(*,*) '------------------------------------'

END SUBROUTINE Config_Process_Volcanic


!> \brief Process DMS configuration
!!
!! This function processes the DMS configuration and performs the necessary actions based on the configuration.
!!
!! \param[in] ConfigInput The YAML configuration object
!! \param[inout] Config The configuration object
!! \param[out] RC The return code
!!
!! \ingroup core_modules
!!!>
SUBROUTINE Config_Process_DMS( ConfigInput, Config, RC )
USE CharPak_Mod, ONLY : StrSplit
USE Error_Mod
USE Config_Opt_Mod, ONLY : ConfigType

TYPE(QFYAML_t), INTENT(INOUT) :: ConfigInput ! YAML Config object
TYPE(ConfigType), INTENT(INOUT) :: Config ! Input options

!
! !OUTPUT PARAMETERS:
!
INTEGER, INTENT(OUT) :: RC ! Success or failure

! !LOCAL VARIABLES:
!
! Scalars
LOGICAL :: v_bool
INTEGER :: v_int

! Strings
CHARACTER(LEN=255) :: thisLoc
CHARACTER(LEN=512) :: errMsg
CHARACTER(LEN=QFYAML_StrLen) :: key

!========================================================================
! Config_Process_DMS begins here!
!========================================================================

! Initialize
RC = CC_SUCCESS
thisLoc = ' -> at Config_Process_DMS (in CATChem/src/core/config_mod.F90)'
errMsg = ''

! TODO #105 Fix reading of config file
key = "process%DMS%activate"
v_bool = MISSING_BOOL
CALL QFYAML_Add_Get( ConfigInput, TRIM( key ), v_bool, "", RC )
IF ( RC /= CC_SUCCESS ) THEN
errMsg = 'Error parsing ' // TRIM( key ) // '!'
CALL CC_Error( errMsg, RC, thisLoc )
RETURN
ENDIF
Config%DMS_activate = v_bool


key = "process%DMS%scheme_opt"
v_int = MISSING_INT
CALL QFYAML_Add_Get( ConfigInput, TRIM( key ), v_int, "", RC )
IF ( RC /= CC_SUCCESS ) THEN
errMsg = TRIM( key ) // 'Not Found, Setting Default to 1'
v_int = 1 ! default is one
RETURN
ENDIF
Config%DMS_scheme = v_int

write(*,*) "DMS Configuration"
write(*,*) '------------------------------------'
write(*,*) 'Config%DMS_activate = ', Config%DMS_activate
write(*,*) 'Config%DMS_scheme = ', Config%DMS_scheme
write(*,*) '------------------------------------'


END SUBROUTINE Config_Process_DMS


END MODULE config_mod
23 changes: 23 additions & 0 deletions src/core/config_opt_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ MODULE Config_Opt_Mod
!! - `drydep_activate` : Activate drydep process
!! - `drydep_scheme` : Scheme option for drydep process
!! - `drydep_resuspension` : Activate resuspension
!! - `volcanic_activate` : Activate Volcanic process
!! - `volcanic_scheme` : Scheme option for Volcanic process
!! - `volcanic_filedir` : File directory for Volcanic process
!! - `DMS_activate` : Activate DMS emissions
!! - `DMS_scheme` : Scheme option DMS process
!!
!! \ingroup core_modules
!!!>
Expand Down Expand Up @@ -102,6 +107,15 @@ MODULE Config_Opt_Mod
INTEGER :: drydep_scheme
LOGICAL :: drydep_resuspension !< Turn on resuspension

! VolcanicEmissions Process
LOGICAL :: volcanic_activate
INTEGER :: volcanic_scheme
character(len=1055) :: volcanic_filedir

! DMS Process
LOGICAL :: DMS_activate
INTEGER :: DMS_scheme

END TYPE ConfigType

CONTAINS
Expand Down Expand Up @@ -176,6 +190,15 @@ SUBROUTINE Set_Config( am_I_Root, Config, RC )
Config%drydep_scheme = 1
Config%drydep_resuspension = .FALSE.

! SU Volcanic Process
Config%volcanic_activate = .FALSE.
Config%volcanic_scheme = 1
Config%volcanic_filedir = ' '

! DMS Process
Config%DMS_activate = .FALSE.
Config%DMS_scheme = 1

END SUBROUTINE Set_Config
!> \brief Cleanup the Config options
!!
Expand Down
1 change: 0 additions & 1 deletion src/core/emisstate_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ subroutine Emis_Find_Chem_Map_Index(EmisState, ChemState, RC)
return
endif
EmisState%Cats(c)%Species(s)%EmisMapIndex(n) = index
EmisState%Cats(c)%Species(s)%EmisMapIndex(n) = index
enddo
enddo
enddo
Expand Down
5 changes: 5 additions & 0 deletions src/core/metstate_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ MODULE MetState_Mod
! TIMESTEP
!---------
REAL(fp) :: TSTEP !< Time step [s]
INTEGER :: YMD ! Year, month, day
INTEGER :: HMS ! Hour, minute, second

! Logicals
!---------
Expand Down Expand Up @@ -192,6 +194,9 @@ MODULE MetState_Mod
REAL(fp), ALLOCATABLE :: PMID(:) !< Average wet air pressure [hPa] defined as arithmetic average of edge pressures
REAL(fp), ALLOCATABLE :: PMID_DRY(:) !< Dry air partial pressure [hPa] defined as arithmetic avg of edge pressures

!TODO: temporary put DMS concentration here for DMS emissions from gocart; may read from ChemState in the future
REAL(fp) :: DMSO_CONC !< DMS concentration [mol/L]

END TYPE MetStateType

CONTAINS
Expand Down
8 changes: 1 addition & 7 deletions src/core/qfyaml_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1159,15 +1159,9 @@ SUBROUTINE QFYAML_Read_Emis_File( yml, fileName, yml_anchored, EmisState, RC )
cspecies = TRIM(yml%vars(n)%category(ix+1:))
tmpString = TRIM(yml%vars(n)%category(ix+1:))
names = [names, tmpString]
j = j + 1 ! increment species index
endif
endif

if ((n == yml%num_vars) .and. (TRIM(yml%vars(n)%category(1:ix-1)) == TRIM(current))) then
cspecies = TRIM(yml%vars(n)%category(ix+1:))
tmpString = TRIM(yml%vars(n)%category(ix+1:))
names = [names, tmpString]
j = j + 1
endif
enddo

! Fill last category species names
Expand Down
2 changes: 2 additions & 0 deletions src/process/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ add_subdirectory(dust)
add_subdirectory(seasalt)
add_subdirectory(plumerise)
add_subdirectory(drydep)
add_subdirectory(dms)
add_subdirectory(volcanic)
add_subdirectory(chem)
Loading