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

XIOS example resample #1

Merged
merged 6 commits into from
Feb 26, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 31 additions & 9 deletions .github/workflows/buildTest.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
name: build-test-XIOS

on: [push, pull_request]
on:
push:
branches:
- main
pull_request:

jobs:
build_test:
name: build XIOS and run tests
name: build test
runs-on: ubuntu-latest
strategy:
matrix:
# version: [XIOS/trunk@2252, XIOS2/trunk, XIOS3/trunk]
version: [XIOS/trunk@2252, XIOS2/trunk]
steps:
# Check out repository branch
- uses: actions/checkout@v4
Expand All @@ -16,19 +24,33 @@ jobs:
sudo apt -yq install $(<dependencies)
- name: clone and build XIOS
run: |
svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS2/trunk XIOS2
cp arch/* XIOS2/arch/
cd XIOS2
svn co http://forge.ipsl.jussieu.fr/ioserver/svn/${{ matrix.version }} XIOS
cp arch/* XIOS/arch/
cd XIOS
if [ ${{ matrix.version }} == 'XIOS3/trunk' ]; then
patch -p0 < ../patches/xios3/revert_svn2517_transport.patch
sed -i 's/<variable_group id="parameters" >/<variable_group id="parameters" > <variable id="transport_protocol" type="string" >p2p<\/variable>/g' generic_testcase/iodef.xml
cat generic_testcase/iodef.xml
fi
./make_xios --job 2 --arch GCC_LINUX_APT
ls -l lib/
ls -l inc/
ls -l bin/
cd ..
shell: bash
- name: run generic
run: |
cd XIOS2/generic_testcase
cd XIOS/generic_testcase
ln -s ../bin/generic_testcase.exe
ln -s ../bin/xios_server.exe
sed -i 's/nb_proc_atm=4/nb_proc_atm=1/g' param.def
mpiexec -n 1 ./generic_testcase.exe : -n 1 ./xios_server.exe
cd ../..
- name: run resample example
run: |
. arch/arch-GCC_LINUX_APT.env
. arch/arch-GCC_LINUX_APT.path
export XIOS_BINDIR=$PWD/XIOS/bin
export XIOS_INCDIR=$PWD/XIOS/inc
export XIOS_LIBDIR=$PWD/XIOS/lib

export MVER=${{ matrix.version }}

python3 -m unittest discover -v -s xios_examples
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# tcd-XIOS-demonstration
Demonstration code for XML I/O server XIOS usage.

Demonstrations of using XIOS are provided with Continuous Integration testing with respect to XIOS2 trunk.

## Environments

Environments are managed, with a little complication, to enable running on scientific desktop and on Github Continuous Integration.

There is a helper script that one can source, in the root directory, to ensure that the scientific desktop LFRic environment is loaded, using the environment variable setup for the Makefiles, which is also compatible with the Github CI runner.

`. desktopEnv`
2 changes: 2 additions & 0 deletions dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ libnetcdf-mpi-dev
libnetcdff-dev
libpnetcdf-dev
netcdf-bin
python3-numpy
python3-netcdf4
21 changes: 20 additions & 1 deletion desktopEnv
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
# this environment management script needs to be sourced in order to provide
# equivalent functionality on the MO Linux desktop to the Github CI environment.
# `. desktopEnv`

# Use the LFRic programming environment
module purge
module unuse /project/ukmo/rhel7/R/modulefiles; module unuse /project/ukmo/rhel7/fortran/opt/gfortran/modulefiles
module use /project/extrasoftware/modulefiles.rhel7
module use /data/users/lfric/software/modulefiles.rhel7

module load environment/lfric/gcc

# provide explit path set to the arch script for netCDF linking
export NETCDF_LIB_DIR=$NETCDF_4_8_1_ROOT/lib:$NETCDF_4_8_1_ROOT/lib64
export NETCDF_INC_DIR=$NETCDF_4_8_1_ROOT/include

. arch/arch-GCC_LINUX_APT.path

# provide explicit paths to all XIOS components
export XIOS_INCDIR=$XIOS_R2252_2_ROOT/include
export XIOS_LIBDIR=$XIOS_R2252_2_ROOT/lib
export XIOS_BINDIR=$XIOS_R2252_2_ROOT/bin
export XIOS_BINDIR=$XIOS_R2252_2_ROOT/bin

# use an extend LFRic Python environment
# that includes netCDF4-python built w.r.t. the LFRIC
# netCDF
. /data/users/itmh/pylfricpyexptl/bin/activate

# dev-notes (starting from the lfric Python as provided by module)
# - python -m venv {/some/path}
# - python -m pip install cython mpi4py
# - python -m pip install --no-build-isolation netCDF4==1.5.8
# - pinned version needed for compatability with libnetcdf 4.8.1
# - . activate {/some/path}
Loading