Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update COMPASS ocean API for python 3 and using conda packages #229

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
98 changes: 98 additions & 0 deletions testing_and_setup/compass/README_ocean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Setting up COMPASS for ocean test case

## COMPASS conda environment

To set up and run ocean test cases from COMPASS, you will need a conda
environment. First, install Miniconda3 (if miniconda is not already
installed), then create a new conda environment as follows:
``` bash
conda create -n compass_py3.7 -c conda-forge python=3.7 geometric_features
mpas_tools jigsaw metis pyflann scikit-image basemap pyamg
```
Each time you want to work with COMPASS, you will need to run:
```
conda activate compass_py3.7
```

An appropriate conda environment is already available on Los Alamos National
Laboratory's Institutional Computing (LANL IC) machines:
```
source /usr/projects/climate/SHARED_CLIMATE/anaconda_envs/base/etc/profile.d/conda.sh
conda activate compass_py3.7
```

## Setting config options

The file `general.config.ocean` is a template containing a set of config
options that the COMPASS user must set in order to set up ocean test cases.
Make a copy of this file (e.g. `config.ocean`) and set the options as follows.
Replace `FULL_PATH_TO_MPAS_MODEL_REPO` with the path where you have checked
out (and built) the branch of MPAS-Model you are planning to use. Five other
paths are required, as explained below.

### geometric_data

```
geometric_data = FULL_PATH_TO_PATH_OF_CACHED_GEOMETRIC_FEATURES_DATA
```
In general, this can be any directory where geojson data files will be
automatically downloaded and cached as test cases require them. However, if
working on compute nodes that cannot get to the internet (specifically GitHub),
it may be necessary to download the full set of `geometric_data` ahead of time
from:
[https://github.com/MPAS-Dev/geometric_features/tree/0.1/geometric_data](https://github.com/MPAS-Dev/geometric_features/tree/0.1/geometric_data)
The easiest way to do this is with:
```
git clone git@github.com:MPAS-Dev/geometric_features.git
cd geometric_features
git checkout 0.1
```
Then, point `geometric_data` in your config file to
`geometric_features/geometirc_data/` in the location you have just placed it.

On LANL IC, a full checkout is already available at:
```
geometric_data = /usr/projects/regionalclimate/COMMON_MPAS/ocean/grids/geometric_data_v0.1
```

### jigsaw-geo-matlab

For any test cases using the `JIGSAW` tool to generate meshes, you will need
a local checkout fo the repository of Matlab routines for `JIGSAW` check out
a local copy of the repo with:
```
git clone git@github.com:dengwirda/jigsaw-geo-matlab.git
```
Then, point `jigsaw-geo-matlab` in your config file to the path to the local
check-out of the repo.

If you have already checked out `jigsaw-geo-matlab` previously, be sure to
update to the latest master. Changes made in early May 2019 are required in
order for these scripts to be able to use the version of `jigsaw` from the
conda package, rather than requiring a local build.

### mesh_database and initial_condition_database

These are directories for storing pre-generated mesh files and data sets for
creating initial conditions. These can be empty directories, in which case
meshes and other data sets will be downloaded as required during test-case
setup. (If a test case appears to hang during setup, it is most likely
downloading mesh or initial-condition data.)

On LANL IC, the shared data bases can be found at:
```
mesh_database = /usr/projects/regionalclimate/COMMON_MPAS/ocean/grids/mesh_database
initial_condition_database = /usr/projects/regionalclimate/COMMON_MPAS/ocean/grids/initial_condition_database
```

### bathymetry_database

This is a database for bathymetry data sets that can be used at various phases
of mesh generation and test-case initialization. Currently, only a few test
cases require these data sets and they are not downloaded automatically. Thus,
there is not a good way for users to access these datasets.

On LANL IC, the shared location of the bathymetry database is at:
```
bathymetry_database = /usr/projects/regionalclimate/COMMON_MPAS/ocean/grids/bathymetry_database
```
8 changes: 1 addition & 7 deletions testing_and_setup/compass/general.config.ocean
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ init = FULL_PATH_TO_MPAS_MODEL_REPO/streams.ocean.init
# anywhere on the machine.
[executables]
model = FULL_PATH_TO_MPAS_MODEL_REPO/ocean_model
metis = FULL_PATH_TO_METIS
mesh_converter = FULL_PATH_TO_MPAS_TOOLS_REPO/mesh_tools/mesh_conversion_tools/MpasMeshConverter.x
cell_culler = FULL_PATH_TO_MPAS_TOOLS_REPO/mesh_tools/mesh_conversion_tools/MpasCellCuller.x
mask_creator = FULL_PATH_TO_MPAS_TOOLS_REPO/mesh_tools/mesh_conversion_tools/MpasMaskCreator.x
mesh_generator = FULL_PATH_TO_EXECUTABLE_MESH_GENERATION_SCRIPT

# The paths section describes paths that are used within the ocean core test
# cases.
Expand All @@ -42,8 +37,7 @@ mesh_generator = FULL_PATH_TO_EXECUTABLE_MESH_GENERATION_SCRIPT
# some test cases might download data into them, which will then be reused if
# the test case is run again later.
mpas_model = FULL_PATH_TO_MPAS_MODEL_REPO
mpas_tools = FULL_PATH_TO_MPAS_TOOLS_REPO
geometric_features = FULL_PATH_TO_LOCAL_CHECKOUT_OF_GEOMETRIC_FEATURES_REPO
geometric_data = FULL_PATH_TO_PATH_OF_CACHED_GEOMETRIC_FEATURES_DATA
jigsaw-geo-matlab = FULL_PATH_TO_JIGSAW_REPO
mesh_database = FULL_PATH_TO_LOCAL_MESH_DATABASE
initial_condition_database = FULL_PATH_TO_LOCAL_INITIAL_CONDITION_DATABASE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<add_link source="../init_step2/graph.info" dest="graph.info"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="metis" dest="metis"/>

<namelist name="namelist.ocean" mode="forward">
<template file="baroclinic_channel_10km_template.xml" path_base="script_resolution_dir"/>
Expand All @@ -15,7 +14,7 @@
</streams>

<run_script name="run.py">
<step executable="./metis">
<step executable="gpmetis">
<argument flag="graph.info">4</argument>
</step>
<model_run procs="4" threads="2" namelist="namelist.ocean" streams="streams.ocean"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<add_link source="../init_step2/graph.info" dest="graph.info"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="metis" dest="metis"/>

<namelist name="namelist.ocean" mode="forward">
<template file="baroclinic_channel_10km_template.xml" path_base="script_resolution_dir"/>
Expand All @@ -15,7 +14,7 @@
</streams>

<run_script name="run.py">
<step executable="./metis">
<step executable="gpmetis">
<argument flag="graph.info">8</argument>
</step>
<model_run procs="8" threads="1" namelist="namelist.ocean" streams="streams.ocean"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<add_link source_path="mesh_database" source="doubly_periodic_10km_160x500km_planar.151001.nc" dest="base_mesh.nc"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="cell_culler" dest="MpasCellCuller.x"/>
<add_executable source="mesh_converter" dest="MpasMeshConverter.x"/>

<namelist name="namelist.ocean" mode="init">
<option name="config_init_configuration">'baroclinic_channel'</option>
Expand Down Expand Up @@ -49,14 +47,14 @@
</streams>

<run_script name="run.py">
<step executable="./MpasMeshConverter.x">
<step executable="MpasMeshConverter.x">
<argument flag="">base_mesh.nc</argument>
<argument flag="">mesh.nc</argument>
</step>

<model_run procs="1" threads="1" namelist="namelist.ocean" streams="streams.ocean"/>

<step executable="./MpasCellCuller.x">
<step executable="MpasCellCuller.x">
<argument flag="">ocean.nc</argument>
</step>
</run_script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<add_link source="../init_step1/culled_graph.info" dest="graph.info"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="metis" dest="metis"/>

<namelist name="namelist.ocean" mode="init">
<option name="config_init_configuration">'baroclinic_channel'</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<add_link source="../init_step2/graph.info" dest="graph.info"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="metis" dest="metis"/>

<namelist name="namelist.ocean" mode="forward">
<template file="baroclinic_channel_10km_template.xml" path_base="script_resolution_dir"/>
Expand All @@ -15,7 +14,7 @@
</streams>

<run_script name="run.py">
<step executable="./metis">
<step executable="gpmetis">
<argument flag="graph.info">4</argument>
</step>
<model_run procs="4" threads="1" namelist="namelist.ocean" streams="streams.ocean"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<add_link source_path="mesh_database" source="doubly_periodic_10km_160x500km_planar.151001.nc" dest="base_mesh.nc"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="cell_culler" dest="MpasCellCuller.x"/>
<add_executable source="mesh_converter" dest="MpasMeshConverter.x"/>

<namelist name="namelist.ocean" mode="init">
<option name="config_init_configuration">'baroclinic_channel'</option>
Expand Down Expand Up @@ -49,14 +47,14 @@
</streams>

<run_script name="run.py">
<step executable="./MpasMeshConverter.x">
<step executable="MpasMeshConverter.x">
<argument flag="">base_mesh.nc</argument>
<argument flag="">mesh.nc</argument>
</step>

<model_run procs="1" threads="1" namelist="namelist.ocean" streams="streams.ocean"/>

<step executable="./MpasCellCuller.x">
<step executable="MpasCellCuller.x">
<argument flag="">ocean.nc</argument>
</step>
</run_script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<add_link source="../init_step1/culled_graph.info" dest="graph.info"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="metis" dest="metis"/>

<namelist name="namelist.ocean" mode="init">
<option name="config_init_configuration">'baroclinic_channel'</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<add_link source="../init_step2/graph.info" dest="graph.info"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="metis" dest="metis"/>

<namelist name="namelist.ocean" mode="forward">
<template file="baroclinic_channel_10km_template.xml" path_base="script_resolution_dir"/>
Expand All @@ -17,7 +16,7 @@
</streams>

<run_script name="run.py">
<step executable="./metis">
<step executable="gpmetis">
<argument flag="graph.info">4</argument>
</step>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<add_link source_path="mesh_database" source="doubly_periodic_10km_160x500km_planar.151001.nc" dest="base_mesh.nc"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="cell_culler" dest="MpasCellCuller.x"/>
<add_executable source="mesh_converter" dest="MpasMeshConverter.x"/>

<namelist name="namelist.ocean" mode="init">
<option name="config_init_configuration">'baroclinic_channel'</option>
Expand Down Expand Up @@ -49,14 +47,14 @@
</streams>

<run_script name="run.py">
<step executable="./MpasMeshConverter.x">
<step executable="MpasMeshConverter.x">
<argument flag="">base_mesh.nc</argument>
<argument flag="">mesh.nc</argument>
</step>

<model_run procs="1" threads="1" namelist="namelist.ocean" streams="streams.ocean"/>

<step executable="./MpasCellCuller.x">
<step executable="MpasCellCuller.x">
<argument flag="">ocean.nc</argument>
</step>
</run_script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<add_link source="../init_step1/culled_graph.info" dest="graph.info"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="metis" dest="metis"/>

<namelist name="namelist.ocean" mode="init">
<option name="config_init_configuration">'baroclinic_channel'</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<add_link source="../init_step2/graph.info" dest="graph.info"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="metis" dest="metis"/>

<namelist name="namelist.ocean" mode="forward">
<template file="baroclinic_channel_10km_template.xml" path_base="script_resolution_dir"/>
Expand All @@ -23,7 +22,7 @@
</streams>

<run_script name="run.py">
<step executable="./metis">
<step executable="gpmetis">
<argument flag="graph.info">4</argument>
</step>
<model_run procs="4" threads="1" namelist="namelist.ocean" streams="streams.ocean"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<add_link source="../init_step2/graph.info" dest="graph.info"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="metis" dest="metis"/>

<namelist name="namelist.ocean" mode="forward">
<template file="baroclinic_channel_10km_template.xml" path_base="script_resolution_dir"/>
Expand All @@ -15,7 +14,7 @@
</streams>

<run_script name="run.py">
<step executable="./metis">
<step executable="gpmetis">
<argument flag="graph.info">4</argument>
</step>
<model_run procs="4" threads="1" namelist="namelist.ocean" streams="streams.ocean"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<add_link source="../init_step2/graph.info" dest="graph.info"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="metis" dest="metis"/>

<namelist name="namelist.ocean" mode="forward">
<template file="baroclinic_channel_10km_template.xml" path_base="script_resolution_dir"/>
Expand All @@ -15,7 +14,7 @@
</streams>

<run_script name="run.py">
<step executable="./metis">
<step executable="gpmetis">
<argument flag="graph.info">4</argument>
</step>
<model_run procs="4" threads="2" namelist="namelist.ocean" streams="streams.ocean"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<add_link source_path="mesh_database" source="doubly_periodic_10km_160x500km_planar.151001.nc" dest="base_mesh.nc"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="cell_culler" dest="MpasCellCuller.x"/>
<add_executable source="mesh_converter" dest="MpasMeshConverter.x"/>

<namelist name="namelist.ocean" mode="init">
<option name="config_init_configuration">'baroclinic_channel'</option>
Expand Down Expand Up @@ -49,14 +47,14 @@
</streams>

<run_script name="run.py">
<step executable="./MpasMeshConverter.x">
<step executable="MpasMeshConverter.x">
<argument flag="">base_mesh.nc</argument>
<argument flag="">mesh.nc</argument>
</step>

<model_run procs="1" threads="1" namelist="namelist.ocean" streams="streams.ocean"/>

<step executable="./MpasCellCuller.x">
<step executable="MpasCellCuller.x">
<argument flag="">ocean.nc</argument>
</step>
</run_script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<add_link source="../init_step1/culled_graph.info" dest="graph.info"/>

<add_executable source="model" dest="ocean_model"/>
<add_executable source="metis" dest="metis"/>

<namelist name="namelist.ocean" mode="init">
<option name="config_init_configuration">'baroclinic_channel'</option>
Expand Down
Loading