Simplify build process.
This commit is contained in:
parent
ab797443f2
commit
4c5ead65c7
6 changed files with 24 additions and 11 deletions
1
.env
1
.env
|
@ -1 +0,0 @@
|
|||
MODEL=
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
/models
|
|
@ -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
|
||||
|
|
14
README.md
14
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`)
|
15
build/model.py
Normal file
15
build/model.py
Normal file
|
@ -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)
|
|
@ -10,4 +10,4 @@ services:
|
|||
UID: "${UID:-1001}"
|
||||
GID: "${GID:-1001}"
|
||||
volumes:
|
||||
- "${MODEL:?error}:/build"
|
||||
- "${BUILD_DIR:-./build}:/build"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue