Commit 9521aced authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Gridcell.c: cleanup

parent 5d5d2b74
......@@ -27,7 +27,6 @@ contrib/cdoCompletion.bash -text
contrib/cdoCompletion.tcsh -text
contrib/cdoCompletion.zsh -text
contrib/makecompl.rb -text
doc/OpenMP -text
doc/cdo.pdf -text
doc/cdo_refcard.pdf -text
doc/tex/Modules -text
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.64 for cdo 1.4.6rc1.
# Generated by GNU Autoconf 2.64 for cdo 1.4.6rc2.
#
# Report bugs to <http://code.zmaw.de/projects/cdo>.
#
......@@ -549,8 +549,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='cdo'
PACKAGE_TARNAME='cdo'
PACKAGE_VERSION='1.4.6rc1'
PACKAGE_STRING='cdo 1.4.6rc1'
PACKAGE_VERSION='1.4.6rc2'
PACKAGE_STRING='cdo 1.4.6rc2'
PACKAGE_BUGREPORT='http://code.zmaw.de/projects/cdo'
PACKAGE_URL=''
......@@ -1316,7 +1316,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures cdo 1.4.6rc1 to adapt to many kinds of systems.
\`configure' configures cdo 1.4.6rc2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1386,7 +1386,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of cdo 1.4.6rc1:";;
short | recursive ) echo "Configuration of cdo 1.4.6rc2:";;
esac
cat <<\_ACEOF
......@@ -1578,7 +1578,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
cdo configure 1.4.6rc1
cdo configure 1.4.6rc2
generated by GNU Autoconf 2.64
Copyright (C) 2009 Free Software Foundation, Inc.
......@@ -2006,7 +2006,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by cdo $as_me 1.4.6rc1, which was
It was created by cdo $as_me 1.4.6rc2, which was
generated by GNU Autoconf 2.64. Invocation command line was
$ $0 $@
......@@ -2890,7 +2890,7 @@ fi
# Define the identity of the package.
PACKAGE='cdo'
VERSION='1.4.6rc1'
VERSION='1.4.6rc2'
cat >>confdefs.h <<_ACEOF
......@@ -9312,7 +9312,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by cdo $as_me 1.4.6rc1, which was
This file was extended by cdo $as_me 1.4.6rc2, which was
generated by GNU Autoconf 2.64. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -9376,7 +9376,7 @@ Report bugs to <http://code.zmaw.de/projects/cdo>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
cdo config.status 1.4.6rc1
cdo config.status 1.4.6rc2
configured by $0, generated by GNU Autoconf 2.64,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
......
# Process this file with autoconf to produce a configure script.
AC_INIT([cdo], [1.4.6rc1], [http://code.zmaw.de/projects/cdo])
AC_INIT([cdo], [1.4.6rc2], [http://code.zmaw.de/projects/cdo])
CONFIG_ABORT=yes
......
Module Operator Description
-----------------------------------------------------------
Detrend detrend Detrend
Ensstat ensmin Ensemble minimum
Ensstat ensmax Ensemble maximum
Ensstat enssum Ensemble sum
Ensstat ensmean Ensemble mean
Ensstat ensavg Ensemble average
Ensstat ensvar Ensemble variance
Ensstat ensstd Ensemble standard deviation
Ensstat enspctl Ensemble percentiles
Fourier fourier Fourier transformation
Gridboxstat gridboxmin Gridbox minimum
Gridboxstat gridboxmax Gridbox maximum
Gridboxstat gridboxsum Gridbox sum
Gridboxstat gridboxmean Gridbox mean
Gridboxstat gridboxavg Gridbox average
Gridboxstat gridboxvar Gridbox variance
Gridboxstat gridboxstd Gridbox standard deviation
Remapeta remapeta Remap vertical hybrid level
Remapgrid remapbil Bilinear interpolation
Remapgrid remapbic Bicubic interpolation
Remapgrid remapdis Distance-weighted average remapping
Remapgrid remapnn Nearest neighbor remapping
Remapgrid remapcon First order conservative remapping
Remapgrid remapcon2 Second order conservative remapping
Remapgrid remaplaf Largest area fraction remapping
......@@ -50,24 +50,27 @@ void *Gridcell(void *argument)
cdoInitialize(argument);
envstr = getenv("PLANET_RADIUS");
if ( envstr )
{
double fval;
fval = atof(envstr);
if ( fval > 0 )
{
PlanetRadius = fval;
if ( cdoVerbose )
cdoPrint("Set PlanetRadius to %g", PlanetRadius);
}
}
GRIDAREA = cdoOperatorAdd("gridarea", 0, 0, NULL);
GRIDWGTS = cdoOperatorAdd("gridweights", 0, 0, NULL);
operatorID = cdoOperatorID();
if ( operatorID == GRIDAREA || operatorID == GRIDWGTS )
{
envstr = getenv("PLANET_RADIUS");
if ( envstr )
{
double fval;
fval = atof(envstr);
if ( fval > 0 )
{
PlanetRadius = fval;
if ( cdoVerbose )
cdoPrint("Set PlanetRadius to %g", PlanetRadius);
}
}
}
streamID1 = streamOpenRead(cdoStreamName(0));
if ( streamID1 < 0 ) cdiError(streamID1, "Open failed on %s", cdoStreamName(0));
......@@ -120,20 +123,12 @@ void *Gridcell(void *argument)
if ( operatorID == GRIDAREA )
{
gridtype = gridInqType(gridID);
if ( gridtype != GRID_LONLAT &&
gridtype != GRID_GAUSSIAN &&
gridtype != GRID_LCC &&
gridtype != GRID_GME &&
gridtype != GRID_CURVILINEAR &&
gridtype != GRID_CELL )
{
if ( gridInqType(gridID) == GRID_GAUSSIAN_REDUCED )
cdoAbort("Unsupported grid type: %s, use CDO option -R to convert reduced to regular grid!",
gridNamePtr(gridtype));
else
cdoAbort("Unsupported grid type: %s", gridNamePtr(gridtype));
}
else
if ( gridtype == GRID_LONLAT ||
gridtype == GRID_GAUSSIAN ||
gridtype == GRID_LCC ||
gridtype == GRID_GME ||
gridtype == GRID_CURVILINEAR ||
gridtype == GRID_CELL )
{
if ( gridHasArea(gridID) )
{
......@@ -154,6 +149,14 @@ void *Gridcell(void *argument)
grid_area[i] *= PlanetRadius*PlanetRadius;
}
}
else
{
if ( gridtype == GRID_GAUSSIAN_REDUCED )
cdoAbort("Unsupported grid type: %s, use CDO option -R to convert reduced to regular grid!",
gridNamePtr(gridtype));
else
cdoAbort("Unsupported grid type: %s", gridNamePtr(gridtype));
}
pdata = grid_area;
}
......
......@@ -934,8 +934,7 @@ void remapGridInit(int map_type, int lextrapolate, int gridID1, int gridID2, rem
}
else
{
cdoWarning("Unknown units supplied for grid1 center lat/lon: "
"proceeding assuming radians");
cdoWarning("Unknown units supplied for grid1 center lat/lon: proceeding assuming radians");
}
if ( lgrid1_destroy ) gridDestroy(gridID1);
......@@ -996,8 +995,7 @@ void remapGridInit(int map_type, int lextrapolate, int gridID1, int gridID2, rem
}
else
{
cdoWarning("Unknown units supplied for grid2 center lat/lon: "
"proceeding assuming radians");
cdoWarning("Unknown units supplied for grid2 center lat/lon: proceeding assuming radians");
}
if ( lgrid2_destroy ) gridDestroy(gridID2);
......
Supports Markdown
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