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

Add tides test case #456

Merged
merged 25 commits into from
Dec 13, 2022
Merged

Add tides test case #456

merged 25 commits into from
Dec 13, 2022

Conversation

sbrus89
Copy link
Collaborator

@sbrus89 sbrus89 commented Nov 9, 2022

This PR adds the mesh and initial condition generation, forward model run, and analysis workflow for single layer tidal configurations. Currently, the Icosahedral 7 mesh is used as an initial resolution.

@sbrus89
Copy link
Collaborator Author

sbrus89 commented Nov 9, 2022

@xylar, I still need to add the documentation pages, but opened this to start getting initial feedback.

@sbrus89
Copy link
Collaborator Author

sbrus89 commented Nov 9, 2022

Here's an example of the M2 constituent plot generated at the end of the forward step:

M2_plot

@sbrus89
Copy link
Collaborator Author

sbrus89 commented Nov 9, 2022

The forward step took about a half hour to run on Compy with 5 nodes.

@mark-petersen
Copy link
Collaborator

Tested. Here are my commands, on badger:

./conda/configure_compass_env.py --conda /usr/projects/climate/mpeterse/miconda3 --compiler gnu
source load_dev_compass_1.2.0-alpha.1_badger_gnu_mvapich.sh
compass list|grep tide
 234: ocean/tides/Icos7/mesh
 235: ocean/tides/Icos7/init
 236: ocean/tides/Icos7/forward
compass setup -p /usr/projects/climate/mpeterse/repos/E3SM/master/components/mpas-ocean -w $n/221115_tides -n 234 235 236

It downloaded some new files. Good thing we cleaned up disk space on IC!

Downloading jsl_lim24_inv_hrs.nc (142.3MiB)
  to /usr/projects/regionalclimate/COMMON_MPAS/ocean/grids/initial_condition_database
Downloading GEBCO_2020.nc (7.0GiB)
  to /usr/projects/regionalclimate/COMMON_MPAS/ocean/grids/bathymetry_database
Downloading RTopo-2.0.4_30sec_bedrock_topography.nc (3.5GiB)
  to /usr/projects/regionalclimate/COMMON_MPAS/ocean/grids/bathymetry_database

The setup of the mesh and init steps works. On the forward step I get this error. I'm not familiar enough with compass to debug this easily.

forward setup error

compass setup -p /usr/projects/climate/mpeterse/repos/E3SM/master/components/mpas-ocean -w $n/221115b_tides -n 236
Setting up test cases:
  ocean/tides/Icos7/forward
Traceback (most recent call last):
  File "/usr/projects/climate/mpeterse/miconda3/envs/dev_compass_1.2.0-alpha.1/bin/compass", line 33, in <module>
    sys.exit(load_entry_point('compass', 'console_scripts', 'compass')())
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/__main__.py", line 63, in main
    commands[args.command]()
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/setup.py", line 386, in main
    setup_cases(tests=tests, numbers=args.case_num,
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/setup.py", line 149, in setup_cases
    setup_case(path, test_case, config_file, machine, work_dir,
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/setup.py", line 299, in setup_case
    step.setup()
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/ocean/tests/tides/analysis/__init__.py", line 65, in setup
    self.tpxo_version = config.getint('tides', 'tpxo_version')
  File "/usr/projects/climate/mpeterse/miconda3/envs/dev_compass_1.2.0-alpha.1/lib/python3.9/site-packages/mpas_tools/config.py", line 132, in getint
    return self.combined.getint(section, option)
  File "/usr/projects/climate/mpeterse/miconda3/envs/dev_compass_1.2.0-alpha.1/lib/python3.9/configparser.py", line 818, in getint
    return self._get_conv(section, option, int, raw=raw, vars=vars,
  File "/usr/projects/climate/mpeterse/miconda3/envs/dev_compass_1.2.0-alpha.1/lib/python3.9/configparser.py", line 808, in _get_conv
    return self._get(section, conv, option, raw=raw, vars=vars,
  File "/usr/projects/climate/mpeterse/miconda3/envs/dev_compass_1.2.0-alpha.1/lib/python3.9/configparser.py", line 803, in _get
    return conv(self.get(section, option, **kwargs))
ValueError: invalid literal for int() with base 10: 'TPXO9'

@mark-petersen
Copy link
Collaborator

The run for the mesh step was successful. Using an interactive node on badger:

report:

ba143:g:mesh$ pwd
/lustre/scratch5/turquoise/mpeterse/runs/n/221115b_tides/ocean/tides/Icos7/mesh
compass run
ocean/tides/Icos7/mesh
compass calling: compass.ocean.tests.tides.mesh.Mesh.run()
  inherited from: compass.testcase.TestCase.run()
  in /turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/testcase.py

compass calling: compass.run.serial._run_test()
  in /turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/run/serial.py

Running steps: base_mesh, cull_mesh
  * step: base_mesh
  * step: cull_mesh

compass calling: compass.ocean.tests.tides.mesh.Mesh.validate()
  inherited from: compass.testcase.TestCase.validate()
  in /turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/testcase.py

  test execution:      SUCCESS
  test runtime:        09:28
Test Runtimes:
09:28 PASS ocean_tides_Icos7_mesh
Total runtime 09:29
PASS: All passed successfully!

but the run step for init was not. I am using the ocean executable from the head of E3SM/master.

report:

ba143:g:init$ compass run
ocean/tides/Icos7/init
compass calling: compass.ocean.tests.tides.init.Init.run()
  inherited from: compass.testcase.TestCase.run()
  in /turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/testcase.py

compass calling: compass.run.serial._run_test()
  in /turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/run/serial.py

Running steps: interpolate, remap, initial_state
  * step: interpolate
      Failed
Exception raised while running the steps of the test case
Traceback (most recent call last):
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/run/serial.py", line 145, in run_tests
    _run_test(test_case)
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/run/serial.py", line 394, in _run_test
    _run_step(test_case, step, test_case.new_step_log_file)
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/run/serial.py", line 437, in _run_step
    step.run()
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/ocean/tests/tides/init/interpolate_wave_drag.py", line 185, in run
    self.plot_interp_data(data, interp)
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/ocean/tests/tides/init/interpolate_wave_drag.py", line 147, in plot_interp_data
    fig.savefig('rinv.png',
  File "/usr/projects/climate/mpeterse/miconda3/envs/dev_compass_1.2.0-alpha.1/lib/python3.9/site-packages/matplotlib/figure.py", line 3274, in savefig
    self.canvas.print_figure(fname, **kwargs)
  File "/usr/projects/climate/mpeterse/miconda3/envs/dev_compass_1.2.0-alpha.1/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 2338, in print_figure
    result = print_method(
  File "/usr/projects/climate/mpeterse/miconda3/envs/dev_compass_1.2.0-alpha.1/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 2204, in <lambda>
    print_method = functools.wraps(meth)(lambda *args, **kwargs: meth(
  File "/usr/projects/climate/mpeterse/miconda3/envs/dev_compass_1.2.0-alpha.1/lib/python3.9/site-packages/matplotlib/_api/deprecation.py", line 385, in wrapper
    arguments = signature.bind(*inner_args, **inner_kwargs).arguments
  File "/usr/projects/climate/mpeterse/miconda3/envs/dev_compass_1.2.0-alpha.1/lib/python3.9/inspect.py", line 3045, in bind
    return self._bind(args, kwargs)
  File "/usr/projects/climate/mpeterse/miconda3/envs/dev_compass_1.2.0-alpha.1/lib/python3.9/inspect.py", line 3034, in _bind
    raise TypeError(
TypeError: got an unexpected keyword argument 'box_inches'
  test execution:      ERROR
  test runtime:        01:24
Test Runtimes:
01:24 FAIL ocean_tides_Icos7_init
Total runtime 01:25
FAIL: 1 test failed, see above.

real    1m31.442s
user    1m23.490s
sys     0m4.559s

Perhaps my compass version is getting mixed up somehow, since this must have worked for you? I redid my ./conda/configure_compass_env.py a few times in different directories, and source load_dev_compass*.py from that same directory, but this happens anyway. Wait - it looks like there is both a box_inches and bbox_inches. Maybe it needs to be the latter in these two places:

compass/ocean/tests/hurricane/init/interpolate_atm_forcing.py:188:
                    box_inches='tight')
compass/ocean/tests/tides/init/interpolate_wave_drag.py:148:
                    box_inches='tight')

@mark-petersen
Copy link
Collaborator

Yes, changing those both to bbox_inches makes the init step successful for interpolate, but it dies at the end of the remap step:

report:

compass run
ocean/tides/Icos7/init
compass calling: compass.ocean.tests.tides.init.Init.run()
  inherited from: compass.testcase.TestCase.run()
  in /turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/testcase.py

compass calling: compass.run.serial._run_test()
  in /turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/run/serial.py

Running steps: interpolate, remap, initial_state
  * step: interpolate
  * step: remap
      Failed
Exception raised while running the steps of the test case
Traceback (most recent call last):
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/run/serial.py", line 145, in run_tests
    _run_test(test_case)
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/run/serial.py", line 394, in _run_test
    _run_step(test_case, step, test_case.new_step_log_file)
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/run/serial.py", line 437, in _run_step
    step.run()
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/ocean/tests/tides/init/remap_bathymetry.py", line 80, in run
    dem_remap.dem_remap('RTopo_2_0_4_GEBCO_v2020_30sec_pixel.nc',
  File "/turquoise/usr/projects/climate/mpeterse/repos/compass/master/compass/ocean/tests/tides/init/dem_remap.py", line 227, in dem_remap
    __, nloc = tree.query(qpos, n_jobs=-1)
  File "_ckdtree.pyx", line 786, in scipy.spatial._ckdtree.cKDTree.query
  File "_ckdtree.pyx", line 390, in scipy.spatial._ckdtree.get_num_workers
TypeError: Unexpected keyword argument {'n_jobs': -1}
  test execution:      ERROR
  test runtime:        13:47
Test Runtimes:
13:47 FAIL ocean_tides_Icos7_init
Total runtime 13:47
FAIL: 1 test failed, see above.

real    13m53.726s
user    8m54.750s
sys     4m7.471s

"""

config = self.config
self.tpxo_version = config.getint('tides', 'tpxo_version')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.tpxo_version = config.getint('tides', 'tpxo_version')
self.tpxo_version = config.get('tides', 'tpxo_version')

This isn't an int.

qpos = map_to_r3(mesh, xmid, ymid, head, tail)

ttic = time.time()
__, nloc = tree.query(qpos, n_jobs=-1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
__, nloc = tree.query(qpos, n_jobs=-1)
__, nloc = tree.query(qpos, workers=-1)

based on https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.cKDTree.query.html

Maybe this is a recent API change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, apparently this is a scipy-1.8.0 change. Do you know if there's a way to maintain backward compatibility with this kind of thing?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dengwirda, we could do a try/except to first try the new interface. Or we could query for scipy version and select the arguments accordingly.

Copy link
Collaborator

@xylar xylar Nov 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import scipy

print(scipy.__version__)

should be able to tell the version of scipy. Then, something using:

import pkg_resources
import scipy

new_args = pkg_resources.parse_version(scipy.__version__) >= pkg_resources.parse_version('1.8.0')
if new_args:
    __, nloc = tree.query(qpos, workers=-1)
else:
   __, nloc = tree.query(qpos, n_jobs=-1)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xylar - sure, I can. If we set the version in the conda environment, then do we also need the changes to select arguments based on version?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just do the version constraint. The code snippet here is more for @dengwirda to use outside of compass if needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @xylar, and I agree that for compass just supporting scipy >= 1.8.0 makes sense.

@xylar
Copy link
Collaborator

xylar commented Nov 15, 2022

@sbrus89, just figured I'd look into the errors that @mark-petersen saw. I haven't had time to do a more thorough review yet but I hope to soon.

@sbrus89
Copy link
Collaborator Author

sbrus89 commented Nov 15, 2022

Thanks @mark-petersen and @xylar. I'm surprised this worked for me at all with these issues hanging around. I fixed these problems in the most recent commit.

@mark-petersen
Copy link
Collaborator

I'm now getting

compass setup -p /usr/projects/climate/mpeterse/repos/E3SM/master/components/mpas-ocean -w $n/221116a_tides -n 234 235 236
Setting up test cases:
  ocean/tides/Icos7/mesh
  ocean/tides/Icos7/init
  ocean/tides/Icos7/forward
Traceback (most recent call last):
...
HTTPError: 404 Client Error: Not Found for`  url: https://web.lcrc.anl.gov/public/e3sm/mpas_standalonedata/mpas-ocean/tides/TPXO9/extract_HC

url: https://web.lcrc.anl.gov/public/e3sm/mpas_standalonedata/mpas-ocean/tides/TPXO9/extract_HC is indeed a bad address. Looks like one of these lines:

compass/ocean/tests/tides/analysis/__init__.py:55:            filename='extract_HC',
compass/ocean/tests/tides/analysis/__init__.py:56:            target='TPXO9/extract_HC',
compass/ocean/tests/tides/analysis/__init__.py:171:            subprocess.call(f'./extract_HC < inputs/{con}_setup', shell=True)

@sbrus89
Copy link
Collaborator Author

sbrus89 commented Nov 16, 2022

@mark-petersen - I have fixed the issue with the extract_HC path.

@sbrus89 sbrus89 requested a review from knbarton November 18, 2022 18:46
@sbrus89
Copy link
Collaborator Author

sbrus89 commented Nov 18, 2022

@xylar, it looks like when the extract_HC executable is downloaded, it loses its x permissions and causes the analysis step to fail. @mark-petersen ran into this issue, but changing the permissions manually after the download fixed it.

Copy link
Collaborator

@mark-petersen mark-petersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbrus89 thank you, this is an impressive amount of work! This now sets up and runs the three tests (mesh, init, forward) to completion on badger, and creates the same plots as above.

@xylar
Copy link
Collaborator

xylar commented Nov 18, 2022

@sbrus89, you can use subprocess.run(['chmod', 'u+x', 'extract_HC'], check=True) to fix that before you try to run. There are fancier python ways to do this but I don't think you need to go down that road.

for con in self.constituents:
print('')
print(f'run {con}')
subprocess.call(f'./extract_HC < inputs/{con}_setup', shell=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do a chmod right before this call, maybe.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the top, you'll need to add:

import stat

then, here:

Suggested change
subprocess.call(f'./extract_HC < inputs/{con}_setup', shell=True)
os.chmod('extract_HC', stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
subprocess.call(f'./extract_HC < inputs/{con}_setup', shell=True)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If extract_HC produces any output, we will need to figure out a way to redirect its output to self.logger (which points to a log file when running test suites). Otherwise, the output will be quite disruptive when running a suite.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe adding this import:

from mpas_tools.logging import check_call

and then changing the call to:

Suggested change
subprocess.call(f'./extract_HC < inputs/{con}_setup', shell=True)
check_call(f'./extract_HC < inputs/{con}_setup', logger=self.logger, shell=True)

should work. We can find out. This check_call also logs the command being run by default so you don't need to do that above here.

@knbarton
Copy link
Collaborator

I checked all the namelist and streams files against my run configurations. I found the following differences from the forward namelist:

config_calendar_type = 'gregorian_noleap'
config_hmix_scaleWithMesh = .false.
config_hmix_use_ref_cell_width = .false.

@xylar xylar added the enhancement New feature or request label Nov 23, 2022
Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbrus89, this looks amazing! You have done some very careful work here and it really shows what compass is capable of!

One think that you will need to remove from this PR is the update to the E3SM-Project submodule that happened in de6d7da. I tried running with the old submodule and that didn't work so it seems we do need to update E3SM-Project. But that will need to happen in a separate PR (e.g. #461) and should ideally happen before this gets merged.

for con in self.constituents:
print('')
print(f'run {con}')
subprocess.call(f'./extract_HC < inputs/{con}_setup', shell=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the top, you'll need to add:

import stat

then, here:

Suggested change
subprocess.call(f'./extract_HC < inputs/{con}_setup', shell=True)
os.chmod('extract_HC', stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
subprocess.call(f'./extract_HC < inputs/{con}_setup', shell=True)

for con in self.constituents:
print('')
print(f'run {con}')
subprocess.call(f'./extract_HC < inputs/{con}_setup', shell=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If extract_HC produces any output, we will need to figure out a way to redirect its output to self.logger (which points to a log file when running test suites). Otherwise, the output will be quite disruptive when running a suite.

for con in self.constituents:
print('')
print(f'run {con}')
subprocess.call(f'./extract_HC < inputs/{con}_setup', shell=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe adding this import:

from mpas_tools.logging import check_call

and then changing the call to:

Suggested change
subprocess.call(f'./extract_HC < inputs/{con}_setup', shell=True)
check_call(f'./extract_HC < inputs/{con}_setup', logger=self.logger, shell=True)

should work. We can find out. This check_call also logs the command being run by default so you don't need to do that above here.

@xylar
Copy link
Collaborator

xylar commented Nov 23, 2022

Running on Chsrysalis, I'm getting this error in Analysis:

      Failed
Exception raised while running the steps of the test case
Traceback (most recent call last):
  File "/gpfs/fs1/home/ac.xylar/mpas-work/compass/tides/compass/run/serial.py", line 145, in run_tests
    _run_test(test_case)
  File "/gpfs/fs1/home/ac.xylar/mpas-work/compass/tides/compass/run/serial.py", line 394, in _run_test
    _run_step(test_case, step, test_case.new_step_log_file)
  File "/gpfs/fs1/home/ac.xylar/mpas-work/compass/tides/compass/run/serial.py", line 437, in _run_step
    step.run()
  File "/gpfs/fs1/home/ac.xylar/mpas-work/compass/tides/compass/ocean/tests/tides/analysis/__init__.py", line 449, in run
    self.read_otps2_output(idx)
  File "/gpfs/fs1/home/ac.xylar/mpas-work/compass/tides/compass/ocean/tests/tides/analysis/__init__.py", line 181, in read_otps2_output
    f = open(f'outputs/{con}.out', 'r')
FileNotFoundError: [Errno 2] No such file or directory: 'outputs/k1.out'

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I'll test one more time once #464 and #461 have gone in.

@mark-petersen
Copy link
Collaborator

@knbarton thanks for your comment above:

Those flags are set here:
https://github.com/MPAS-Dev/compass/pull/456/files#diff-93979e5aadaf4f9685b33df3140dba146703ce4f721f531835600c5ab55c032dR3-R8

I think the three flags settings that Steve has in this PR are better.

  1. config_calendar_type = 'noleap' is correct. This option changed because gregorian_noleap was not a standard calendar name in the ESMF library.
  2. config_hmix_scaleWithMesh = .true. is a better choice. This one could be set to false for icos meshes, but it is generally safer to set it to true, otherwise you need to remember to change it for variable-resolution meshes.
  3. config_hmix_use_ref_cell_width = .true. is also better, because then you set your viscosity value once based on a reference cell width, rather than recalculating it and then changing the config_mom_del2 for every resolution.

@vanroekel
Copy link
Collaborator

Thanks @sbrus89 for the change! I'm trying to test again and am getting this traceback

Traceback (most recent call last):
  File "/home/ac.vanroekel/miniconda3/envs/dev_compass_1.2.0-alpha.2/bin/compass", line 33, in <module>
    sys.exit(load_entry_point('compass', 'console_scripts', 'compass')())
  File "/lcrc/group/e3sm/ac.vanroekel/tidesCompass/compass/__main__.py", line 63, in main
    commands[args.command]()
  File "/lcrc/group/e3sm/ac.vanroekel/tidesCompass/compass/setup.py", line 386, in main
    setup_cases(tests=tests, numbers=args.case_num,
  File "/lcrc/group/e3sm/ac.vanroekel/tidesCompass/compass/setup.py", line 149, in setup_cases
    setup_case(path, test_case, config_file, machine, work_dir,
  File "/lcrc/group/e3sm/ac.vanroekel/tidesCompass/compass/setup.py", line 299, in setup_case
    step.setup()
  File "/lcrc/group/e3sm/ac.vanroekel/tidesCompass/compass/ocean/tests/tides/init/initial_state.py", line 93, in setup
    self.tasks = config.getint('tides', 'init_tasks')
  File "/home/ac.vanroekel/miniconda3/envs/dev_compass_1.2.0-alpha.2/lib/python3.10/site-packages/mpas_tools/config.py", line 132, in getint
    return self.combined.getint(section, option)
  File "/home/ac.vanroekel/miniconda3/envs/dev_compass_1.2.0-alpha.2/lib/python3.10/configparser.py", line 819, in getint
    return self._get_conv(section, option, int, raw=raw, vars=vars,
  File "/home/ac.vanroekel/miniconda3/envs/dev_compass_1.2.0-alpha.2/lib/python3.10/configparser.py", line 809, in _get_conv
    return self._get(section, conv, option, raw=raw, vars=vars,
  File "/home/ac.vanroekel/miniconda3/envs/dev_compass_1.2.0-alpha.2/lib/python3.10/configparser.py", line 804, in _get
    return conv(self.get(section, option, **kwargs))
  File "/home/ac.vanroekel/miniconda3/envs/dev_compass_1.2.0-alpha.2/lib/python3.10/configparser.py", line 793, in get
    raise NoOptionError(option, section)
configparser.NoOptionError: No option 'init_tasks' in section: 'tides'

I must be missing this but where is the .cfg file? It seems it is looking for it here and can't find it.

@vanroekel
Copy link
Collaborator

pulling the code again and re setting the cases fixed my error above.

@xylar
Copy link
Collaborator

xylar commented Dec 13, 2022

@vanroekel and @sbrus89, I was about to merge this -- it's had a lot of testing. But it seems like you're still doing some last checks. Feel free to merge when you're ready. @sbrus89, I think you have permission but if not I'll do it in the morning.

@vanroekel
Copy link
Collaborator

@xylar one quick question it probably isn't related to this branch but came up when I was trying it out. I was in the initial_state part of the run and tried changing init_ntasks from 36 to 128 after the test was set up but then compass run still used 36 for tasks. Is it expected that if I change init_ntasks init.cfg after compass setup then compass run will still use the default value?

@xylar
Copy link
Collaborator

xylar commented Dec 13, 2022

@vanroekel, it should change as you expected. We can fix that.

@xylar
Copy link
Collaborator

xylar commented Dec 13, 2022

Let's make a note of it in an issue for now. It relates to a method called runtime_setup() that @altheaden and I have code to add to Step but which seems to have gotten lost in #430. I should pull that out and then go through compass generally and fix situations like this one.

@vanroekel
Copy link
Collaborator

sounds good to me. I'm able to run this test smoothly so am happy for this to get merged

@xylar xylar merged commit 246325a into MPAS-Dev:master Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants