Commit cb021b37 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add cdi_write_const to automatically created example programs.

* And add corresponding check to test suite.
parent 0dd846c1
......@@ -29996,7 +29996,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
 
 
ac_config_files="$ac_config_files tests/test_cksum_grib tests/test_cksum_nc tests/test_cksum_nc2 tests/test_cksum_nc4 tests/test_cksum_extra tests/test_cksum_service tests/test_cksum_ieg tests/test_chunk_cksum tests/test_f2003 tests/pio_write_run tests/pio_write_deco2d_run tests/pio_cksum_mpinonb tests/pio_cksum_mpi_fw_ordered tests/pio_cksum_mpi_fw_at_all tests/pio_cksum_mpi_fw_at_reblock tests/pio_cksum_fpguard tests/pio_cksum_asynch tests/pio_cksum_writer tests/pio_cksum_cdf tests/test_resource_copy_mpi_run tests/test_cdf_transformation tables/gen_tableheaderfile util/serialrun"
ac_config_files="$ac_config_files tests/test_cksum_grib tests/test_cksum_nc tests/test_cksum_nc2 tests/test_cksum_nc4 tests/test_cksum_extra tests/test_cksum_service tests/test_cksum_ieg tests/test_chunk_cksum tests/test_f2003 tests/pio_write_run tests/pio_write_deco2d_run tests/pio_cksum_mpinonb tests/pio_cksum_mpi_fw_ordered tests/pio_cksum_mpi_fw_at_all tests/pio_cksum_mpi_fw_at_reblock tests/pio_cksum_fpguard tests/pio_cksum_asynch tests/pio_cksum_writer tests/pio_cksum_cdf tests/test_resource_copy_mpi_run tests/test_cdf_transformation tests/test_cdf_const tables/gen_tableheaderfile util/serialrun"
 
 
ac_config_files="$ac_config_files Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile cdi.settings examples/pio/Makefile src/pkgconfig/cdi.pc src/pkgconfig/cdipio.pc"
......@@ -31387,6 +31387,7 @@ do
"tests/pio_cksum_cdf") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_cdf" ;;
"tests/test_resource_copy_mpi_run") CONFIG_FILES="$CONFIG_FILES tests/test_resource_copy_mpi_run" ;;
"tests/test_cdf_transformation") CONFIG_FILES="$CONFIG_FILES tests/test_cdf_transformation" ;;
"tests/test_cdf_const") CONFIG_FILES="$CONFIG_FILES tests/test_cdf_const" ;;
"tables/gen_tableheaderfile") CONFIG_FILES="$CONFIG_FILES tables/gen_tableheaderfile" ;;
"util/serialrun") CONFIG_FILES="$CONFIG_FILES util/serialrun" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
......@@ -33211,6 +33212,7 @@ _LT_EOF
"tests/pio_cksum_cdf":F) chmod a+x "$ac_file" ;;
"tests/test_resource_copy_mpi_run":F) chmod a+x "$ac_file" ;;
"tests/test_cdf_transformation":F) chmod a+x "$ac_file" ;;
"tests/test_cdf_const":F) chmod a+x "$ac_file" ;;
"tables/gen_tableheaderfile":F) chmod a+x "$ac_file" ;;
"util/serialrun":F) chmod a+x "$ac_file" ;;
 
......@@ -412,6 +412,7 @@ AC_CONFIG_FILES([tests/test_cksum_grib \
tests/pio_cksum_cdf \
tests/test_resource_copy_mpi_run \
tests/test_cdf_transformation \
tests/test_cdf_const \
tables/gen_tableheaderfile \
util/serialrun],[chmod a+x "$ac_file"])
......
......@@ -2,35 +2,37 @@
#
EXTRA_DIST = cdi_read_f2003.f90 cdi_write_f2003.f90
#
noinst_PROGRAMS = cdi_write cdi_write_ens cdi_write_hybrid cdi_read cdi_copy
noinst_PROGRAMS = cdi_write cdi_write_ens cdi_write_hybrid cdi_read \
cdi_copy
if CREATE_ISOC
noinst_PROGRAMS += cdi_read_f2003 cdi_write_f2003
endif
if ENABLE_NETCDF
noinst_PROGRAMS += cdi_write_const
endif
#
AM_CPPFLAGS = -I$(top_srcdir)/src
AM_FCFLAGS = $(FPP_INCOPT)$(top_srcdir)/src $(FC_MOD_FLAG)../src
LDADD = $(top_builddir)/src/libcdi.la
#
cdi_write_SOURCES = cdi_write.c
cdi_write_LDADD = $(top_builddir)/src/libcdi.la
#
cdi_write_ens_SOURCES = cdi_write_ens.c
cdi_write_ens_LDADD = $(top_builddir)/src/libcdi.la
#
cdi_write_const_SOURCES = cdi_write_const.c
#
cdi_write_hybrid_SOURCES = cdi_write_hybrid.c
cdi_write_hybrid_LDADD = $(top_builddir)/src/libcdi.la
#
cdi_read_SOURCES = cdi_read.c
cdi_read_LDADD = $(top_builddir)/src/libcdi.la
#
cdi_copy_SOURCES = cdi_copy.c
cdi_copy_LDADD = $(top_builddir)/src/libcdi.la
#
cdi_read_f2003_SOURCES = cdi_read_f2003.f90
cdi_read_f2003_LDADD = $(top_builddir)/src/libcdi.la $(top_builddir)/src/mo_cdi.o
cdi_read_f2003_LDADD = $(top_builddir)/src/mo_cdi.o $(top_builddir)/src/libcdi.la
cdi_read_f2003.$(OBJEXT): $(top_builddir)/src/mo_cdi.$(FCMODEXT)
#
cdi_write_f2003_SOURCES = cdi_write_f2003.f90
cdi_write_f2003_LDADD = $(top_builddir)/src/libcdi.la $(top_builddir)/src/mo_cdi.$(OBJEXT)
cdi_write_f2003_LDADD = $(top_builddir)/src/mo_cdi.$(OBJEXT) $(top_builddir)/src/libcdi.la
cdi_write_f2003.$(OBJEXT): $(top_builddir)/src/mo_cdi.$(FCMODEXT)
#
......
......@@ -80,8 +80,9 @@ build_triplet = @build@
host_triplet = @host@
noinst_PROGRAMS = cdi_write$(EXEEXT) cdi_write_ens$(EXEEXT) \
cdi_write_hybrid$(EXEEXT) cdi_read$(EXEEXT) cdi_copy$(EXEEXT) \
$(am__EXEEXT_1)
$(am__EXEEXT_1) $(am__EXEEXT_2)
@CREATE_ISOC_TRUE@am__append_1 = cdi_read_f2003 cdi_write_f2003
@ENABLE_NETCDF_TRUE@am__append_2 = cdi_write_const
subdir = examples
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/config/mkinstalldirs \
......@@ -123,9 +124,11 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
@CREATE_ISOC_TRUE@am__EXEEXT_1 = cdi_read_f2003$(EXEEXT) \
@CREATE_ISOC_TRUE@ cdi_write_f2003$(EXEEXT)
@ENABLE_NETCDF_TRUE@am__EXEEXT_2 = cdi_write_const$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
am_cdi_copy_OBJECTS = cdi_copy.$(OBJEXT)
cdi_copy_OBJECTS = $(am_cdi_copy_OBJECTS)
cdi_copy_LDADD = $(LDADD)
cdi_copy_DEPENDENCIES = $(top_builddir)/src/libcdi.la
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
......@@ -136,37 +139,45 @@ cdi_copy_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(cdi_copy_LDFLAGS) $(LDFLAGS) -o $@
am_cdi_read_OBJECTS = cdi_read.$(OBJEXT)
cdi_read_OBJECTS = $(am_cdi_read_OBJECTS)
cdi_read_LDADD = $(LDADD)
cdi_read_DEPENDENCIES = $(top_builddir)/src/libcdi.la
cdi_read_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(cdi_read_LDFLAGS) $(LDFLAGS) -o $@
am_cdi_read_f2003_OBJECTS = cdi_read_f2003.$(OBJEXT)
cdi_read_f2003_OBJECTS = $(am_cdi_read_f2003_OBJECTS)
cdi_read_f2003_DEPENDENCIES = $(top_builddir)/src/libcdi.la \
$(top_builddir)/src/mo_cdi.o
cdi_read_f2003_DEPENDENCIES = $(top_builddir)/src/mo_cdi.o \
$(top_builddir)/src/libcdi.la
cdi_read_f2003_LINK = $(LIBTOOL) $(AM_V_lt) --tag=FC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(FCLD) \
$(AM_FCFLAGS) $(FCFLAGS) $(cdi_read_f2003_LDFLAGS) $(LDFLAGS) \
-o $@
am_cdi_write_OBJECTS = cdi_write.$(OBJEXT)
cdi_write_OBJECTS = $(am_cdi_write_OBJECTS)
cdi_write_LDADD = $(LDADD)
cdi_write_DEPENDENCIES = $(top_builddir)/src/libcdi.la
cdi_write_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(cdi_write_LDFLAGS) $(LDFLAGS) -o $@
am_cdi_write_const_OBJECTS = cdi_write_const.$(OBJEXT)
cdi_write_const_OBJECTS = $(am_cdi_write_const_OBJECTS)
cdi_write_const_LDADD = $(LDADD)
cdi_write_const_DEPENDENCIES = $(top_builddir)/src/libcdi.la
am_cdi_write_ens_OBJECTS = cdi_write_ens.$(OBJEXT)
cdi_write_ens_OBJECTS = $(am_cdi_write_ens_OBJECTS)
cdi_write_ens_LDADD = $(LDADD)
cdi_write_ens_DEPENDENCIES = $(top_builddir)/src/libcdi.la
am_cdi_write_f2003_OBJECTS = cdi_write_f2003.$(OBJEXT)
cdi_write_f2003_OBJECTS = $(am_cdi_write_f2003_OBJECTS)
cdi_write_f2003_DEPENDENCIES = $(top_builddir)/src/libcdi.la \
$(top_builddir)/src/mo_cdi.$(OBJEXT)
cdi_write_f2003_DEPENDENCIES = $(top_builddir)/src/mo_cdi.$(OBJEXT) \
$(top_builddir)/src/libcdi.la
cdi_write_f2003_LINK = $(LIBTOOL) $(AM_V_lt) --tag=FC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(FCLD) \
$(AM_FCFLAGS) $(FCFLAGS) $(cdi_write_f2003_LDFLAGS) $(LDFLAGS) \
-o $@
am_cdi_write_hybrid_OBJECTS = cdi_write_hybrid.$(OBJEXT)
cdi_write_hybrid_OBJECTS = $(am_cdi_write_hybrid_OBJECTS)
cdi_write_hybrid_LDADD = $(LDADD)
cdi_write_hybrid_DEPENDENCIES = $(top_builddir)/src/libcdi.la
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
......@@ -219,12 +230,12 @@ am__v_FCLD_0 = @echo " FCLD " $@;
am__v_FCLD_1 =
SOURCES = $(cdi_copy_SOURCES) $(cdi_read_SOURCES) \
$(cdi_read_f2003_SOURCES) $(cdi_write_SOURCES) \
$(cdi_write_ens_SOURCES) $(cdi_write_f2003_SOURCES) \
$(cdi_write_hybrid_SOURCES)
$(cdi_write_const_SOURCES) $(cdi_write_ens_SOURCES) \
$(cdi_write_f2003_SOURCES) $(cdi_write_hybrid_SOURCES)
DIST_SOURCES = $(cdi_copy_SOURCES) $(cdi_read_SOURCES) \
$(cdi_read_f2003_SOURCES) $(cdi_write_SOURCES) \
$(cdi_write_ens_SOURCES) $(cdi_write_f2003_SOURCES) \
$(cdi_write_hybrid_SOURCES)
$(cdi_write_const_SOURCES) $(cdi_write_ens_SOURCES) \
$(cdi_write_f2003_SOURCES) $(cdi_write_hybrid_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
......@@ -440,27 +451,25 @@ EXTRA_DIST = cdi_read_f2003.f90 cdi_write_f2003.f90
#
AM_CPPFLAGS = -I$(top_srcdir)/src
AM_FCFLAGS = $(FPP_INCOPT)$(top_srcdir)/src $(FC_MOD_FLAG)../src
LDADD = $(top_builddir)/src/libcdi.la
#
cdi_write_SOURCES = cdi_write.c
cdi_write_LDADD = $(top_builddir)/src/libcdi.la
#
cdi_write_ens_SOURCES = cdi_write_ens.c
cdi_write_ens_LDADD = $(top_builddir)/src/libcdi.la
#
cdi_write_const_SOURCES = cdi_write_const.c
#
cdi_write_hybrid_SOURCES = cdi_write_hybrid.c
cdi_write_hybrid_LDADD = $(top_builddir)/src/libcdi.la
#
cdi_read_SOURCES = cdi_read.c
cdi_read_LDADD = $(top_builddir)/src/libcdi.la
#
cdi_copy_SOURCES = cdi_copy.c
cdi_copy_LDADD = $(top_builddir)/src/libcdi.la
#
cdi_read_f2003_SOURCES = cdi_read_f2003.f90
cdi_read_f2003_LDADD = $(top_builddir)/src/libcdi.la $(top_builddir)/src/mo_cdi.o
cdi_read_f2003_LDADD = $(top_builddir)/src/mo_cdi.o $(top_builddir)/src/libcdi.la
#
cdi_write_f2003_SOURCES = cdi_write_f2003.f90
cdi_write_f2003_LDADD = $(top_builddir)/src/libcdi.la $(top_builddir)/src/mo_cdi.$(OBJEXT)
cdi_write_f2003_LDADD = $(top_builddir)/src/mo_cdi.$(OBJEXT) $(top_builddir)/src/libcdi.la
#
@ENABLE_ALL_STATIC_TRUE@cdi_write_LDFLAGS = -all-static
......@@ -528,6 +537,10 @@ cdi_write$(EXEEXT): $(cdi_write_OBJECTS) $(cdi_write_DEPENDENCIES) $(EXTRA_cdi_w
@rm -f cdi_write$(EXEEXT)
$(AM_V_CCLD)$(cdi_write_LINK) $(cdi_write_OBJECTS) $(cdi_write_LDADD) $(LIBS)
cdi_write_const$(EXEEXT): $(cdi_write_const_OBJECTS) $(cdi_write_const_DEPENDENCIES) $(EXTRA_cdi_write_const_DEPENDENCIES)
@rm -f cdi_write_const$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(cdi_write_const_OBJECTS) $(cdi_write_const_LDADD) $(LIBS)
cdi_write_ens$(EXEEXT): $(cdi_write_ens_OBJECTS) $(cdi_write_ens_DEPENDENCIES) $(EXTRA_cdi_write_ens_DEPENDENCIES)
@rm -f cdi_write_ens$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(cdi_write_ens_OBJECTS) $(cdi_write_ens_LDADD) $(LIBS)
......@@ -549,6 +562,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_copy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_read.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_write.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_write_const.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_write_ens.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_write_hybrid.Po@am__quote@
......
......@@ -11,7 +11,7 @@ TESTS = cksum_verify \
pio_cksum_mpi_fw_at_all \
pio_cksum_mpi_fw_at_reblock \
test_resource_copy pio_write_deco2d_run \
test_f2003 test_cdf_transformation \
test_f2003 test_cdf_transformation test_cdf_const \
test_table test_byteswap
check_PROGRAMS = cksum_verify test_grib cksum_write cksum_read pio_write \
......
......@@ -84,7 +84,7 @@ TESTS = cksum_verify$(EXEEXT) test_cksum_grib test_cksum_nc \
pio_cksum_writer pio_cksum_cdf pio_cksum_mpi_fw_ordered \
pio_cksum_mpi_fw_at_all pio_cksum_mpi_fw_at_reblock \
test_resource_copy$(EXEEXT) pio_write_deco2d_run test_f2003 \
test_cdf_transformation test_table$(EXEEXT) \
test_cdf_transformation test_cdf_const test_table$(EXEEXT) \
test_byteswap$(EXEEXT) $(am__append_2)
check_PROGRAMS = cksum_verify$(EXEEXT) test_grib$(EXEEXT) \
cksum_write$(EXEEXT) cksum_read$(EXEEXT) pio_write$(EXEEXT) \
......@@ -111,7 +111,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/pio_cksum_writer.in $(srcdir)/pio_cksum_cdf.in \
$(srcdir)/test_resource_copy_mpi_run.in \
$(srcdir)/test_cdf_transformation.in \
$(top_srcdir)/config/depcomp
$(srcdir)/test_cdf_const.in $(top_srcdir)/config/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = \
$(top_srcdir)/m4/acx_assert_lang_is_fortran_variant.m4 \
......@@ -152,7 +152,7 @@ CONFIG_CLEAN_FILES = test_cksum_grib test_cksum_nc test_cksum_nc2 \
pio_cksum_mpi_fw_ordered pio_cksum_mpi_fw_at_all \
pio_cksum_mpi_fw_at_reblock pio_cksum_fpguard pio_cksum_asynch \
pio_cksum_writer pio_cksum_cdf test_resource_copy_mpi_run \
test_cdf_transformation
test_cdf_transformation test_cdf_const
CONFIG_CLEAN_VPATH_FILES =
@ENABLE_NETCDF_TRUE@am__EXEEXT_1 = test_cdf_write$(EXEEXT) \
@ENABLE_NETCDF_TRUE@ test_cdf_read$(EXEEXT)
......@@ -629,6 +629,8 @@ test_resource_copy_mpi_run: $(top_builddir)/config.status $(srcdir)/test_resourc
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
test_cdf_transformation: $(top_builddir)/config.status $(srcdir)/test_cdf_transformation.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
test_cdf_const: $(top_builddir)/config.status $(srcdir)/test_cdf_const.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
......
#! @SHELL@
set -e
if [ @ENABLE_NETCDF@ = yes ]; then
exec >test_cdf_const.log 2>&1
mkdir -p test_cdf_const.d
cd test_cdf_const.d
\rm -f *
@abs_top_builddir@/examples/cdi_write_const
( @abs_top_builddir@/app/cdi -s example_const.nc \
&& @abs_top_builddir@/app/cdi example_const.nc) >cdi.$$.stdout 2>cdi.$$.stderr
echo "$0"
exec 6<cdi.$$.stdout 7<../"$0"
while read pattern <&7 ; do
[ "$pattern" != "#PATTERNS" ] || break
done
saved_IFS=$IFS
IFS=''
while read line <&6 ; do
read pattern <&7
pattern=`echo "$pattern" | sed -e 's/^#//'`
echo "$line" | grep "$pattern"
done
if [ -s cdi.$$.stderr ]; then
echo "unexpected error message from @abs_top_builddir@/app/cdi:"
cat cdi.$$.stderr
fi
read pattern <&7
[ "$pattern" = '#END PATTERNS' ]
exec 5<&- 6<&-
\rm cdi.$$.stdout cdi.$$.stderr example_const.nc
cd ..
rmdir test_cdf_const.d
\rm test_cdf_const.log
else
# skip tests for unsupported formats
exit 77
fi
#PATTERNS
#^ File format : NetCDF
#^ Var : Institut Source Ttype Levels Num Gridsize Num Dtype : Parameter ID
#^ 1 : unknown unknown constant 1 1 72 1 F32 : -1
#^ 2 : unknown unknown constant 5 2 72 1 F32 : -2
#^ Grid coordinates :
#^ 1 : lonlat : points=72 (12x6)
#^ lon : 0 to 330 by 30 degrees_east circular
#^ lat : -75 to 75 by 30 degrees_north
#^ Vertical coordinates :
#^ 1 : surface : levels=1
#^ 2 : pressure : levels=5
#^ plev : 101300 to 20000 Pa
#^ Rec : Date Time Level Gridsize Miss : Minimum Mean Maximum : Parameter ID
#^ 1 : 0000-00-00 00:00:00 0 72 0 : 1.1000 1.1000 1.1000 : -1
#^ 2 : 0000-00-00 00:00:00 101300 72 0 : 2.2000 2.2000 2.2000 : -2
#^ 3 : 0000-00-00 00:00:00 92500 72 0 : 2.2000 2.2000 2.2000 : -2
#^ 4 : 0000-00-00 00:00:00 85000 72 0 : 2.2000 2.2000 2.2000 : -2
#^ 5 : 0000-00-00 00:00:00 50000 72 0 : 2.2000 2.2000 2.2000 : -2
#^ 6 : 0000-00-00 00:00:00 20000 72 0 : 2.2000 2.2000 2.2000 : -2
#END PATTERNS
#
# Local Variables:
# mode: sh
# End:
#
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment