Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d65465b
update process generator to compile seasalt process
lwcugb Sep 3, 2025
ea7674c
Merge branch 'feature/cc_restructure' of https://github.com/bbakernoa…
lwcugb Sep 4, 2025
4f3df14
fix core test
lwcugb Sep 6, 2025
6a8e986
update generator for test creation
lwcugb Sep 11, 2025
29f024d
update generator
lwcugb Sep 12, 2025
18b3135
update integration test of the generator.
lwcugb Sep 15, 2025
36f3012
update generation of process integration test
lwcugb Sep 15, 2025
706e56d
update generator for integration test
lwcugb Sep 16, 2025
88995d2
Merge branch 'feature/cc_restructure' of https://github.com/bbakernoa…
lwcugb Sep 16, 2025
c9e4bc9
update core test files
lwcugb Sep 16, 2025
540dd24
update generator
lwcugb Sep 16, 2025
7346a23
add emission mapping to ConfigManager
lwcugb Sep 22, 2025
e8fde6f
update API module
lwcugb Sep 26, 2025
b718cc4
API file update
lwcugb Oct 2, 2025
387affe
delete temp files
lwcugb Oct 2, 2025
e3e7258
update nuopc cap
lwcugb Oct 13, 2025
cb56a74
update NUOPC cap
lwcugb Oct 20, 2025
0dc6f86
Fix ifort compiling error
lwcugb Oct 21, 2025
19fd283
update nuopc layer
lwcugb Oct 27, 2025
d02647f
update nuopc layer
lwcugb Oct 31, 2025
f18b126
emission mapping read bug fix
lwcugb Nov 6, 2025
27a9187
update generator for drydep
lwcugb Nov 15, 2025
64e1d9a
update generator for drydep
lwcugb Nov 20, 2025
c5b872d
add wetdep process
lwcugb Nov 26, 2025
9130454
update wetdep
lwcugb Dec 1, 2025
94423d0
Merge branch 'ufs_develop' into feature/cc_restructure
lwcugb Dec 2, 2025
2ed9d75
clean some files
lwcugb Dec 2, 2025
309067d
fix some edge conditions for drydep
lwcugb Dec 5, 2025
a4793c6
bug fix integration tests
lwcugb Dec 5, 2025
39613f9
bug fix for integration test
lwcugb Dec 5, 2025
7460e73
update generator
lwcugb Dec 6, 2025
0d9fa2e
trimming some files
lwcugb Dec 8, 2025
e5775fa
bug fix
lwcugb Dec 15, 2025
244ecaa
fix unit conversion
lwcugb Dec 15, 2025
c26b2c0
unit conversion fix
lwcugb Dec 15, 2025
4a20517
start adding settling process
lwcugb Dec 17, 2025
1bbb353
update settling process
lwcugb Dec 18, 2025
8c8a2b8
update settling process
lwcugb Dec 18, 2025
c1f5c29
Merge branch 'develop' into feature/cc_restructure
bbakernoaa Dec 19, 2025
12df911
reverse the time stamp changes
lwcugb Dec 19, 2025
ab150c6
remove scheme copy files
lwcugb Dec 19, 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
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,19 @@ if(BUILD_NUOPC)
PRIVATE
$<TARGET_FILE:CATChem>
$<TARGET_FILE:CATChem_process_seasalt>
$<TARGET_FILE:CATChem_process_drydep>
$<TARGET_FILE:CATChem_process_wetdep>
$<TARGET_FILE:CATChem_process_settling>
$<TARGET_FILE:CATChem_core>
$<TARGET_FILE:yaml_interface>
$<TARGET_FILE:catchem_utilities>
)

# Link GOCART2G library if available (needed for drydep process)
if(TARGET GOCART2G)
target_link_libraries(cc_nuopc PRIVATE $<TARGET_FILE:GOCART2G>)
endif()

# Include directories for compilation
target_include_directories(
cc_nuopc
Expand Down
13 changes: 11 additions & 2 deletions cmake/generate_metstate_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def classify_fields(fields):
"""
# Categorical 3D fields with non-vertical dimensions (soil, land use, etc.)
categorical_patterns = {
'SOILM', 'FRSOIL', # Soil-related
'SOILM', 'SOILT', 'FRSOIL', # Soil-related
'FRLANDUSE', 'FRLAI', 'FRZ0', # Land use categories
}

Expand Down Expand Up @@ -426,6 +426,7 @@ def get_field_description(name):
'F_UNDER_PBLTOP': 'Fraction under PBL top [1]',
# Categorical 3D fields
'SOILM': 'Volumetric soil moisture [m3/m3] (nsoil layers)',
'SOILT': 'Temperature of soil layer [K] (nsoil layers)',
'FRLANDUSE': 'Fractional land use [1] (nlanduse categories)',
'FRSOIL': 'Fractional soil [1] (nsoil categories)',
'FRLAI': 'LAI per land use type [m2/m2] (nlanduse categories)',
Expand Down Expand Up @@ -677,6 +678,7 @@ def write_virtualmet_type(fields, output_file):
----------
fields : list of tuple
List of (name, type_name, rank, dims, is_edge) for each field.
List of (name, type_name, rank, dims, is_edge) for each field.
output_file : str
Path to output .inc file.
"""
Expand Down Expand Up @@ -873,6 +875,7 @@ def write_virtualmet_cleanup(fields, output_file):
f.write("! Generated VirtualMetType cleanup procedure\n")
f.write("! This macro should be included in the virtual_met_cleanup subroutine\n")
f.write("! Auto-generated from MetState field definitions\n")
f.write("! Now includes scalar fields since VirtualMet contains them\n")
f.write("! Now includes scalar fields since VirtualMet contains them\n\n")

# Nullify 3D atmospheric field pointers
Expand Down Expand Up @@ -1023,7 +1026,7 @@ def write_set_field_2d_real(fields, output_file):
f.write(f" return\n")
f.write(f" end if\n")
f.write(f" end if\n")
elif name.lower() in ("frsoil", "soilm"):
elif name.lower() in ("frsoil", "soilm", "soilt"):
f.write(f" if (.not. allocated(this%{name})) then\n")
f.write(f" ! Allocate with default soil parameters if not already allocated\n")
f.write(f" if (this%nSOILTYPE > 0) then\n")
Expand Down Expand Up @@ -1110,6 +1113,12 @@ def get_conditional_allocation_info(field_name):
'dimension_var': 'this%nSOIL',
'type': 'soil'
},
'soilt': {
'condition': 'nsoil > 0',
'dimension': 'nsoil',
'dimension_var': 'this%nSOIL',
'type': 'soil'
},
'frsoil': {
'condition': 'nsoiltype > 0',
'dimension': 'nsoiltype',
Expand Down
267 changes: 267 additions & 0 deletions docs/processes/drydep/drydep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
# DryDep Process

**Process Type:** Deposition
**Description:** Process for computing dry deposition of gas and aerosol species
**Author:** Wei Li
**Generated:** 2025-11-25T22:20:02.547522

## Overview

The DryDep process implements Process for computing dry deposition of gas and aerosol species. This process provides a modular, extensible framework for deposition calculations within the CATChem chemical transport model.

## Available Schemes

### WESELY Scheme

**Name:** `wesely`
**Description:** Wesely 1989 gas dry deposition scheme
**Author:** Wei Li
**Reference:** Wesely, M. L. [1989] Parameterization of surface resistances to gaseous dry deposition...
#### Parameters

| Parameter | Default | Range | Description |
|-----------|---------|--------|-------------|
| `scale_factor` | 1.0 | - | DryDep velocity scale factor |
| `co2_effect` | True | - | Apply CO2 effect on stomatal conductance |
| `co2_level` | 600.0 | - | Ambient CO2 level for stomatal conductance adjustment |
| `co2_reference` | 380.0 | - | Reference CO2 level for stomatal conductance adjustment |

#### Required Meteorological Fields

- `USTAR` - Meteorological field required for scheme computation
- `TSTEP` - Meteorological field required for scheme computation
- `TS` - Meteorological field required for scheme computation
- `SWGDN` - Meteorological field required for scheme computation
- `SUNCOSmid` - Meteorological field required for scheme computation
- `OBK` - Meteorological field required for scheme computation
- `CLDFRC` - Meteorological field required for scheme computation
- `BXHEIGHT` - Meteorological field required for scheme computation
- `Z0` - Meteorological field required for scheme computation
- `PS` - Meteorological field required for scheme computation
- `FRLAI` - Meteorological field required for scheme computation
- `ILAND` - Meteorological field required for scheme computation
- `SALINITY` - Meteorological field required for scheme computation
- `FRLANDUSE` - Meteorological field required for scheme computation
- `TSKIN` - Meteorological field required for scheme computation
- `LON` - Meteorological field required for scheme computation
- `LAT` - Meteorological field required for scheme computation
- `LUCNAME` - Meteorological field required for scheme computation
- `IsSnow` - Meteorological field required for scheme computation
- `IsIce` - Meteorological field required for scheme computation
- `IsLand` - Meteorological field required for scheme computation


### GOCART Scheme

**Name:** `gocart`
**Description:** GOCART-2G aerosol dry deposition scheme
**Author:** Wei Li & Lacey Holland
**Reference:** Allison et al. [2024] Benchmarking GOCART-2G in GEOS
#### Parameters

| Parameter | Default | Range | Description |
|-----------|---------|--------|-------------|
| `scale_factor` | 1.0 | - | Dry deposition velocity scale factor |
| `resuspension` | False | - | Apply resuspension for dry deposition |

#### Required Meteorological Fields

- `USTAR` - Meteorological field required for scheme computation
- `TSTEP` - Meteorological field required for scheme computation
- `T` - Meteorological field required for scheme computation
- `AIRDEN` - Meteorological field required for scheme computation
- `Z` - Meteorological field required for scheme computation
- `LWI` - Meteorological field required for scheme computation
- `PBLH` - Meteorological field required for scheme computation
- `HFLUX` - Meteorological field required for scheme computation
- `Z0H` - Meteorological field required for scheme computation
- `U10M` - Meteorological field required for scheme computation
- `V10M` - Meteorological field required for scheme computation
- `FRLAKE` - Meteorological field required for scheme computation
- `GWETTOP` - Meteorological field required for scheme computation


### ZHANG Scheme

**Name:** `zhang`
**Description:** Zhang et al. [2001] scheme with Emerson et al. [2020] updates
**Author:** Wei Li
**Reference:** Zhang et al., 2001; Emerson et al., 2020
#### Parameters

| Parameter | Default | Range | Description |
|-----------|---------|--------|-------------|
| `scale_factor` | 1.0 | - | Dry deposition velocity scale factor |

#### Required Meteorological Fields

- `USTAR` - Meteorological field required for scheme computation
- `TSTEP` - Meteorological field required for scheme computation
- `TS` - Meteorological field required for scheme computation
- `OBK` - Meteorological field required for scheme computation
- `BXHEIGHT` - Meteorological field required for scheme computation
- `Z0` - Meteorological field required for scheme computation
- `RH` - Meteorological field required for scheme computation
- `PS` - Meteorological field required for scheme computation
- `U10M` - Meteorological field required for scheme computation
- `V10M` - Meteorological field required for scheme computation
- `FRLANDUSE` - Meteorological field required for scheme computation
- `ILAND` - Meteorological field required for scheme computation
- `LUCNAME` - Meteorological field required for scheme computation
- `IsSnow` - Meteorological field required for scheme computation
- `IsIce` - Meteorological field required for scheme computation



## Process Interface

### Species

The drydep process operates on the following chemical species:


### Required Inputs



### Process Diagnostics

| Diagnostic | Units | Description |
|------------|-------|-------------|
| `drydep_con_per_species` | ug/kg or ppm | Dry deposition concentration per species |
| `drydep_velocity_per_species` | m/s | Dry deposition velocity |

## Usage

### Basic Integration

```fortran
use DryDepProcessCreator_Mod
use DryDepCommon_Mod

! Create process instance
type(DryDepProcess_t) :: process
call create_drydep_process(process, config_data)

! Use process in model time step
call process%run(state, dt)
```

### Scheme Selection

The process supports multiple schemes. Select your desired scheme:

```fortran
! Use WESELY scheme
process%scheme_name = "wesely"
```
```fortran
! Use GOCART scheme
process%scheme_name = "gocart"
```
```fortran
! Use ZHANG scheme
process%scheme_name = "zhang"
```

## Implementation Details

### Pure Science Kernels

Each scheme is implemented as a pure science kernel with no infrastructure dependencies:

```fortran
! WESELY scheme
pure subroutine compute_wesely( &
num_layers, num_species, params, &
USTAR, & TSTEP, & TS, & SWGDN, & SUNCOSmid, & OBK, & CLDFRC, & BXHEIGHT, & Z0, & PS, & FRLAI, & ILAND, & SALINITY, & FRLANDUSE, & TSKIN, & LON, & LAT, & LUCNAME, & IsSnow, & IsIce, & IsLand, &
species_conc, emission_flux)
```
```fortran
! GOCART scheme
pure subroutine compute_gocart( &
num_layers, num_species, params, &
USTAR, & TSTEP, & T, & AIRDEN, & Z, & LWI, & PBLH, & HFLUX, & Z0H, & U10M, & V10M, & FRLAKE, & GWETTOP, &
species_conc, emission_flux)
```
```fortran
! ZHANG scheme
pure subroutine compute_zhang( &
num_layers, num_species, params, &
USTAR, & TSTEP, & TS, & OBK, & BXHEIGHT, & Z0, & RH, & PS, & U10M, & V10M, & FRLANDUSE, & ILAND, & LUCNAME, & IsSnow, & IsIce, &
species_conc, emission_flux)
```

### Host Model Responsibilities

The host model (CATChem infrastructure) handles:

- Parameter initialization and validation
- Input array validation and error handling
- Memory management and array allocation
- Integration with model time stepping
- Diagnostic output management

## Configuration

### YAML Configuration Example

```yaml
processes:
drydep:
enabled: true
scheme: "wesely"
parameters:
scale_factor: 1.0
co2_effect: True
co2_level: 600.0
co2_reference: 380.0
diagnostics:
enabled: true
output_frequency: "daily"
```

## Technical Specifications

- **Parallelization:** Column
- **Memory Requirements:** Low
- **Timestep Dependency:** Independent
- **Multiphase Support:** No
- **Size Bin Support:** No
- **Vectorization:** Supported

## Files Generated

### Source Code
- `src/process/drydep/ProcessDryDepInterface_Mod.F90` - Main process interface
- `src/process/drydep/DryDepCommon_Mod.F90` - Common types and parameters
- `src/process/drydep/DryDepProcessCreator_Mod.F90` - Process factory
- `src/process/drydep/schemes/DryDepScheme_WESELY_Mod.F90` - Wesely 1989 gas dry deposition scheme
- `src/process/drydep/schemes/DryDepScheme_GOCART_Mod.F90` - GOCART-2G aerosol dry deposition scheme
- `src/process/drydep/schemes/DryDepScheme_ZHANG_Mod.F90` - Zhang et al. [2001] scheme with Emerson et al. [2020] updates

### Tests
- `tests/process/drydep/unit/` - Unit tests
- `tests/process/drydep/integration/` - Integration tests

### Documentation
- `docs/processes/drydep/drydep.md` - This documentation

## Contributing

When modifying or extending this process:

1. **Science Changes:** Modify the scheme modules in `schemes/`
2. **Interface Changes:** Update the main interface module
3. **New Schemes:** Add new scheme modules and update the creator
4. **Tests:** Add corresponding unit and integration tests
5. **Documentation:** Update this documentation file

## References

- WESELY: Wesely, M. L. [1989] Parameterization of surface resistances to gaseous dry deposition...
- GOCART: Allison et al. [2024] Benchmarking GOCART-2G in GEOS
- ZHANG: Zhang et al., 2001; Emerson et al., 2020

---
*This documentation was automatically generated by the CATChem Process Generator on 2025-11-25T22:20:02.547522*
Loading