Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
9e537bfe
Commit
9e537bfe
authored
Apr 08, 2015
by
Uwe Schulzweida
Browse files
added afterburnerlib.c
parent
d4e920eb
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
.gitattributes
View file @
9e537bfe
...
...
@@ -504,6 +504,8 @@ src/after_fctrans.c -text
src/after_sptrans.c -text
src/after_vertint.c -text
src/after_vertint.h -text
src/afterburner.h -text
src/afterburnerlib.c -text
src/cdo.c -text
src/cdo.h -text
src/cdo_getopt.c -text
...
...
src/Makefile.am
View file @
9e537bfe
...
...
@@ -13,6 +13,8 @@ libcdo_la_SOURCES = \
after_dvtrans.c
\
after_vertint.c
\
after_vertint.h
\
afterburnerlib.c
\
afterburner.h
\
constants.h
\
constants.c
\
color.c
\
...
...
src/Makefile.in
View file @
9e537bfe
...
...
@@ -120,15 +120,16 @@ am_libcdo_la_OBJECTS = libcdo_la-cdo_pthread.lo libcdo_la-cdo_vlist.lo \
libcdo_la-cdo_getopt.lo libcdo_la-cdo_history.lo \
libcdo_la-after_sptrans.lo libcdo_la-after_fctrans.lo \
libcdo_la-after_dvtrans.lo libcdo_la-after_vertint.lo \
libcdo_la-constants.lo libcdo_la-color.lo \
libcdo_la-commandline.lo libcdo_la-datetime.lo \
libcdo_la-ecacore.lo libcdo_la-ecautil.lo \
libcdo_la-exception.lo libcdo_la-expr.lo libcdo_la-expr_lex.lo \
libcdo_la-expr_yacc.lo libcdo_la-features.lo \
libcdo_la-field.lo libcdo_la-field2.lo libcdo_la-fieldc.lo \
libcdo_la-fieldmem.lo libcdo_la-fieldmer.lo \
libcdo_la-fieldzon.lo libcdo_la-gradsdeslib.lo \
libcdo_la-grid.lo libcdo_la-grid_area.lo libcdo_la-grid_gme.lo \
libcdo_la-afterburnerlib.lo libcdo_la-constants.lo \
libcdo_la-color.lo libcdo_la-commandline.lo \
libcdo_la-datetime.lo libcdo_la-ecacore.lo \
libcdo_la-ecautil.lo libcdo_la-exception.lo libcdo_la-expr.lo \
libcdo_la-expr_lex.lo libcdo_la-expr_yacc.lo \
libcdo_la-features.lo libcdo_la-field.lo libcdo_la-field2.lo \
libcdo_la-fieldc.lo libcdo_la-fieldmem.lo \
libcdo_la-fieldmer.lo libcdo_la-fieldzon.lo \
libcdo_la-gradsdeslib.lo libcdo_la-grid.lo \
libcdo_la-grid_area.lo libcdo_la-grid_gme.lo \
libcdo_la-grid_lcc.lo libcdo_la-grid_rot.lo \
libcdo_la-gridreference.lo libcdo_la-griddes.lo \
libcdo_la-griddes_h5.lo libcdo_la-griddes_nc.lo \
...
...
@@ -543,32 +544,32 @@ noinst_LTLIBRARIES = libcdo.la
libcdo_la_SOURCES = cdo_int.h compare.h cdo_pthread.c cdo_vlist.c \
cdo_getopt.c cdo_getopt.h cdo_history.c after_sptrans.c \
after_fctrans.c after_dvtrans.c after_vertint.c \
after_vertint.h
constants.h constants.c color.c color
.h \
commandline.c const.h counter.h
datetime.c datetime.h
\
dmemory.h dtypes.h ecacore.c ecacore.h
ecautil.c ecautil.h
\
error.h etopo.h temp.h mask.h exception.c
expr.c expr.h
\
expr_lex.c expr_yacc.c expr_yacc.h features.c
field.c field.h
\
field2.c fieldc.c fieldmem.c fieldmer.c
fieldzon.c functs.h
\
gradsdeslib.c gradsdeslib.h grid.c grid.h
grid_area.c
\
grid_gme.c grid_lcc.c grid_rot.c gridreference.c
griddes.c
\
griddes.h griddes_h5.c griddes_nc.c hetaeta.c
hetaeta.h
\
institution.c interpol.c interpol.h job.c juldate.c
kvlist.c
\
kvlist.h list.c list.h merge_sort2.c merge_sort2.h
modules.c
\
modules.h namelist.c namelist.h normal.c
nth_element.c
\
nth_element.h operator_help.h par_io.c par_io.h
percentiles.c
\
percentiles.
h
p
ipe.c
pipe.
h
p
ragma_omp_atomic_updat
e.h \
printinfo.h process.c process.h
pstream.c pstream.h
\
pstream
_int
.h pt
h
rea
d_debug.c
pthread_debug.
h readline.
c \
realtime.c remap.h remaplib
.c remapsort.c remap_scrip_io
.c \
remap
_search_reg2d.c remap_search_latbins.c remap_store_link
.c \
remap_store_link.
h
remap_store_link
_cnsrv.c
\
remap_store_link_cnsrv.
h
remap_
conserv.c remap
_c
o
ns
e
rv
_scrip.c
\
remap_
distwgt
_scrip.c remap_
bicubic
_scrip.c \
remap_bilinear_scrip.c stdnametable.c
stdnametable.h
\
specspace.c specspace.h statistic.c statistic.h
table.c text.c
\
text.h timebase.h timer.c userlog.c util.c
util.h zaxis.c
\
clipping/clipping.c clipping/clipping.h
clipping/area.c
\
clipping/area.h clipping/ensure_array_size.c \
after_vertint.h
afterburnerlib.c afterburner.h constants
.h \
constants.c color.c color.h
commandline.c const.h counter.h \
datetime.c datetime.h
dmemory.h dtypes.h ecacore.c ecacore.h \
ecautil.c ecautil.h
error.h etopo.h temp.h mask.h exception.c \
expr.c expr.h
expr_lex.c expr_yacc.c expr_yacc.h features.c \
field.c field.h
field2.c fieldc.c fieldmem.c fieldmer.c \
fieldzon.c functs.h
gradsdeslib.c gradsdeslib.h grid.c grid.h \
grid_area.c
grid_gme.c grid_lcc.c grid_rot.c gridreference.c \
griddes.c
griddes.h griddes_h5.c griddes_nc.c hetaeta.c \
hetaeta.h
institution.c interpol.c interpol.h job.c juldate.c \
kvlist.c
kvlist.h list.c list.h merge_sort2.c merge_sort2.h \
modules.c
modules.h namelist.c namelist.h normal.c \
nth_element.c
nth_element.h operator_help.h par_io.c par_io.h \
percentiles.
c
p
ercentiles.h
pipe.
c
p
ip
e.h \
pragma_omp_atomic_update.h
printinfo.h process.c process.h \
pstream
.c pstream
.h p
s
trea
m_int.h
pthread_debug.c \
pthread_debug.h readline.c
realtime.c remap.h remaplib.c \
remap
sort.c remap_scrip_io.c remap_search_reg2d
.c \
remap_search_latbins.c
remap_store_link.
c
remap_store_link
.h
\
remap_store_link_cnsrv.
c
remap_
store_link
_cnsrv
.h
\
remap_
conserv.c remap_conserv
_scrip.c remap_
distwgt
_scrip.c \
remap_bicubic_scrip.c
remap_bilinear_scrip.c stdnametable.c \
stdnametable.h
specspace.c specspace.h statistic.c statistic.h \
table.c text.c
text.h timebase.h timer.c userlog.c util.c \
util.h zaxis.c
clipping/clipping.c clipping/clipping.h \
clipping/area.c
clipping/area.h clipping/ensure_array_size.c \
clipping/ensure_array_size.h clipping/geometry_tools.c \
clipping/geometry.h clipping/grid.h clipping/points.h \
clipping/dep_list.h clipping/grid_cell.c clipping/grid_cell.h \
...
...
@@ -976,6 +977,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdo_la-after_fctrans.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdo_la-after_sptrans.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdo_la-after_vertint.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdo_la-afterburnerlib.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdo_la-cdo_getopt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdo_la-cdo_history.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdo_la-cdo_pthread.Plo@am__quote@
...
...
@@ -1136,6 +1138,13 @@ libcdo_la-after_vertint.lo: after_vertint.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcdo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcdo_la-after_vertint.lo `test -f 'after_vertint.c' || echo '$(srcdir)/'`after_vertint.c
libcdo_la-afterburnerlib.lo: afterburnerlib.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcdo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcdo_la-afterburnerlib.lo -MD -MP -MF $(DEPDIR)/libcdo_la-afterburnerlib.Tpo -c -o libcdo_la-afterburnerlib.lo `test -f 'afterburnerlib.c' || echo '$(srcdir)/'`afterburnerlib.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcdo_la-afterburnerlib.Tpo $(DEPDIR)/libcdo_la-afterburnerlib.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='afterburnerlib.c' object='libcdo_la-afterburnerlib.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcdo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcdo_la-afterburnerlib.lo `test -f 'afterburnerlib.c' || echo '$(srcdir)/'`afterburnerlib.c
libcdo_la-constants.lo: constants.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcdo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcdo_la-constants.lo -MD -MP -MF $(DEPDIR)/libcdo_la-constants.Tpo -c -o libcdo_la-constants.lo `test -f 'constants.c' || echo '$(srcdir)/'`constants.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcdo_la-constants.Tpo $(DEPDIR)/libcdo_la-constants.Plo
...
...
src/afterburner.h
0 → 100644
View file @
9e537bfe
#ifndef _AFTER_H
#define _AFTER_H
/* =============================================== */
/* These include files should be standard on all */
/* UNIX systems. */
/* =============================================== */
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
<stdarg.h>
#include
<errno.h>
#include
<ctype.h>
#include
<math.h>
#include
<float.h>
#include
<time.h>
#include
<pwd.h>
#include
<unistd.h>
#include
<sys/types.h>
#include
<sys/stat.h>
#include
<fcntl.h>
#include
<limits.h>
#ifndef _ERROR_H
# include "error.h"
#endif
#ifndef _DMEMORY_H
# include "dmemory.h"
#endif
#define FT_GRIB 1
#define FT_SERV 2
#define FT_CDF 3
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MaxLevel 1024
#define MaxCodes 277
#define S_ECHAM5 1
struct
Date
{
int
yr
;
int
mo
;
int
dy
;
int
hr
;
int
mn
;
};
struct
Control
{
int
Mean
;
int
MeanCount0
;
int
MeanCount
;
int
Multi
;
int
Nfiles
;
int
TermCount
;
int
OutputInterval
;
int
EndOfInterval
;
int
AnalysisData
;
/* 0 = ECHAM Data, 1 = ECMWF Spectral Analyses */
int
DayIn
;
/* day increment of infiles if Multi = TRUE */
int
Debug
;
int
Extrapolate
;
int
Szip
;
int
istreamID
;
int
ostreamID
;
int
ostreamID2
;
int
ivlistID
;
int
ovlistID
;
int
ovlistID2
;
struct
Date
NextDate
;
struct
Date
NewDate
;
struct
Date
OldDate
;
struct
Date
StartDate
;
int
nvct
;
double
*
vct
;
int
*
vert_index
;
int
*
pnmiss
;
double
*
Orography
;
double
*
p_of_height
;
int
Type
;
int
unitsel
;
int
Fouriers
;
int
Latitudes
;
int
Longitudes
;
int
HalfLevels
;
int
Gaussian
;
int
Spectral
;
int
Truncation
;
int
Waves
;
int
Dim3FC
,
Dim3SP
,
Dim3GP
;
int
DimFC
,
DimGP
,
DimSP
;
int
DimSP_half
;
double
*
poli
;
double
*
pold
;
double
*
pdev
;
double
*
pol2
;
double
*
pol3
;
double
*
dv2uv_f1
;
double
*
dv2uv_f2
;
int
NumCodesRequest
;
int
NumLevel
;
int
NumLevelFound
;
int
NumLevelRequest
;
double
LevelRequest
[
MaxLevel
];
double
*
rcoslat
;
double
*
coslat
;
double
*
DerivationFactor
;
double
*
Field
;
};
struct
Variable
{
int
needed0
;
/* var needed for process */
int
needed
;
/* var needed for process */
int
selected
;
/* var selected for output */
int
detected
;
/* var detected in input */
int
comp
;
/* compute var if selected and not detected */
int
sfit
;
int
hlev
;
int
plev
;
int
ivarID
;
int
ovarID
;
/* 1st variable ID */
int
ovarID2
;
/* 2nd variable ID used for variance */
int
tableID
;
int
igridID
;
int
ogridID
;
int
izaxisID
;
int
ozaxisID
;
int
nmiss0
;
int
nmiss
;
double
missval
;
double
*
spectral
;
double
*
spectral0
;
double
*
fourier
;
double
*
hybrid
;
double
*
hybrid0
;
double
*
height
;
double
*
grid
;
double
*
grid0
;
double
*
mean
;
double
*
variance
;
int
*
samp
;
};
/* FFT */
void
fft_set
(
double
*
trigs
,
long
*
ifax
,
long
n
);
void
fc2gp
(
double
*
trig
,
long
*
ifax
,
double
*
fc
,
double
*
gp
,
long
nlat
,
long
nlon
,
long
nlev
,
long
nfc
);
void
gp2fc
(
double
*
trig
,
long
*
ifax
,
double
*
gp
,
double
*
fc
,
long
nlat
,
long
nlon
,
long
nlev
,
long
nfc
);
/* Convert Spectral Array to new resolution */
void
sp2sp
(
double
*
arrayIn
,
int
truncIn
,
double
*
arrayOut
,
int
truncOut
);
void
sp2fc
(
const
double
*
sa
,
double
*
fa
,
const
double
*
poli
,
long
nlev
,
long
nlat
,
long
nfc
,
long
nt
);
void
fc2sp
(
double
*
fa
,
double
*
sa
,
double
*
poli
,
int
klev
,
int
nlat
,
int
nfc
,
int
nt
);
/* Physc */
void
dv2ps
(
const
double
*
restrict
div
,
double
*
restrict
pot
,
long
nlev
,
long
ntr
);
void
dv2uv
(
double
*
d
,
double
*
o
,
double
*
u
,
double
*
v
,
double
*
f
,
double
*
g
,
int
nt
,
int
nsp
,
int
nlev
);
void
scaluv
(
double
*
fu
,
double
rclat
[],
int
nlat
,
int
lot
);
void
uv2dv
(
double
*
fu
,
double
*
fv
,
double
*
sd
,
double
*
sv
,
double
*
pol2
,
double
*
pol3
,
int
klev
,
int
nlat
,
int
nt
);
void
geninx
(
long
ntr
,
double
*
f
,
double
*
g
);
void
MakeGeopotHeight
(
double
*
geop
,
double
*
gt
,
double
*
gq
,
double
*
ph
,
int
nhor
,
int
nlev
);
void
LayerWater
(
double
*
ww
,
double
*
ll
,
double
pmax
,
double
pmin
,
int
DimGP
,
int
HalfLevels
,
double
*
vct
);
void
LayerCloud
(
double
*
cc
,
double
*
ll
,
double
pmax
,
double
pmin
,
int
DimGP
,
int
HalfLevels
,
double
*
vct
);
#define LOW_CLOUD 34
#define MID_CLOUD 35
#define HIH_CLOUD 36
#define LOW_WATER 37
/* not used ? */
#define MID_WATER 38
/* not used ? */
#define HIH_WATER 39
/* not used ? */
#define ALL_WATER 40
/* not used ? */
#define GEOPOTENTIAL 129
#define TEMPERATURE 130
#define U_WIND 131
#define V_WIND 132
#define HUMIDITY 133
#define PS 134
#define OMEGA 135
#define VORTICITY 138
#define TS 139
#define STREAM 148
#define VELOPOT 149
#define SLP 151
#define LNPS 152
#define DIVERGENCE 155
#define GEOPOTHEIGHT 156
#define RHUMIDITY 157
#define SW_BOT_CLF 189
/* not used ? */
#define LW_BOT_CLF 190
/* not used ? */
#define SW_TOP_CLF 191
/* not used ? */
#define LW_TOP_CLF 192
/* not used ? */
#define NET_TOP_CLF 193
/* not computed */
#define WINDSPEED 259
#define PRECIP 260
#define NET_TOP 261
#define NET_BOT 262
#define NET_HEAT 263
#define NET_WATER 264
#define SW_CLF 265
#define LW_CLF 266
#define NET_CLF 267
#define SW_ATM 268
#define LW_ATM 269
#define NET_ATM 270
#define SURF_RUNOFF 271
#define DPSDX 273
#define DPSDY 274
#define FRESH_WATER 275
#define PS_PROG 276
/* PS for prognostic timestep */
#define HALF_PRESS 277
#define FULL_PRESS 278
#define THETAH 279
#define THETAF 280
void
*
FreeMemory
(
void
*
ptr
);
double
*
alloc_dp
(
int
words
,
char
*
array_name
);
void
after_copy_array
(
void
*
destination
,
void
*
source
,
int
words
);
void
after_zero_array
(
double
*
field
,
int
words
);
void
after_read_vct
(
const
char
*
vctfile
,
double
**
vct
,
int
*
nvct
);
void
after_gp2sp
(
struct
Control
*
globs
,
struct
Variable
*
vars
,
int
ccode
);
void
after_GP2FC
(
double
*
gp
,
double
*
fc
,
long
nlat
,
long
nlon
,
long
nlev
,
long
nfc
);
void
after_FC2GP
(
double
*
fc
,
double
*
gp
,
long
nlat
,
long
nlon
,
long
nlev
,
long
nfc
);
void
after_FCrh2FCsh
(
struct
Control
*
globs
,
struct
Variable
*
vars
);
void
after_SPuv2SPdv
(
struct
Control
*
globs
,
struct
Variable
*
vars
);
void
after_FCsh2FCrh
(
struct
Control
*
globs
,
struct
Variable
*
vars
);
void
after_EchamCompGP
(
struct
Control
*
globs
,
struct
Variable
*
vars
);
void
after_processPL
(
struct
Control
*
globs
,
struct
Variable
*
vars
);
void
after_processML
(
struct
Control
*
globs
,
struct
Variable
*
vars
);
void
after_AnalysisAddRecord
(
struct
Control
*
globs
,
struct
Variable
*
vars
,
int
code
,
int
gridID
,
int
zaxisID
,
int
levelID
,
int
nmiss
);
void
after_EchamAddRecord
(
struct
Control
*
globs
,
struct
Variable
*
vars
,
int
code
,
int
gridID
,
int
zaxisID
,
int
levelID
,
int
nmiss
);
void
after_AnalysisDependencies
(
struct
Variable
*
vars
,
int
ncodes
);
void
after_EchamDependencies
(
struct
Variable
*
vars
,
int
ncodes
,
int
type
,
int
source
);
#endif
/* afterburner.h */
src/afterburnerlib.c
0 → 100644
View file @
9e537bfe
This diff is collapsed.
Click to expand it.
src/specspace.c
View file @
9e537bfe
...
...
@@ -22,6 +22,7 @@ void after_legini_full(int ntr, int nlat, double *restrict poli, double *restric
double
*
restrict
pol2
,
double
*
restrict
pol3
,
double
*
restrict
coslat
);
void
after_legini
(
int
ntr
,
int
nlat
,
double
*
restrict
poli
,
double
*
restrict
pold
,
double
*
restrict
coslat
);
void
grid2spec
(
SPTRANS
*
sptrans
,
int
gridIDin
,
double
*
arrayIn
,
int
gridIDout
,
double
*
arrayOut
)
{
int
nlev
=
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment