Skip to content

ankurk017/RCE_1D_Emanuel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emanuel RCE single-column model

License: MIT Python 3.11 Platform Releases

1-D radiative–convective equilibrium model (Fortran core + Python for parameters and plotting).

This repository is an adaptation of the original RCE MIT Single-Column Model by K. Emanuel (15 March 2010). The Fortran core (rc_ver2.f) and scientific behavior are unchanged; the modifications are tooling and workflow around it:

  • Table-format parameters: A human-readable parameter table (params_ver2_table.in) with Parameter, Value, Units, and Description columns. A Python script (scripts/table_to_params.py) converts it to the value-only params_ver2.in expected by the Fortran program.
  • Run and execute scripts: run_RCE.sh provides a single entry point with options for output directory, parameter table file, and optional plotting. execute_rce.sh creates a user-specified run directory and a symlink so the model still reads/writes through output/, and picks the right executable by platform (Linux/Mac/Windows).
  • Python plotting: plotting/plot_rce_outputs.py generates figures from model output (e.g. profiles, time series). Use --plot, -p, or --plot true in run_RCE.sh to run the model and then produce plots in output/figs/.
  • Conda environment: rce_environment.yml and a shared conda env so students can run without installing conda or building the Fortran executable themselves.
  • Build support: A Makefile (and make rebuild) to recompile rc_ver2unix from rc_ver2.f on different systems (e.g. when libgfortran is missing).
  • Run-directory bookkeeping: The run scripts copy the parameter table and a readable parameter summary into each run directory for reproducibility.
  • MATLAB scripts: Parameter menus and run wrappers live in the matlab/ folder (e.g. run_model.m, get_parameters_ver2.m). Run from the repo root with addpath('matlab') or from inside matlab/.

Quick start

./run_RCE.sh --output_folder my_run --table params_ver2_table.in
# or with short options: ./run_RCE.sh -o my_run -t params_ver2_table.in

Using the shared environment

Note

The scripts expect Python 3 with numpy and matplotlib. Activate the shared env (or recreate it from rce_environment.yml) before running.

source /rtmp/akumar/conda/bin/activate rce

Then run the model and plotting as in the examples below. To recreate the env elsewhere, use conda env create -f rce_environment.yml.

Working on Meteor

To run the model on Meteor, connect via SSH (either directly or via a login node), then set up and build in the repo:

Connect:
ssh meteor
or, if required: ssh stratus or ssh rayleigh, then ssh meteor.

Setup and test:

git clone https://github.com/ankurk017/RCE_1D_Emanuel.git
cd RCE_1D_Emanuel
module load hdf5/1.14.6-gcc-11.5.0-cmrr
make rebuild
./run_RCE.sh --output_folder rce_output_test

Note

The output directory (e.g. rce_output_test) must not already exist; the script will create it.

Arguments

Long and short forms are supported:

Argument Short Description Default
--output_folder -o Output directory (must not exist). required
--table -t Parameter table file (same format as params_ver2_table.txt). params_ver2_table.in
--plot -p After the run, generate plots into output/figs/. Use as a flag or --plot true. no

Positional form: you can pass the output folder as the first argument instead of --output_folder / -o.

Note

The output folder must not already exist; the script will create it. Choose a new name for each run (e.g. SST25_run1).

Examples

# Default table, output in my_run/
./run_RCE.sh --output_folder my_run --table params_ver2_table.in
./run_RCE.sh -o my_run -t params_ver2_table.in

# Custom table file
./run_RCE.sh --output_folder SST28_run1 --table my_params.in

# Run and then generate plots (flag or --plot true)
./run_RCE.sh --output_folder SST25_wind5 --table params_ver2_table.in --plot
./run_RCE.sh -o SST25_wind5 -t params_ver2_table.in -p
./run_RCE.sh -o SST25_wind5 --plot true

# Positional output folder
./run_RCE.sh my_run --table params_ver2_table.in
./run_RCE.sh my_run

Note

Input files: params_ver2_table.in is the parameter input file — edit it to change model parameters (e.g. SST, time step, radiation options). Also edit sounding.in for SST. See params_ver2.in_README for parameter meanings; Users_guide.pdf for the full model description.

Tip

To get plots automatically after a run, add --plot, -p, or --plot true; figures are written to output/figs/.

Release

Stable versions are published as Releases. Each release includes a tag (e.g. v1.0.0) and optional release notes. To use a specific version, clone the repo and check out the tag, or download the source tarball from the release page.

Contact

For questions about this code or adaptation, contact Ankur Kumar at ankur017@gmail.com or ankur.kumar@uah.edu.

License

This project is licensed under the MIT License.

About

Emanuel RCE single-column model

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors