nextsimhub / nextsimdg

neXtSIM_DG : next generation sea-ice model with DG
https://nextsim-dg.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
10 stars 13 forks source link

Xios interface with tests #496

Closed TomMelt closed 5 months ago

TomMelt commented 7 months ago

Nextsim XIOS Interface

The previous XIOS work has diverged from the current development branch.

This PR has a minimum working example (MWE) in the form of a test testXiosInit (source ./core/test/XiosInit_test.cpp).

The test checks most of the functionality added by the XIOS C++ interface

which depend on a C interface included here: ./core/src/include/xios_c_interface.hpp

The core functionality of XIOS is included as part of this PR as the other two components will require it.

XIOS functionality

Still to discuss:

This PR does the following:

I think this can be merged in relatively soon. The remaining steps are (for a future PR):

Steps required to run testXiosInit

The test should pass all tests:

[doctest] doctest version is "2.4.11"
[doctest] run with "--help" for options
step 0===============================================================================
[doctest] test cases:  1 |  1 passed | 0 failed | 0 skipped
[doctest] assertions: 19 | 19 passed | 0 failed |
[doctest] Status: SUCCESS!
===============================================================================
[doctest] assertions on all processes:     38 |     38 passed |      0 failed |
===============================================================================
[doctest] Status: SUCCESS!

And produce the following output:

xios_client_1.err
xios_client_0.err
diagnostic.nc
xios_client_1.out
xios_client_0.out
doctest_1.log
doctest_0.log

I don't currently verify the output of diagnostic.nc as part of testXiosInit but this can be added.

This PR is to update the state of XIOS related PRs and Issues. This will close some stale issues closes #218 closes #291 closes #293

MarionBWeinzierl commented 7 months ago

I can see that you have the same netcdf_par.h error on Ubuntu that I had previously. Did you try setting the same include path to the parallel netcdf version?

https://github.com/nextsimhub/nextsimdg/blob/8066f6725e3c10435dfa3e8a3bef5f0d85d0ff1c/Dockerfiles/Dockerfile_Ubuntu_MPI#L10

MarionBWeinzierl commented 7 months ago

When I try to run (cd xios && ./make_xios --arch GCC_LINUX --netcdf_lib netcdf4_seq) to install xios I am getting

    /home/workspace/nextsimdg_xios/xios/extern/remap/src/earcut.hpp:26:29: error: ‘uint32_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
   26 | template <typename N = std::uint32_t>
      |                             ^~~~~~~~
      |                             wint_t
    fcm_internal compile failed (256)
    gmake: *** [/home/workspace/nextsimdg_xios/xios/Makefile:756: meshutil.o] Error 1 
    gmake -f /home/workspace/nextsimdg_xios/xios/Makefile -j 1 all failed (2) at /home/workspace/nextsimdg_xios/xios/tools/FCM_OLD/bin/../lib/Fcm/Build.pm line 597.
TomMelt commented 7 months ago

I can see that you have the same netcdf_par.h error on Ubuntu that I had previously. Did you try setting the same include path to the parallel netcdf version?

https://github.com/nextsimhub/nextsimdg/blob/8066f6725e3c10435dfa3e8a3bef5f0d85d0ff1c/Dockerfiles/Dockerfile_Ubuntu_MPI#L10

Yeah but I figured there's no point fixing it if we move to a Docker container anyway. That's why I have left it for now. It will get worse when we add XIOS dependencies. So my plan is, get the docker build working first and then we can just build Nextsim with the dev environment configured already