Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 1, 2024
1 parent d52d765 commit 3604481
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,8 @@ <h1>Source code for compass.ocean.tests.global_ocean.files_for_e3sm</h1><div cla
<span class="n">base_mesh_filename</span><span class="p">)</span>

<span class="k">if</span> <span class="n">init</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">if</span> <span class="n">mesh</span><span class="o">.</span><span class="n">with_ice_shelf_cavities</span><span class="p">:</span>
<span class="n">initial_state_filename</span> <span class="o">=</span> \
<span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">init</span><span class="o">.</span><span class="n">path</span><span class="si">}</span><span class="s1">/ssh_adjustment/adjusted_init.nc&#39;</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">initial_state_filename</span> <span class="o">=</span> \
<span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">init</span><span class="o">.</span><span class="n">path</span><span class="si">}</span><span class="s1">/initial_state/initial_state.nc&#39;</span>
<span class="n">initial_state_filename</span> <span class="o">=</span> \
<span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">init</span><span class="o">.</span><span class="n">path</span><span class="si">}</span><span class="s1">/initial_state/initial_state.nc&#39;</span>
<span class="n">initial_state_filename</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base_work_dir</span><span class="p">,</span>
<span class="n">initial_state_filename</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s1">&#39;files_for_e3sm&#39;</span><span class="p">,</span> <span class="s1">&#39;ocean_initial_state_filename&#39;</span><span class="p">,</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,34 +149,40 @@ <h1>Source code for compass.ocean.tests.global_ocean.files_for_e3sm.remap_ice_sh

<span class="sd"> init : compass.ocean.tests.global_ocean.init.Init</span>
<span class="sd"> The test case that produces the initial condition for this run</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="c1"># noqa: E501</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">test_case</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s1">&#39;remap_ice_shelf_melt&#39;</span><span class="p">,</span> <span class="n">ntasks</span><span class="o">=</span><span class="mi">512</span><span class="p">,</span>
<span class="n">min_tasks</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">init</span> <span class="o">=</span> <span class="n">init</span>
<span class="bp">self</span><span class="o">.</span><span class="n">init</span> <span class="o">=</span> <span class="n">init</span></div>


<span class="k">def</span> <span class="nf">setup</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> setup input files based on config options</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">setup</span><span class="p">()</span>
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">with_ice_shelf_cavities</span><span class="p">:</span>
<span class="k">return</span>

<span class="n">filename</span> <span class="o">=</span> <span class="s1">&#39;prescribed_ismf_paolo2023.nc&#39;</span>
<span class="k">if</span> <span class="n">init</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>

<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">init</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add_input_file</span><span class="p">(</span>
<span class="n">filename</span><span class="o">=</span><span class="s1">&#39;Paolo_2023_ANT_G1920V01_IceShelfMelt.nc&#39;</span><span class="p">,</span>
<span class="n">target</span><span class="o">=</span><span class="s1">&#39;Paolo_2023_ANT_G1920V01_IceShelfMelt.nc&#39;</span><span class="p">,</span>
<span class="n">database</span><span class="o">=</span><span class="s1">&#39;initial_condition_database&#39;</span><span class="p">,</span>
<span class="n">url</span><span class="o">=</span><span class="s1">&#39;https://its-live-data.s3.amazonaws.com/height_change/Antarctica/Floating/ANT_G1920V01_IceShelfMelt.nc&#39;</span><span class="p">)</span> <span class="c1"># noqa: E501</span>
<span class="k">elif</span> <span class="s1">&#39;remap_ice_shelf_melt&#39;</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">init</span><span class="o">.</span><span class="n">steps</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add_output_file</span><span class="p">(</span><span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">if</span> <span class="s1">&#39;remap_ice_shelf_melt&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">init</span><span class="o">.</span><span class="n">steps</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Something seems to be misconfigured. No &#39;</span>
<span class="s1">&#39;remap_ice_shelf_melt step found in init &#39;</span>
<span class="s1">&#39;test case.&#39;</span><span class="p">)</span>
<span class="n">melt_path</span> <span class="o">=</span> \
<span class="bp">self</span><span class="o">.</span><span class="n">init</span><span class="o">.</span><span class="n">steps</span><span class="p">[</span><span class="s1">&#39;remap_ice_shelf_melt&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">path</span>

<span class="bp">self</span><span class="o">.</span><span class="n">add_input_file</span><span class="p">(</span>
<span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span>
<span class="n">work_dir_target</span><span class="o">=</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">melt_path</span><span class="si">}</span><span class="s1">/</span><span class="si">{</span><span class="n">filename</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span></div>


<span class="k">def</span> <span class="nf">setup</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> setup input files based on config options</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">setup</span><span class="p">()</span>
<span class="n">filename</span> <span class="o">=</span> <span class="s1">&#39;prescribed_ismf_paolo2023.nc&#39;</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">with_ice_shelf_cavities</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add_output_file</span><span class="p">(</span><span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">)</span>
<span class="n">work_dir_target</span><span class="o">=</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">melt_path</span><span class="si">}</span><span class="s1">/</span><span class="si">{</span><span class="n">filename</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>

<div class="viewcode-block" id="RemapIceShelfMelt.run">
<a class="viewcode-back" href="../../../../../../developers_guide/ocean/generated/compass.ocean.tests.global_ocean.files_for_e3sm.remap_ice_shelf_melt.RemapIceShelfMelt.run.html#compass.ocean.tests.global_ocean.files_for_e3sm.remap_ice_shelf_melt.RemapIceShelfMelt.run">[docs]</a>
Expand Down

0 comments on commit 3604481

Please sign in to comment.