diff --git a/.env b/.env deleted file mode 100644 index bb1c148..0000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -MODEL= diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f633594..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/models diff --git a/Dockerfile b/Dockerfile index bff352c..c30f27b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get install -y \ openmpi-bin libopenmpi-dev # Add python user. -RUN groupadd --force "${GID}" +RUN groupadd --force -g "${GID}" python RUN useradd --create-home --no-log-init -u "${UID}" -g "${GID}" python # Create build directory diff --git a/README.md b/README.md index 80d5448..8b4314e 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # 🌏️ ExoPlaSim Docker -## Environment Variables +## Instructions +1. Create an ExoPlaSim model. +2. Replace the example model in the `build` directory with your own model (keeping the filename `model.py`). +3. Run the docker container (eg. `docker compose run -it --rm exoplasim`). + +## Optional Environment Variables **UID:** UID of host/guest user. **GID:** GID of host/guest user. -**MODEL:** Path to model (required). +**BUILD_DIR:** Path to build directory. -## Instructions -1. Create an ExoPlaSim model -2. Save it somewhere with the filename `model.py` -3. Edit the `.env` file and add the directory containing `model.py` after `MODEL=` -4. Run the docker container (eg. `docker compose run -it --rm exoplasim`) \ No newline at end of file diff --git a/build/model.py b/build/model.py new file mode 100644 index 0000000..fbce8c0 --- /dev/null +++ b/build/model.py @@ -0,0 +1,15 @@ +import exoplasim as exo + +toi700d = exo.Model(workdir="toi700d_run",modelname="TOI-700d", + ncpus=8,resolution="T21",outputtype=".nc") + +toi700d.configure(startemp=3480.0, flux=1167.0, # Stellar parameters + eccentricity=0.,obliquity=0.,fixedorbit=True, # Orbital parameters + synchronous=True,rotationperiod=37.426, # Rotation + radius=1.19,gravity=11.9,aquaplanet=True, # Bulk properties + pN2=1.47*(1-360e-6),pCO2=1.47*360e-6,ozone=False, # Atmosphere + timestep=30.0,snapshots=720,physicsfilter="gp|exp|sp") # Model dynamics + +toi700d.exportcfg() + +toi700d.run(years=10,crashifbroken=True) diff --git a/compose.yaml b/compose.yaml index 07601a3..1471273 100644 --- a/compose.yaml +++ b/compose.yaml @@ -10,4 +10,4 @@ services: UID: "${UID:-1001}" GID: "${GID:-1001}" volumes: - - "${MODEL:?error}:/build" + - "${BUILD_DIR:-./build}:/build"