Skip to content

Commit

Permalink
Merge pull request #49 from thijsheus/notebook_thijs
Browse files Browse the repository at this point in the history
Path fix and MicroHH tutorial
  • Loading branch information
mgrover1 authored May 21, 2024
2 parents 5b5f75e + 4b68746 commit 3517fa0
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
1 change: 1 addition & 0 deletions _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ parts:
- file: tutorials/xarray/xwrf-xarray-intro
- file: tutorials/comble/comble-mip-tutorial
- file: tutorials/emc2/InstrumentSimulatorsForModelEvaluation.ipynb
- file: tutorials/microhh/run_microhh
- file: tutorials/microhh/analyze_microhh
- file: tutorials/machine_learning/ARM_DQO_Spike_Detection
- file: tutorials/pyart/sail_qpe_grid
2 changes: 1 addition & 1 deletion tutorials/microhh/analyze_microhh.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"outputs": [],
"source": [
"# locate the folder where the data is stored\n",
"basedir = '/data/lasso/SGP/SGP_20160611/'\n",
"basedir = '/data/project/ARM_Summer_School_2024_Data/summerschool_microhh/'\n",
"basename = 'SGP'\n",
"NC_arr = [10, 50, 80, 100, 200, 400, 800]\n"
]
Expand Down
63 changes: 63 additions & 0 deletions tutorials/microhh/run_microhh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Running MicroHH
-------

MicroHH is a computational fluid dynamics code made for Direct Numerical Simulation (DNS) and Large-Eddy Simulation of turbulent flows in the atmospheric boundary layer. The code is written in C++.

A tutorial and documentation is available at: https://microhh.readthedocs.io/en/latest/.

MicroHH is described in detail in [Van Heerwaarden et al. (2017)](http://www.geosci-model-dev-discuss.net/gmd-2017-41/#discussion).

Downloading the code
--------------------
General information to download the code from GitHub can be found here:
https://github.com/microhh/microhh/blob/main/README.md

For this tutorial, we will use Thijs' fork, and in particular the `lagtraj` branch:
git clone --recurse-submodules https://github.com/thijsheus/microhh.git

More details on how to compile and setup the code on your own can be found in the main README

Logging in to OSC
-----------------

To run this tutorial, we first log in on the Ohio Super Computer through:
ondemand.osc.edu
and log in with the username that you got before the workshop.

From the side bar, select the *Ascend Desktop* to get in-browser access to the supercomputer.

Give the app a moment to start up, open it, and open a VNC window.

Quick Start to Running MicroHH
------------------------------

At the desktop, open a terminal and navigate to the summerschool folder:

cd /fs/project/PFS0220/summerschool
make your own folder, and copy all relevant data to your own folder:

cp template/* <yourname>/
and move to your own folder.

To submit a quick simulation to the supercomputer, you can submit a job to the queue:
sbatch SGP.slurm


Changing the input parameters
-----------------------------
The input parameters are in `SGP.ini`. Feel free to browse through and look at what can be easily changed. More info on individual options is available on
https://microhh.readthedocs.io/en/latest/


After the simulation is done, you can evaluate the results, for instance with the `analyze_microhh.ipynb` script.

Selecting particular ERA5 use cases (Advanced and Experimental):
---------------------
The eulerian_lagtraj.py code is based on the lagtraj Python package and pulls ERA5 data to drive the LES model. This is a bit too time consuming for the current tutorial, but the gist is as follows:

1. Open `config.yaml` to set the location, time, name, etc. Note that you can elect to use a Eulerian (fixed in space) setup, or a Lagrangian (moving along with the atmospheric flow) setup. A Lagrangian setup over land is not recommended.
1. Open `SGP.ini.base` to setup the case properties, such as domain size, grid points, etc. You can fill out `None` for anything that you want the system to decide
1. Run the python script: `python eulerian_lagtraj.py`
1. Initialize MicroHH following the instructions above.


0 comments on commit 3517fa0

Please sign in to comment.