to build the docker image. This will take a while since everything will be downloaded and setup for you. In addition, the dockerfile will automatically compile our ocean model. The compilation time varies from system to system and will be performed automatically once you build the docker image.
**IMPORTANT**: If you are using a system like Mac M1 silicon, you need to change the line above to:
to build the docker image. This will take a while since everything will be downloaded and setup for you.
## Compiling the model
The dockerfile will automatically compile our ocean model. The compilation time varies from system to system and will be performed automatically once you build the docker image.
The corresponding line in the dockerfile is:
@ -87,7 +97,7 @@ is placed in the folder `/home/mom5/MOM_code/exec/gfortran/MOM_SIS` called `fms_
Before executing the line below please have a look at it's content:
`-v` mounts the corresponding folder into the virtual machine. In contrast to copying the folder to your docker image, we avoid that the docker image gets to big.
@ -96,17 +106,24 @@ Now execute the line.
You should now see something like
**Note:** if you are using cmd.exe on windows replace `$pwd` in that command above with `%cd%`
```bash
mom5@08a244e1e168:~$
```
You successfully started the docker image!
You successfully started the docker image and are now inside the virtual machine. In our case an Ubuntu 18.04 OS.
**Note:** if you get errors about while mounting the folders some possible solutions
1. If you are using cmd.exe on windows, if available use powershell. Git bash will not work.
2. replace `$(PWD)` in that command above with `%cd%` if you need to use cmd.exe
3. try changing `$(PWD)` to `$pwd`
### Start the ocean model
Copy the previously compiled executable to the MOM_setup folder
## Start the ocean model
We will now navigate inside our virtual machine. Copy the previously compiled executable to the MOM_setup folder
@ -171,31 +188,16 @@ Go to that directory and go to `1961/` and type `./fms_MOM_SIS.x` to run the mod
This will take a while now.
After the end of the simulation you should see the files `ice_day.nc` and `ocean_day3d.nc` which we will analyze in the following.
## After the lecture:
Hey everyone,
After the end of the simulation you should see the files `ice_day.nc` and
`ocean_day3d.nc` which we will analyze in the following.
thank you for following along during our last lecture. I think we all got to the point we were able to start our docker image.
# After the lecture:
If you finished your model simulation already, you should check the model_simulations folder on your local machine (inside your mom5-docker repository). It should contain your model run.
If you want to start your docker image again, please use your terminal (for windows power shell is best) and direct yourself to the mom5-docker folder. Once you are in that repository execute
If you want to start your docker image again, please use your terminal (for windows power shell is best) and direct yourself using to the mom5-docker folder. Once you are in that repository execute to start the docker.
to start the docker.
To visualize plots (I forgot to install the necessary library) please first enter
in your docker (Note: you have to do this every time after restarting the docker. Sorry for that.)
If you want to analyze your data, you should start now your jupyter notebook. Please navigate to your simulation directory (in the docker) and the year 1961. You should now see something like `~/model_simulations/mariesostseelauf/1961`
If you want to analyze your data, you should start now your jupyter notebook. Please navigate to your simulation directory using `cd` (in the docker) and the year 1961. You should now see something like `~/model_simulations/mariesostseelauf/1961`
Now please enter:
@ -205,7 +207,7 @@ This will start a jupyter server. You should see in your terminal something like
Open now the web browser of your choice and open that URL.
Open now the web browser on your local machine and open that URL.
You should see now something like this
@ -222,17 +224,19 @@ Analyze the data and respond to the two small tasks inside the notebook template
If you want to run your model longer:
Lastly, remember that also your model setup is stored on you local disk. Direct to the folder and open year 1961 again. Use a text editor of you choice to open the `input.nml` file.
Remember that also your model setup is stored on you local disk. Direct to the folder and open year 1961 again. Use a text editor of you choice to open the `input.nml` file.
For me it is stored here: `C:\Users\lokadmin\Documents\work\mom5-docker\model_simulations\mariesostseelauf\1961\input.nml`
Set `days` to 0 and `months=1`. Then the model will run for 1 month.
Set `days` to 0 and `months=1`. Then the model will run for 1 month. The maximum here is **11** months, since we have atmospheric forcing only available for one year.
For the homework 11 months of simulation would be best, but are **not** needed. Your notebook will likely take a while to simulate such a long period. So my advise would be to run the simulation over night.
Start your docker again and start the model there using `./fms_MOM_SIS.x` inside your simulation folder.