cape.pylch.case: Loci/CHEM case control module

This module contains Loci/CHEM-specific versions of some of the generic methods from cape.cfdx.case.

class cape.pylch.casecntl.CaseRunner(fdir: str | None = None)
finalize_files(j: int)

Clean up files after running one cycle of phase j

Call:
>>> runner.finalize_files(j)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: int

Phase number

Versions:
  • 2024-10-17 @ddalle: v1.0

get_project_rootname(j: int | None = None)

Get the project name for a Loci/CHEM case

Call:
>>> proj = runner.get_project_rootname(j=None)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: {None} | int

Phase number

Outputs:
proj: str

Project name, usually "pylch"

Versions:
  • 2025-05-02 @ddalle: v1.0

get_restart_number() int | None

Get the restart number for a Loci/CHEM case folder

Call:
>>> n = runner.get_restart_number()
Outputs:
n: int | None

Restart number; no restart if None

Versions:
  • 2025-05-20 @ddalle: v1.0

getx_iter() int | None

Get the most recent iteration number for Loci/CHEM case

Call:
>>> n = runner.getx_iter()
Inputs:
runner: CaseRunner

Controller to run one case of solver

Outputs:
n: int | None

Last iteration number

Versions:
  • 2024-10-17 @ddalle: v1.0

init_post()

Custom initialization for pyfun

Call:
>>> runner.init_post()
Inputs:
runner: CaseRunner

Controller to run one case of solver

Versions:
  • 2023-06-28 @ddalle: v1.0

prepare_files(j: int)

Prepare files and links to run phase j of Loci/CHEM

Call:
>>> runner.prepare_files(j)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: int

Phase number

Versions:
  • 2025-05-02 @ddalle: v1.0

read_varsfile(j: int | None = None) VarsFile

Read case .vars file

Call:
>>> yamlfile = runner.read_varsfile(j=None)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: {None} | int

Phase number

Outputs:
varsfile: VarsFIle

Loci/CHEM .vars file interface

Versions:
  • 2024-11-07 @ddalle: v1.0

run_chem(j: int)

Run one phase of the chem executable

Call:
>>> runner.run_superlava(j)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: int

Phase number

Versions:
  • 2024-10-17 @ddalle: v1.0

run_phase(j: int)

Run one phase using appropriate commands

Call:
>>> runner.run_phase(j)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: int

Phase number

Versions:
  • 2024-10-17 @ddalle: v1.0

write_mapbc2vog(fvog: str, j: int = 0)

Add MapBC to fvog VOG file and write

cape.pylch.casecntl.run_chem()

Setup and run the appropriate LAVACURV command

Call:
>>> run_chem()
Versions:
  • 2024-10-17 @ddalle: v1.0;