Skip to content

Xetalim/DALES_test_input_generator

Repository files navigation

Dales input case generator

This repository contains the modular_dales Python package, which generates complete DALES input cases (except for the DALES binary) using a composable Python API.

Cases are defined in Python using the dales_simulation class and configuration modules (grid, atmosphere, surface/LSM, radiation, timing, etc.). For the documentation, see this

This tool requires Python >3.13 and the packages listed in requirements.txt.

Usage

  1. Edit machine_conf.yaml to point to your DALES source and DALES binary. The case_conf.BASE_OUTPUT_PATH entry controls where generated cases are written. Tildes (~) do not work in this path (at least on my device).

  2. In Python, load machine_conf.yaml, construct a dales_simulation, add modules, and run the preprocessing pipeline, for example:

    import yaml
    
    from modular_dales.modular import dales_simulation
    from modular_dales.Configuration.defaultnamelist import DefaultNamelistModule
    
    with open("machine_conf.yaml") as f:
        machine_conf = yaml.safe_load(f)
    
    sim = dales_simulation("basic_case", machine_conf)
    sim += DefaultNamelistModule()
    # ... add grid, atmosphere, surface/LSM, radiation, time modules ...
    sim.sim_preprocessing_pipeline()

This will create an output directory (based on the case name and machine configuration) containing a DALES namelist, job.001, and all required input files.

Alternatively, see example.ipynb

Changelog:

-Allowed RTE-RRTMGP runs to be done. Added machine_conf.yaml to prevent having to edit scripts to customise. -Added some SLURB model input files (not yet useful)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors