|
6 | 6 | The ``ziso`` test group
|
7 | 7 | (:py:class:`compass.ocean.tests.ziso.Ziso`)
|
8 | 8 | implements variants of the Zonally Idealized Southern Ocean (ZISO) test case
|
9 |
| -(see :ref:`ocean_ziso`) at 20-km resolutions. Here, we describe the shared |
10 |
| -framework for this test group and the 2 test cases. |
| 9 | +(see :ref:`ocean_ziso` in the User's Guide) at 2.5, 5, 10 and 20-km |
| 10 | +resolutions. Here, we describe the shared framework for this test group and the |
| 11 | +4 types of test cases currently supported: ``default``, ``long``, |
| 12 | +``particles``, and ``with_frazil``. |
11 | 13 |
|
12 | 14 | .. _dev_ocean_ziso_framework:
|
13 | 15 |
|
@@ -45,50 +47,76 @@ forward
|
45 | 47 |
|
46 | 48 | The class :py:class:`compass.ocean.tests.ziso.forward.Forward` defines a step
|
47 | 49 | for running MPAS-Ocean from the initial condition produced in the
|
48 |
| -``initial_state`` step. If ``with_frazil = True``, frazil ice production is |
49 |
| -enabled; if ``with_analysis = True``, analysis members are enabled: |
| 50 | +``initial_state`` step. Namelist and streams files are generated when the test |
| 51 | +case is set up (combining the ``*.forward`` and ``*.analysis`` files from the |
| 52 | +test group) and updated at runtime based on the config options in the |
| 53 | +``[ziso]`` section of the config file. |
50 | 54 |
|
51 |
| -.. code-block:: python |
52 |
| -
|
53 |
| - if with_analysis: |
54 |
| - add_namelist_file(step, 'compass.ocean.tests.ziso', |
55 |
| - 'namelist.analysis') |
56 |
| - add_streams_file(step, 'compass.ocean.tests.ziso', 'streams.analysis') |
57 |
| -
|
58 |
| - if with_frazil: |
59 |
| - add_namelist_options(step, |
60 |
| - {'config_use_frazil_ice_formation': '.true.'}) |
61 |
| - add_streams_file(step, 'compass.ocean.streams', 'streams.frazil') |
| 55 | +A dictionary ``res_params`` is used to set parameters like the number of cores |
| 56 | +and the time steps for each resolution: |
62 | 57 |
|
63 |
| -Namelist and streams files are generate during ``setup()``. |
| 58 | +.. code-block:: python |
64 | 59 |
|
65 |
| -:ref:`dev_ocean_framework_particles` are included in all simulations. In order |
66 |
| -to partition the particles, we need to first generate the required graph |
67 |
| -partition, then partition the particles, and finally run MPAS-Ocean (including |
68 |
| -updating PIO namelist options): |
| 60 | + res_params = {'20km': {'cores': 20, |
| 61 | + 'min_cores': 2, |
| 62 | + 'cores_with_particles': 32, |
| 63 | + 'min_cores_with_particles': 12, |
| 64 | + 'dt': "'00:12:00'", |
| 65 | + 'btr_dt': "'00:00:36'", |
| 66 | + 'mom_del4': "5.0e10", |
| 67 | + 'run_duration': "'0000_00:36:00'"}, |
| 68 | + '10km': {'cores': 80, |
| 69 | + 'min_cores': 8, |
| 70 | + 'cores_with_particles': 130, |
| 71 | + 'min_cores_with_particles': 50, |
| 72 | + 'dt': "'00:06:00'", |
| 73 | + 'btr_dt': "'00:00:18'", |
| 74 | + 'mom_del4': "6.25e9", |
| 75 | + 'run_duration': "'0000_00:18:00'"}, |
| 76 | + '5km': {'cores': 300, |
| 77 | + 'min_cores': 30, |
| 78 | + 'cores_with_particles': 500, |
| 79 | + 'min_cores_with_particles': 200, |
| 80 | + 'dt': "'00:03:00'", |
| 81 | + 'btr_dt': "'00:00:09'", |
| 82 | + 'mom_del4': "7.8e8", |
| 83 | + 'run_duration': "'0000_00:09:00'"}, |
| 84 | + '2.5km': {'cores': 1200, |
| 85 | + 'min_cores': 120, |
| 86 | + 'cores_with_particles': 2100, |
| 87 | + 'min_cores_with_particles': 900, |
| 88 | + 'dt': "'00:01:30'", |
| 89 | + 'btr_dt': "'00:00:04'", |
| 90 | + 'mom_del4': "9.8e7", |
| 91 | + 'run_duration': "'0000_00:04:30'"}} |
| 92 | +
|
| 93 | +If :ref:`dev_ocean_framework_particles` are includes (in the ``particles`` |
| 94 | +test cases), we first generate the required graph partition, then partition |
| 95 | +the particles, and finally run MPAS-Ocean (including updating PIO namelist |
| 96 | +options): |
69 | 97 |
|
70 | 98 | .. code-block:: python
|
71 | 99 |
|
72 |
| - cores = step['cores'] |
73 |
| -
|
74 |
| - partition(cores, config, logger) |
75 |
| - particles.write(init_filename='init.nc', particle_filename='particles.nc', |
76 |
| - graph_filename='graph.info.part.{}'.format(cores), |
77 |
| - types='buoyancy') |
78 |
| - run_model(step, config, logger, partition_graph=False) |
| 100 | + if self.with_particles: |
| 101 | + cores = self.cores |
| 102 | + partition(cores, self.config, self.logger) |
| 103 | + particles.write(init_filename='init.nc', |
| 104 | + particle_filename='particles.nc', |
| 105 | + graph_filename='graph.info.part.{}'.format(cores), |
| 106 | + types='buoyancy') |
| 107 | + run_model(self, partition_graph=False) |
79 | 108 |
|
80 | 109 | .. _dev_ocean_ziso_default:
|
81 | 110 |
|
82 |
| -default |
83 |
| -------- |
| 111 | +ziso_test_case |
| 112 | +-------------- |
84 | 113 |
|
85 |
| -The :py:class:`compass.ocean.tests.ziso.default.Default` test performs a |
86 |
| -90-second (3-time-step) run on 4 cores, including analysis but without |
87 |
| -frazil-ice formation. If a baseline is provided when calling |
| 114 | +The :py:class:`compass.ocean.tests.ziso.ZisoTestCase` class defines most of the |
| 115 | +ZISO test cases. If a baseline is provided when calling |
88 | 116 | :ref:`dev_compass_setup`, the test case ensures that the final values of
|
89 |
| -``temperature`` and ``layerThickness`` as well as a number of particle-related |
90 |
| -variables are identical to the baseline values, and also compares timers |
91 |
| -related to particles with the baseline. |
| 117 | +``temperature`` and ``layerThickness`` are identical to the baseline values. |
| 118 | +If particles are included, a number of particle-related variables and timers |
| 119 | +are also validated against the baseline. |
92 | 120 |
|
93 | 121 | .. _dev_ocean_ziso_with_frazil:
|
94 | 122 |
|
|
0 commit comments