Skip to content

Commit

Permalink
Check zfactor variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mauzey1 committed Aug 26, 2024
1 parent 377827f commit 88b37a6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
strategy:
matrix:
runner:
- RUNNER_OS: 'ubuntu-latest'
OS: linux-64
OS_NAME: linux_64
MINICONDA_INSTALLER_URL: https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
C_COMPILER: gcc_linux-64
FORTRAN_COMPILER: gfortran_linux-64
PROJECT_DIR: workdir/linux
- RUNNER_OS: 'macos-14'
OS: osx-arm64
OS_NAME: osx_arm64
MINICONDA_INSTALLER_URL: https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh
C_COMPILER: clang_osx-arm64
FORTRAN_COMPILER: gfortran_osx-arm64
PROJECT_DIR: workdir/macos_arm64
python_version: ['3.10']
runs-on: ${{ matrix.runner.RUNNER_OS }}
env:
Expand Down
21 changes: 21 additions & 0 deletions Test/test_singletons.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ static void run_test()
double scalar;
int nlon, nlat, nlev;
int zfactor_id;
int i;

int axes_ids[5];
int zfactor_axis_ids[3];
Expand Down Expand Up @@ -138,15 +139,35 @@ static void run_test()
if (cmor_zfactor(&zfactor_id, id_alev, (char *) "p0", (char *) "Pa", 0, 0,
'd', (void *) p0, NULL) != 0)
fail("cmor_zfactor(p0)");
printf("cmor_vars[%d].ndims = %d\n", zfactor_id, cmor_vars[zfactor_id].ndims);
for(i = 0; i < cmor_vars[zfactor_id].ndims; ++i){
printf("cmor_vars[%d].axes_ids[%d].axes_ids = %d\n", zfactor_id, i, cmor_vars[zfactor_id].axes_ids[i]);
printf("cmor_axes[%d].id = %s\n", cmor_vars[zfactor_id].axes_ids[i], cmor_axes[cmor_vars[zfactor_id].axes_ids[i]].id);
}
if (cmor_zfactor(&zfactor_id, id_alev, (char *) "b", (char *) "", 1, &lev_id_array[0],
'd', (void *) b_val, (void *) b_bnds) != 0)
fail("cmor_zfactor(b)");
printf("cmor_vars[%d].ndims = %d\n", zfactor_id, cmor_vars[zfactor_id].ndims);
for(i = 0; i < cmor_vars[zfactor_id].ndims; ++i){
printf("cmor_vars[%d].axes_ids[%d].axes_ids = %d\n", zfactor_id, i, cmor_vars[zfactor_id].axes_ids[i]);
printf("cmor_axes[%d].id = %s\n", cmor_vars[zfactor_id].axes_ids[i], cmor_axes[cmor_vars[zfactor_id].axes_ids[i]].id);
}
if (cmor_zfactor(&zfactor_id, id_alev, (char *) "a", (char *) "", 1, &lev_id_array[0],
'd', (void *) a_val, (void *) a_bnds) != 0)
fail("cmor_zfactor(a)");
printf("cmor_vars[%d].ndims = %d\n", zfactor_id, cmor_vars[zfactor_id].ndims);
for(i = 0; i < cmor_vars[zfactor_id].ndims; ++i){
printf("cmor_vars[%d].axes_ids[%d].axes_ids = %d\n", zfactor_id, i, cmor_vars[zfactor_id].axes_ids[i]);
printf("cmor_axes[%d].id = %s\n", cmor_vars[zfactor_id].axes_ids[i], cmor_axes[cmor_vars[zfactor_id].axes_ids[i]].id);
}
if (cmor_zfactor(&zfactor_id, id_alev, (char *) "ps1", (char *) "Pa", 3, zfactor_axis_ids,
'd', NULL, NULL) != 0)
fail("cmor_zfactor(ps1)");
printf("cmor_vars[%d].ndims = %d\n", zfactor_id, cmor_vars[zfactor_id].ndims);
for(i = 0; i < cmor_vars[zfactor_id].ndims; ++i){
printf("cmor_vars[%d].axes_ids[%d].axes_ids = %d\n", zfactor_id, i, cmor_vars[zfactor_id].axes_ids[i]);
printf("cmor_axes[%d].id = %s\n", cmor_vars[zfactor_id].axes_ids[i], cmor_axes[cmor_vars[zfactor_id].axes_ids[i]].id);
}

/*
* No singleton dimensions are passed.
Expand Down

0 comments on commit 88b37a6

Please sign in to comment.