Skip to content
Snippets Groups Projects
Commit 2c5272f4 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Merge develop

parents ce2b1202 f91a8f01
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ check-gcc112:
- . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
script:
- module load gcc/11.2.0-gcc-11.2.0
- cd gcc112 && make check
- cd gcc112 && make -j 12 check
artifacts:
paths:
- gcc112/test/test-suite.log
......@@ -57,7 +57,7 @@ build-intel22:
- autoreconf -vfi --no-recursive
script:
- module load gcc/11.2.0-gcc-11.2.0 intel-oneapi-compilers/2022.0.1-gcc-11.2.0
- mkdir intel22 && cd intel22 && ../configure --prefix=/home/k/k202125/local --with-eccodes=/sw/spack-levante/eccodes-2.21.0-4ywkk4 --with-netcdf=/sw/spack-levante/netcdf-c-4.8.1-qk24yp --with-hdf5=/sw/spack-levante/hdf5-1.12.1-akf2kp --with-udunits2=/sw/spack-levante/udunits-2.2.28-da6pla --with-fftw3 --with-szlib=/sw/spack-levante/libaec-1.0.5-r5sdw5 --with-curl --with-ossp-uuid --with-libxml2 --with-proj=/sw/spack-levante/proj-8.1.0-i6a6ah --with-magics=/sw/spack-levante/magics-4.9.3-z64bdu LIBS='-lm -lstdc++' LDFLAGS='-L/sw/spack-levante/eccodes-2.21.0-4ywkk4/lib64 -Wl,-rpath,/sw/spack-levante/eccodes-2.21.0-4ywkk4/lib64 -L/sw/spack-levante/magics-4.9.3-z64bdu/lib64 -Wl,-rpath,/sw/spack-levante/magics-4.9.3-z64bdu/lib64 -L/sw/spack-levante/libaec-1.0.5-r5sdw5/lib64 -Wl,-rpath,/sw/spack-levante/libaec-1.0.5-r5sdw5/lib64 -Wl,-rpath,/sw/spack-levante/netcdf-c-4.8.1-qk24yp/lib -Wl,-rpath,/sw/spack-levante/hdf5-1.12.1-akf2kp/lib -Wl,-rpath,/sw/spack-levante/udunits-2.2.28-da6pla/lib -Wl,-rpath,/sw/spack-levante/proj-8.1.0-i6a6ah/lib -L/sw/spack-levante/fftw-3.3.10-fnfhvr/lib -Wl,-rpath,/sw/spack-levante/fftw-3.3.10-fnfhvr/lib -L/sw/spack-levante/gcc-11.2.0-bcn7mb/lib64 -Wl,-rpath,/sw/spack-levante/gcc-11.2.0-bcn7mb/lib64' F77=ifort FFLAGS="-g -O2" CXX=icpc CXXFLAGS="-g -Wall -O2 -march=core-avx2 -I/sw/spack-levante/fftw-3.3.10-fnfhvr/include" CC=icc CFLAGS="-g -Wall -O2 -march=core-avx2"
- mkdir intel22 && cd intel22 && ../configure --prefix=/home/k/k202125/local --with-eccodes=/sw/spack-levante/eccodes-2.21.0-4ywkk4 --with-netcdf=/sw/spack-levante/netcdf-c-4.8.1-qk24yp --with-hdf5=/sw/spack-levante/hdf5-1.12.1-akf2kp --with-udunits2=/sw/spack-levante/udunits-2.2.28-da6pla --with-fftw3 --with-szlib=/sw/spack-levante/libaec-1.0.5-r5sdw5 --with-curl --with-ossp-uuid --with-libxml2 --with-proj=/sw/spack-levante/proj-8.1.0-i6a6ah --with-magics=/sw/spack-levante/magics-4.9.3-z64bdu LIBS='-lm -lstdc++' LDFLAGS='-L/sw/spack-levante/eccodes-2.21.0-4ywkk4/lib64 -Wl,-rpath,/sw/spack-levante/eccodes-2.21.0-4ywkk4/lib64 -L/sw/spack-levante/magics-4.9.3-z64bdu/lib64 -Wl,-rpath,/sw/spack-levante/magics-4.9.3-z64bdu/lib64 -L/sw/spack-levante/libaec-1.0.5-r5sdw5/lib64 -Wl,-rpath,/sw/spack-levante/libaec-1.0.5-r5sdw5/lib64 -Wl,-rpath,/sw/spack-levante/netcdf-c-4.8.1-qk24yp/lib -Wl,-rpath,/sw/spack-levante/hdf5-1.12.1-akf2kp/lib -Wl,-rpath,/sw/spack-levante/udunits-2.2.28-da6pla/lib -Wl,-rpath,/sw/spack-levante/proj-8.1.0-i6a6ah/lib -L/sw/spack-levante/fftw-3.3.10-fnfhvr/lib -Wl,-rpath,/sw/spack-levante/fftw-3.3.10-fnfhvr/lib -L/sw/spack-levante/gcc-11.2.0-bcn7mb/lib64 -Wl,-rpath,/sw/spack-levante/gcc-11.2.0-bcn7mb/lib64 -Wl,-rpath,/sw/spack-levante/intel-oneapi-compilers-2022.0.1-an2cbq/compiler/2022.0.1/linux/compiler/lib/intel64' F77=ifx FFLAGS="-g -O2" CXX=icpx CXXFLAGS="-g -Wall -O2 -I/sw/spack-levante/fftw-3.3.10-fnfhvr/include" CC=icx CFLAGS="-g -Wall -O2"
- make -j 12
artifacts:
paths:
......@@ -79,7 +79,7 @@ check-intel22:
- . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
script:
- module load gcc/11.2.0-gcc-11.2.0 intel-oneapi-compilers/2022.0.1-gcc-11.2.0
- cd intel22 && make check
- cd intel22 && make -j 12 check
artifacts:
paths:
- intel22/test/test-suite.log
......
2023-11-29 Uwe Schulzweida
* Using CDI library version 2.3.1
* Version 2.3.1 release
2023-10-28 Uwe Schulzweida
* Remapweights: Use environment variable REMAP_MAP3D=1 to generate all mapfiles of the first 3D field with variing masks
2023-10-27 Uwe Schulzweida
* varsvar, varsstd: failed on 3D data without missing values
2023-10-21 Uwe Schulzweida
* Using CDI library version 2.3
* Version 2.3 release
* Using CDI library version 2.3.0
* Version 2.3.0 release
2023-10-13 Uwe Schulzweida
......
......@@ -3,6 +3,18 @@ CDO NEWS
Improvement
Version 2.4.0 (21 October 2024):
New features:
* Remapweights: Use environment variable REMAP_MAP3D=1 to generate all mapfiles of the first 3D field with variing masks
New operators:
Fixed bugs:
Version 2.3.1 (29 November 2023):
Fixed bugs:
* varsvar, varsstd: failed on 3D data without missing values
Version 2.3.0 (21 October 2023):
New features:
......
......@@ -580,8 +580,6 @@ Operator catalog:
Remapdis gendis Generate distance weighted average remap weights
Remapcon remapcon First order conservative remapping
Remapcon gencon Generate 1st order conservative remap weights
Remapcon2 remapcon2 Second order conservative remapping
Remapcon2 gencon2 Generate 2nd order conservative remap weights
Remaplaf remaplaf Largest area fraction remapping
Remaplaf genlaf Generate largest area fraction remap weights
Remap remap Grid remapping
......
......@@ -355,7 +355,6 @@ case "${HOSTNAME}" in
;;
# levante
levante*)
INTELONEAPI=/sw/spack-levante/intel-oneapi-compilers-2022.0.1-an2cbq/compiler/2022.0.1/linux
NETCDFPATH=/sw/spack-levante/netcdf-c-4.8.1-qk24yp
HDF5PATH=/sw/spack-levante/hdf5-1.12.1-akf2kp
UDUNITS2PATH=/sw/spack-levante/udunits-2.2.28-da6pla
......@@ -382,23 +381,25 @@ case "${HOSTNAME}" in
LDFLAGS="$LDFLAGS -Wl,-rpath,$HDF5PATH/lib"
LDFLAGS="$LDFLAGS -Wl,-rpath,$UDUNITS2PATH/lib"
# LDFLAGS="$LDFLAGS -Wl,-rpath,$PROJPATH/lib"
LDFLAGS="$LDFLAGS -Wl,-rpath,$INTELONEAPI/compiler/lib/intel64"
LDFLAGS="$LDFLAGS -L$FFTW3PATH/lib -Wl,-rpath,$FFTW3PATH/lib"
LDFLAGS="$LDFLAGS -Wl,-rpath,/sw/spack-levante/gcc-11.2.0-bcn7mb/lib64"
if test "$COMP" = intel ; then
INTELONEAPI=/sw/spack-levante/intel-oneapi-compilers-2022.0.1-an2cbq/compiler/2022.0.1/linux
LDFLAGS="$LDFLAGS -Wl,-rpath,$INTELONEAPI/compiler/lib/intel64"
${CONFPATH}configure --prefix=$HOME/local \
$CDOLIBS \
LDFLAGS="$LDFLAGS" \
F77=ifx FFLAGS="-g -O2" \
CXX=icpx CXXFLAGS="-g -Wall -O2 -march=core-avx2 -I${FFTW3PATH}/include" \
CXX=icpx CXXFLAGS="-g -Wall -O2 -I${FFTW3PATH}/include" \
CC=icx CFLAGS="-g -Wall -O2"
elif test "$COMP" = pgi ; then
${CONFPATH}configure --without-fortran \
${CONFPATH}configure --disable-fortran --disable-openmp \
$CDOLIBS \
LDFLAGS="$LDFLAGS -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lnspgc -lpgc -lrt -lm -lgcc -lc -lgcc" \
LDFLAGS="$LDFLAGS -lpgc -lrt -lm -lgcc -lc -lgcc" \
F77=pgf90 \
CXX=pgc++ CXXFLAGS="-g -fast -D_REENTRANT -I${FFTW3PATH}/include" \
CC=pgcc CFLAGS="-g -fast -D_REENTRANT"
CXX=pgc++ CXXFLAGS="-g -O2 -D_REENTRANT -I${FFTW3PATH}/include" \
CC=pgcc CFLAGS="-g -O2 -D_REENTRANT"
elif test "$COMP" = clang ; then
${CONFPATH}configure --disable-fortran \
$CDOLIBS LIBS="-lm" \
......
......@@ -5,7 +5,7 @@
# libtool 2.4.2
AC_PREREQ([2.69])
AC_INIT([cdo],[2.3.0],[https://mpimet.mpg.de/cdo])
AC_INIT([cdo],[2.3.1],[https://mpimet.mpg.de/cdo])
AC_DEFINE_UNQUOTED(CDO, ["$PACKAGE_VERSION"], [CDO version])
......@@ -42,7 +42,7 @@ AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_F77
AC_C_RESTRICT
AX_CXX_COMPILE_STDCXX(17)
AX_CXX_COMPILE_STDCXX(20)
AC_OPENMP
AC_CHECK_TOOL([AR],[ar],[:])
AC_CHECK_TOOL([CPP],[cpp],[:])
......@@ -91,7 +91,7 @@ case "$CXX" in
*gcc*) CXX_VERSION=`$CXX --version | head -n 1`;;
*g++*) CXX_VERSION=`$CXX --version | head -n 1`;;
*clang*) CXX_VERSION=`$CXX --version | head -n 1`;;
*icpc*) CXX_VERSION=`$CXX --version | head -n 1`;;
*icp*) CXX_VERSION=`$CXX --version | head -n 1`;;
*sxc*) CXX_VERSION=`$CXX -V 2>&1 | tail -n 1`;;
*xlc*) CXX_VERSION=`$CXX -qversion 2>&1 | head -n 1`;;
*) CXX_VERSION=`$CXX -V 2>&1 | head -n 1 | grep -v error`;;
......@@ -102,7 +102,7 @@ case "$CC" in
*gcc*) C_VERSION=`$CC --version | head -n 1`;;
*g++*) C_VERSION=`$CC --version | head -n 1`;;
*clang*) C_VERSION=`$CC --version | head -n 1`;;
*icc*) C_VERSION=`$CC --version | head -n 1`;;
*ic*) C_VERSION=`$CC --version | head -n 1`;;
*sxc*) C_VERSION=`$CC -V 2>&1 | tail -n 1`;;
*xlc*) C_VERSION=`$CC -qversion 2>&1 | head -n 1`;;
*) C_VERSION=`$CC -V 2>&1 | head -n 1 | grep -v error`;;
......@@ -112,7 +112,7 @@ if test -n "$F77" ; then
case "$F77" in
*pgf*) F77_VERSION=`$F77 -V | head -2 | tail -n 1`;;
*gfortran*) F77_VERSION=`$F77 --version | head -n 1`;;
*ifort*) F77_VERSION=`$F77 --version | head -n 1`;;
*if*) F77_VERSION=`$F77 --version | head -n 1`;;
*f77*) F77_VERSION=`$F77 --version | head -n 1`;;
*) F77_VERSION=`$F77 -V 2>&1 | head -n 1 | grep -v error`;;
esac
......
......@@ -124,7 +124,6 @@ Remapbic Interpolation
Remapnn Interpolation
Remapdis Interpolation
Remapcon Interpolation
Remapcon2 Interpolation
Remaplaf Interpolation
Remap Interpolation
Remapeta Interpolation
......
......@@ -206,7 +206,7 @@ keepaspectratio]{cdo_libdep.pdf}}%
\end{picture}
\begin{flushright}
\large \textbf{Climate Data Operator \\ Version 2.3.0 \\ October 2023}
\large \textbf{Climate Data Operator \\ Version 2.3.1 \\ November 2023}
\end{flushright}
\vfill
......
......@@ -14,7 +14,7 @@
\put(0,0.0){\line(1,0){3.95}}
\end{picture}
\begin{flushright}
{\small{Climate Data Operator \\ Version 2.3.0 \\ October 2023}}
{\small{Climate Data Operator \\ Version 2.3.1 \\ November 2023}}
\end{flushright}
\vspace*{0mm}
......
......@@ -43,12 +43,14 @@ Performs a bicubic interpolation on all input fields.
@BeginOperator_genbic
@Name = genbic
@Title = Generate bicubic interpolation weights
@Parameter = grid
@Parameter = grid [map3d]
@BeginDescription
Generates bicubic interpolation weights for the first input field and writes the
result to a file. The format of this file is NetCDF following the SCRIP convention.
Use the operator @mod{remap} to apply this remapping weights to a data file with the same source grid.
Set the parameter @env{map3d=true} to generate all mapfiles of the first 3D field with variing masks.
In this case the mapfiles will be named <outfile><xxx>.nc. xxx will have five digits with the number of the mapfile.
@EndDescription
@EndOperator
......@@ -56,6 +58,8 @@ Use the operator @mod{remap} to apply this remapping weights to a data file with
@BeginParameter
@Item = grid
STRING Target grid description file or name
@Item = map3d
BOOL Generate all mapfiles of the first 3D field
@EndParameter
......
......@@ -43,12 +43,14 @@ Performs a bilinear interpolation on all input fields.
@BeginOperator_genbil
@Name = genbil
@Title = Generate bilinear interpolation weights
@Parameter = grid
@Parameter = grid [map3d]
@BeginDescription
Generates bilinear interpolation weights for the first input field and writes the
result to a file. The format of this file is NetCDF following the SCRIP convention.
Use the operator @mod{remap} to apply this remapping weights to a data file with the same source grid.
Set the parameter @env{map3d=true} to generate all mapfiles of the first 3D field with variing masks.
In this case the mapfiles will be named <outfile><xxx>.nc. xxx will have five digits with the number of the mapfile.
@EndDescription
@EndOperator
......@@ -56,6 +58,8 @@ Use the operator @mod{remap} to apply this remapping weights to a data file with
@BeginParameter
@Item = grid
STRING Target grid description file or name
@Item = map3d
BOOL Generate all mapfiles of the first 3D field
@EndParameter
......
......@@ -44,12 +44,14 @@ Performs a first order conservative remapping on all input fields.
@BeginOperator_gencon
@Name = gencon
@Title = Generate 1st order conservative remap weights
@Parameter = grid
@Parameter = grid [map3d]
@BeginDescription
Generates first order conservative remapping weights for the first input field and
writes the result to a file. The format of this file is NetCDF following the SCRIP convention.
Use the operator @mod{remap} to apply this remapping weights to a data file with the same source grid.
Set the parameter @env{map3d=true} to generate all mapfiles of the first 3D field with variing masks.
In this case the mapfiles will be named <outfile><xxx>.nc. xxx will have five digits with the number of the mapfile.
@EndDescription
@EndOperator
......@@ -57,6 +59,8 @@ Use the operator @mod{remap} to apply this remapping weights to a data file with
@BeginParameter
@Item = grid
STRING Target grid description file or name
@Item = map3d
BOOL Generate all mapfiles of the first 3D field
@EndParameter
......
......@@ -42,12 +42,14 @@ Performs an inverse distance weighted averaged remapping of the nearest neighbor
@BeginOperator_gendis
@Name = gendis
@Title = Generate distance weighted average remap weights
@Parameter = grid [neighbors]
@Parameter = grid [neighbors] [map3d]
@BeginDescription
Generates distance weighted averaged remapping weights of the nearest neighbor values for the first input
field and writes the result to a file. The format of this file is NetCDF following the SCRIP convention.
Use the operator @mod{remap} to apply this remapping weights to a data file with the same source grid.
Set the parameter @env{map3d=true} to generate all mapfiles of the first 3D field with variing masks.
In this case the mapfiles will be named <outfile><xxx>.nc. xxx will have five digits with the number of the mapfile.
@EndDescription
@EndOperator
......@@ -57,6 +59,8 @@ Use the operator @mod{remap} to apply this remapping weights to a data file with
STRING Target grid description file or name
@Item = neighbors
INTEGER Number of nearest neighbors [default: 4]
@Item = map3d
BOOL Generate all mapfiles of the first 3D field
@EndParameter
......
......@@ -41,12 +41,14 @@ Performs a nearest neighbor remapping on all input fields.
@BeginOperator_gennn
@Name = gennn
@Title = Generate nearest neighbor remap weights
@Parameter = grid
@Parameter = grid [map3d]
@BeginDescription
Generates nearest neighbor remapping weights for the first input field and writes the result to a file.
The format of this file is NetCDF following the SCRIP convention.
Use the operator @mod{remap} to apply this remapping weights to a data file with the same source grid.
Set the parameter @env{map3d=true} to generate all mapfiles of the first 3D field with variing masks.
In this case the mapfiles will be named <outfile><xxx>.nc. xxx will have five digits with the number of the mapfile.
@EndDescription
@EndOperator
......@@ -54,6 +56,8 @@ Use the operator @mod{remap} to apply this remapping weights to a data file with
@BeginParameter
@Item = grid
STRING Target grid description file or name
@Item = map3d
BOOL Generate all mapfiles of the first 3D field
@EndParameter
......
Subproject commit e890330ebfcf84fbc95a6ab932302459314ca695
Subproject commit 395ab6995d195c9bd5f7f7d33d08b1da8f926806
......@@ -43,7 +43,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 14
#serial 18
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl (serial version number 13).
......@@ -104,9 +104,18 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
dnl HP's aCC needs +std=c++11 according to:
dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
dnl Cray's crayCC needs "-h std=c++11"
dnl MSVC needs -std:c++NN for C++17 and later (default is C++14)
for alternative in ${ax_cxx_compile_alternatives}; do
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do
if test x"$switch" = xMSVC; then
dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide
dnl with -std=c++17. We suffix the cache variable name with _MSVC to
dnl avoid this.
switch=-std:c++${alternative}
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_${switch}_MSVC])
else
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
fi
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXX="$CXX"
......@@ -189,7 +198,11 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
// MSVC always sets __cplusplus to 199711L in older versions; newer versions
// only set it correctly if /Zc:__cplusplus is specified as well as a
// /std:c++NN switch:
// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
#elif __cplusplus < 201103L && !defined _MSC_VER
#error "This is not a C++11 compiler"
......@@ -480,7 +493,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
#error "This is not a C++ compiler"
#elif __cplusplus < 201402L
#elif __cplusplus < 201402L && !defined _MSC_VER
#error "This is not a C++14 compiler"
......@@ -604,7 +617,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
#error "This is not a C++ compiler"
#elif __cplusplus < 201703L
#elif __cplusplus < 201703L && !defined _MSC_VER
#error "This is not a C++17 compiler"
......@@ -970,7 +983,7 @@ namespace cxx17
} // namespace cxx17
#endif // __cplusplus < 201703L
#endif // __cplusplus < 201703L && !defined _MSC_VER
]])
......@@ -983,7 +996,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[
#error "This is not a C++ compiler"
#elif __cplusplus < 202002L
#elif __cplusplus < 202002L && !defined _MSC_VER
#error "This is not a C++20 compiler"
......@@ -1000,6 +1013,6 @@ namespace cxx20
} // namespace cxx20
#endif // __cplusplus < 202002L
#endif // __cplusplus < 202002L && !defined _MSC_VER
]])
......@@ -32,7 +32,7 @@
// compute insitu temperature from potential temperature
static inline double
adisit(double tpot, double sal, double p)
adisit_kernel(double tpot, double sal, double p)
{
constexpr double a_a1 = 3.6504E-4, a_a2 = 8.3198E-5, a_a3 = 5.4065E-7, a_a4 = 4.0274E-9, a_b1 = 1.7439E-5, a_b2 = 2.9778E-7,
a_c1 = 8.9309E-7, a_c2 = 3.1628E-8, a_c3 = 2.1987E-10, a_d = 4.1057E-9, a_e1 = 1.6056E-10, a_e2 = 5.0484E-12;
......@@ -58,7 +58,7 @@ adisit(double tpot, double sal, double p)
// compute potential temperature from insitu temperature
// Ref: Gill, p. 602, Section A3.5:Potential Temperature
static inline double
adipot(double t, double s, double p)
adipot_kernel(double t, double s, double p)
{
constexpr double a_a1 = 3.6504E-4, a_a2 = 8.3198E-5, a_a3 = 5.4065E-7, a_a4 = 4.0274E-9, a_b1 = 1.7439E-5, a_b2 = 2.9778E-7,
a_c1 = 8.9309E-7, a_c2 = 3.1628E-8, a_c3 = 2.1987E-10, a_d = 4.1057E-9, a_e1 = 1.6056E-10, a_e2 = 5.0484E-12;
......@@ -95,7 +95,7 @@ calc_adisit(size_t gridsize, size_t nlevel, const Varray<double> &pressure, cons
for (size_t i = 0; i < gridsize; ++i)
{
auto isMissing = (dbl_is_equal(thovec[i], thoMissval) || dbl_is_equal(saovec[i], saoMissval));
tisvec[i] = isMissing ? tisMissval : adisit(thovec[i], saovec[i], pressure[levelID]);
tisvec[i] = isMissing ? tisMissval : adisit_kernel(thovec[i], saovec[i], pressure[levelID]);
}
}
}
......@@ -119,7 +119,7 @@ calc_adipot(size_t gridsize, size_t nlevel, const Varray<double> &pressure, cons
for (size_t i = 0; i < gridsize; ++i)
{
auto isMissing = (dbl_is_equal(tvec[i], tMissval) || dbl_is_equal(svec[i], sMissval));
tpotvec[i] = isMissing ? tpotMissval : adipot(tvec[i], svec[i], pressure[levelID]);
tpotvec[i] = isMissing ? tpotMissval : adipot_kernel(tvec[i], svec[i], pressure[levelID]);
}
}
}
......
......@@ -7,6 +7,7 @@
#include <cdi.h>
#include "arithmetic.h"
#include "process_int.h"
class ModuleComplextorect
......@@ -78,10 +79,10 @@ public:
array2 = Varray<double>(gridsizemax);
array3 = Varray<double>(gridsizemax);
}
void
run()
{
int tsID = 0;
while (true)
{
......@@ -106,6 +107,7 @@ public:
size_t nmiss;
cdo_read_record(streamID1, array1.data(), &nmiss);
auto is_EQ = dbl_is_equal;
auto missval1 = varList1[varID].missval;
auto missval2 = missval1;
......@@ -121,8 +123,8 @@ public:
{
for (size_t i = 0; i < gridsize; ++i)
{
array2[i] = SQRTMN(ADDMN(MULMN(array1[2 * i], array1[2 * i]), MULMN(array1[2 * i + 1], array1[2 * i + 1])));
array3[i] = (DBL_IS_EQUAL(array1[2 * i], missval1) || DBL_IS_EQUAL(array1[2 * i + 1], missval1))
array2[i] = SQRTM(ADDM(MULM(array1[2 * i], array1[2 * i]), MULM(array1[2 * i + 1], array1[2 * i + 1])));
array3[i] = (is_EQ(array1[2 * i], missval1) || is_EQ(array1[2 * i + 1], missval1))
? missval1
: std::atan2(array1[2 * i + 1], array1[2 * i]);
}
......@@ -135,6 +137,7 @@ public:
tsID++;
}
}
void
close()
{
......@@ -152,7 +155,6 @@ void *
Complextorect(void *process)
{
ModuleComplextorect complextorect;
complextorect.init(process);
complextorect.run();
complextorect.close();
......
......@@ -17,12 +17,11 @@
#include "cdo_vlist.h"
#include "progress.h"
#include "cdo_options.h"
#include "util_string.h"
bool
is_fdb_stream(const std::string &filename)
{
return (filename.size() >= 4 && string_starts_with(filename, "fdb:"));
return (filename.size() >= 4 && filename.starts_with("fdb:"));
}
bool
......
......@@ -59,18 +59,15 @@ public:
const std::string paramCountry = "country=";
const std::string paramDCW = "dcw:";
auto &param = cdo_operator_argv(0);
if (param == "path" || param == "dir")
dcw_print_path();
else if (param == "countries")
dcw_print_countries(dcw_lists);
else if (param == "states")
dcw_print_states(dcw_lists);
else if (string_starts_with(param, paramCountry))
print_polygons(dcw_lists, param.substr(paramCountry.size()));
else if (string_starts_with(param, paramDCW))
print_polygons(dcw_lists, param.substr(paramDCW.size()));
// clang-format off
if (param == "path" || param == "dir") dcw_print_path();
else if (param == "countries") dcw_print_countries(dcw_lists);
else if (param == "states") dcw_print_states(dcw_lists);
else if (param.starts_with(paramCountry)) print_polygons(dcw_lists, param.substr(paramCountry.size()));
else if (param.starts_with(paramDCW)) print_polygons(dcw_lists, param.substr(paramDCW.size()));
else
cdo_abort("Unsupported parameter: %s", param);
// clang-format on
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment