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

Non-bats testing and repo structure update #322

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5e8731c
Update land_utils testing and move to new layout
underwoo Oct 25, 2024
e85a2ae
Move mppnccombine to src directory
underwoo Oct 25, 2024
4e72d34
Add Intel mac c configuration
underwoo Oct 25, 2024
ea8a851
Add some mppnccombine tests
underwoo Oct 25, 2024
1148ac3
Renamed mppnccombine tests
underwoo Oct 25, 2024
b75f0f7
Some tests for mppnccombine
underwoo Oct 28, 2024
41c3a6f
working on iceberg_comb
underwoo Nov 7, 2024
be62041
New iceberg_comb.sh
underwoo Nov 7, 2024
b5ffb10
Renamed iceberg_comb.sh to have .in end for expansion of variables
underwoo Nov 8, 2024
d750693
Update documentation (man), and add check for file with no icebergs
underwoo Nov 8, 2024
407057c
Moved iceberg_comb to src dir
underwoo Nov 8, 2024
401c068
Moved iceberg_comb to src directory
underwoo Nov 8, 2024
0cd8bb9
Add iceberg tests, clean out the old Makefile.am
underwoo Nov 8, 2024
340fe06
Moved combine_restarts
underwoo Nov 8, 2024
9a63831
Added more man pages for moved programs now in src
underwoo Nov 8, 2024
6fc075b
Moved list_ncvars
underwoo Nov 8, 2024
0860873
move list_ncvars to src
underwoo Nov 9, 2024
1e77db1
Addressed sh lint warnings in combine_restarts
underwoo Nov 9, 2024
92c14cf
Move plevel to src only
underwoo Nov 13, 2024
fae7550
plevel now moved
underwoo Nov 13, 2024
e3060d7
Fixes for plevel build
underwoo Nov 16, 2024
aa9e867
Add mkdir to .F90_mod.mod rule
underwoo Nov 16, 2024
bc98cf7
add plevel.sh man page
underwoo Nov 16, 2024
9756d4b
plevel.sh first test
underwoo Nov 16, 2024
cc0c127
Finish plevel mods and tests
underwoo Nov 19, 2024
36b7d92
add plevel help and version options
underwoo Nov 19, 2024
2b804f7
update plevel to print history and fre-nctools version informaiton
underwoo Nov 24, 2024
9bc1461
Update changelog file
underwoo Nov 24, 2024
738236a
Add additional documentation to nct_nc_utils.F90
underwoo Nov 24, 2024
186c26a
migrate time_average to src directory
underwoo Nov 27, 2024
385ca31
Verify that NC* commands exist, and have the vars be precious
underwoo Nov 28, 2024
9059da6
Replace AC_PYTHON_MODULE with AX_PYTHON_MODULE
underwoo Nov 28, 2024
d9e2db8
Add time average manual pages
underwoo Nov 28, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ t/Test26/

# Other build generated files
config.h
*.mod
postprocessing/land_utils/combine-ncc
postprocessing/land_utils/decompress-ncc
postprocessing/land_utils/is-compressed
Expand Down
23 changes: 18 additions & 5 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
{
"configurations": [
{
"name": "Mac",
"name": "Mac (Arm)",
"includePath": [
"${workspaceFolder}/**",
"/opt/homebrew/Cellar/netcdf/4.9.0/include"
],
"defines": [

"/opt/homebrew/include"
],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "macos-clang-arm64"
},
{
"name": "Mac (Intel)",
"includePath": [
"${workspaceFolder}/**",
"${HOME}/opt/homebrew/include"
],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "macos-clang-x64"
}
],
"version": 4
Expand Down
37 changes: 37 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"cSpell.words": [
"Balaji",
"Forrestal",
"hght",
"Malyshev",
"Mohan",
"mppnccombine",
"NCEP",
"plevel",
"plevs",
"reananalysis",
"Sergey",
"sphum",
"Tauber",
"Tushar",
"Vahlenkamp",
"zsurf"
],
"cSpell.languageSettings": [
{
// use with cpp or c files
"languageId": "cpp,c",
// turn off compound words, because it is only checking strings.
"allowCompoundWords": false,
// Only check comments and strings
"includeRegExpList": [
"CStyleComment",
"string"
],
// Exclude includes, because they are also strings.
"ignoreRegExpList": [
"/#include.*/",
]
}
]
}
86 changes: 86 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "make",
"command": "make",
"args": [],
"options": {
"cwd": "${workspaceFolder}/build"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "shell",
"label": "clean build dir",
"command": "rm",
"args": ["-rf", "${workspaceFolder}/build"],
"options": {
"cwd": "${workspaceFolder}",
},
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"label": "mk build dir",
"command": "mkdir",
"args": ["-p", "${workspaceFolder}/build"],
"options": {
"cwd": "${workspaceFolder}",
},
"group": {
"kind": "build",
"isDefault": false
},
"dependsOn": ["clean build dir"]
},
{
"type": "shell",
"label": "configure",
"command": "../configure",
"args": ["--prefix=${workspaceFolder}/build/opt"],
"options": {
"cwd": "${workspaceFolder}/build"
},
"group": {
"kind": "build",
"isDefault": false
},
"dependsOn": ["mk build dir"]
},
{
"type": "shell",
"label": "autoreconf",
"command": "autoreconf",
"args": ["-if"],
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "none",
"isDefault": false
},
"problemMatcher": {
"owner": "autoconf",
"fileLocation": "relative",
"pattern": {
"regexp": "^(\\S+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
}
}
]
}
12 changes: 5 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,9 @@
#***********************************************************************
ACLOCAL_AMFLAGS = -I m4

SUBDIRS = postprocessing/combine_restarts \
postprocessing/iceberg_comb \
postprocessing/land_utils \
postprocessing/list_ncvars \
postprocessing/mppnccombine \
postprocessing/plevel \
SUBDIRS = lib/libnfu \
src \
postprocessing/split_ncvars \
postprocessing/timavg \
tools/libfrencutils \
tools/check_mask \
tools/cubic_utils \
Expand All @@ -52,6 +47,9 @@ SUBDIRS = postprocessing/combine_restarts \
tools/simple_hydrog/rmvpr \
tools/nc_null_check

SUBDIRS += man \
tests

if WITH_CHECK_PROGS
SUBDIRS += t
endif
Expand Down
82 changes: 59 additions & 23 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,30 @@
# Prelude
AC_PREREQ([2.63])
AC_INIT(
[FRE NC Tools],
[FRE NCTools],
[2024.04],
[[email protected]],
[https://github.com/NOAA-GFDL/FRE-NCtools/issues],
[fre-nctools],
[https://github.com/NOAA-GFDL/FRE-NCtools])

# Place the git description informatin in the configure script
m4_define([git_revision],
[m4_esyscmd_s([git describe --always --dirty 2> /dev/null || echo "unknown version"])])
AC_REVISION([$git_revision])

[m4_esyscmd_s([git describe --tags --always --dirty 2> /dev/null || echo "unknown version"])])
AC_REVISION([git_revision])
m4_define([git_hashval],
[m4_esyscmd_s([git rev-parse HEAD 2> /dev/null || echo "unknown githash"])])
AC_REVISION([$git_hashval])
AC_REVISION([git_hashval])
m4_define([git_date],
[m4_esyscmd_s([git show --no-patch --format=%as HEAD 2> /dev/null || date +%Y-%m-%d])])
AC_REVISION([git_date])
m4_define([copyright_year],
[m4_substr(git_date, 0, 4)])

AC_CONFIG_SRCDIR([postprocessing/land_utils/combine-ncc.F90])
AC_CONFIG_SRCDIR([src/land_utils/combine-ncc.F90])
AC_CONFIG_MACRO_DIR([m4])
AC_REQUIRE_AUX_FILE([tap-driver.sh])

AM_INIT_AUTOMAKE([foreign -Wall -Werror -Woverride tar-ustar])
AM_INIT_AUTOMAKE([foreign -Wall -Werror -Woverride tar-pax subdir-objects])
AM_EXTRA_RECURSIVE_TARGETS([docs install-docs])

# Check for programs
Expand Down Expand Up @@ -69,6 +73,8 @@ AC_FC_SRCEXT([F90])
AC_FC_LINE_LENGTH([unlimited])
AC_FC_FREEFORM()
AC_FC_MODULE_EXTENSION()
AC_FC_MODULE_FLAG()
AC_FC_MODULE_OUTPUT_FLAG()
GX_FC_DEFAULT_REAL_KIND8_FLAG()
GX_FC_DEFAULT_REAL_KIND4_FLAG()

Expand Down Expand Up @@ -107,6 +113,10 @@ if test ! -z "$FC_CRAY_POINTER_FLAG"; then
FCFLAGS="$FCFLAGS $FC_CRAY_POINTER_FLAG"
fi

# Check for programs
AC_PROG_GREP
AC_PROG_EGREP
AC_PROG_SED

AC_CHECK_PROGS(ASCIIDOC, [asciidoc])
if test -n "$ASCIIDOC"; then
Expand All @@ -127,7 +137,29 @@ AC_CHECK_PROGS(BATS, [bats])
AC_CHECK_PROGS(PROVE, [prove])
AM_CONDITIONAL([WITH_CHECK_PROGS], [test -n "$PROVE" -a -n "$BATS"])

AC_PYTHON_MODULE(xarray, [], python3)
# Although these are supplied with the NetCDF C library, we'll double
# check that ncgen and ncdump are available
AC_ARG_VAR([NCGEN], [Path to ncgen])
AC_PATH_PROG(NCGEN, [ncgen])
AS_IF([test -z "$NCGEN"],
[AC_MSG_ERROR([Cannot find ncgen. Please ensure ncgen is in PATH or set the environment variable NCGEN to the full path to ncgen.])])

AC_ARG_VAR([NCDUMP], [Path to ncdump])
AC_PATH_PROG(NCDUMP, [ncdump])
AS_IF([test -z "$NCDUMP"],
[AC_MSG_ERROR([Cannot find ncdump. Please ensure ncdump is in PATH or set the environment variable NCDUMP to the full path to ncgen.])])

AC_ARG_VAR([NCRCAT], [Path to ncrcat])
AC_PATH_PROG(NCRCAT, [ncrcat])
AS_IF([test -z "$NCRCAT"],
[AC_MSG_ERROR([Cannot find ncrcat. Please ensure ncrcat is in PATH or set the environment variable NCRCAT to the full path to ncgen.])])

AC_ARG_VAR([NCATTED], [Path to ncatted])
AC_PATH_PROG(NCATTED, [ncatted])
AS_IF([test -z "$NCATTED"],
[AC_MSG_ERROR([Cannot find ncatted. Please ensure ncatted is in PATH or set the environment variable NCATTED to the full path to ncgen.])])

AX_PYTHON_MODULE([xarray],[],[python3])
if test ${HAVE_PYMOD_XARRAY} = yes; then
AM_CONDITIONAL([SKIP_XARRAY_TESTS], false )
else
Expand Down Expand Up @@ -171,13 +203,21 @@ AS_IF([test $ac_cv_type_long_double_wider = no],
# Check if Test25-input link points to an existing directory
AM_CONDITIONAL([HAVE_TEST25_INPUT], [test -e ${srcdir}/t/Test25-input/grid_spec.nc])

# Other defs
AC_DEFINE([GIT_REVISION], "git_revision",
[Holds the 'git describe' information if configure ran within a git working directory])
AC_DEFINE([GIT_HEADHASH], "git_hashval",
[Holds the 'git rev-parse HEAD' information if configure ran within a git working directory])
# Set macros
AS_VAR_SET([GIT_REVISION], ["git_revision"])dnl
AC_DEFINE([GIT_REVISION], ["git_revision"],
[Holds the 'git describe' information if configure ran within a git working directory])dnl
AC_SUBST(GIT_REVISION)dnl
AS_VAR_SET([GIT_HEADHASH], ["git_hashval"])dnl
AC_DEFINE([GIT_HEADHASH], ["git_hashval"],
[Holds the 'git rev-parse HEAD' information if configure ran within a git working directory])dnl
AC_SUBST(GIT_HEADHASH)dnl
AS_VAR_SET([COPYRIGHT_YEAR], ["copyright_year"])dnl
AC_DEFINE([COPYRIGHT_YEAR], ["copyright_year"],
[Year to place in Copyright notices printed with --version information])dnl
AC_SUBST(COPYRIGHT_YEAR)dnl

#Code for setting rpath based ncview's configure.in code.
# Code for setting rpath based ncview's configure.in code.
AS_IF([test x$ac_compiler_gnu = xyes], [RPATH_FLAGS=""
for word in $NETCDF_LDFLAGS $NETCDF_FCLDFLAGS
do
Expand All @@ -197,14 +237,10 @@ AC_SUBST(RPATH_FLAGS) dnl
# Output files
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile
postprocessing/combine_restarts/Makefile
postprocessing/iceberg_comb/Makefile
postprocessing/land_utils/Makefile
postprocessing/list_ncvars/Makefile
postprocessing/mppnccombine/Makefile
postprocessing/plevel/Makefile
lib/libnfu/Makefile
man/Makefile
src/Makefile
postprocessing/split_ncvars/Makefile
postprocessing/timavg/Makefile
tools/libfrencutils/Makefile
tools/libfrencutils_acc/Makefile
tools/check_mask/Makefile
Expand Down Expand Up @@ -237,7 +273,7 @@ AC_CONFIG_FILES([Makefile
t_acc/test_get_grid_cell_struct/Makefile
t_acc/test_get_upbound_nxcells_2dx2d/Makefile
t_acc/test_get_interp_order1/Makefile

tests/Makefile
])

AC_OUTPUT
18 changes: 12 additions & 6 deletions postprocessing/list_ncvars/Makefile.am → lib/libnfu/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@
# License along with FRE-NCTools. If not, see
# <http://www.gnu.org/licenses/>.
#***********************************************************************
bin_PROGRAMS = list_ncvars.exe
dist_bin_SCRIPTS = list_ncvars.csh

list_ncvars_exe_SOURCES = list_ncvars.f90
list_ncvars_exe_FCFLAGS = $(NETCDF_FCFLAGS) $(FC_DEFAULT_REAL_KIND8_FLAG) $(AM_FCFLAGS)
list_ncvars_exe_LDADD = $(NETCDF_FCLDFLAGS) $(NETCDF_FCLIBS) $(RPATH_FLAGS)
noinst_LIBRARIES = libnfu.a

AM_FCFLAGS = $(FC_DEFAULT_REAL_KIND8_FLAG) $(NETCDF_FCFLAGS)
LDADD = $(NETCDF_LDFLAGS) $(NETCDF_LIBS) $(RPATH_FLAGS)

libnfu_a_SOURCES = nfu.F90 nfu_compress.F90

nfu_mod.$(FC_MODEXT): nfu.$(OBJEXT)
nfu_compress_mod.$(FC_MODEXT): nfu_compress.$(OBJEXT)

nfu_compress.$(OBJEXT): nfu_mod.$(FC_MODEXT)

clean-local:
$(RM) *.mod
$(RM) *.$(FC_MODEXT)
File renamed without changes.
File renamed without changes.
Loading
Loading